Patchwork [meta-fsl-arm] imx-vpu: fix checks of IOGetVirtMem() return value

login
register
mail settings
Submitter Otavio Salvador
Date June 25, 2014, 4:18 p.m.
Message ID <CAP9ODKqfXzLFN1KUNQD3vvVDcciyZm4-iY4uL19td2meRvEtgw@mail.gmail.com>
Download mbox | patch
Permalink /patch/74381/
State Not Applicable
Delegated to: Otavio Salvador
Headers show

Comments

Otavio Salvador - June 25, 2014, 4:18 p.m.
Hello Eric,
Hello Lauren,

On Sat, Jun 21, 2014 at 2:52 PM, Eric Nelson
<eric.nelson@boundarydevices.com> wrote:
> The IOGetVirtMem() routine returns the address of a memory block
> or -1 (MAP_FAILED) to indicate an error.
>
> Many callers of this routine tested the return value for <= 0
> to detect failure, and at least with a 3G/1G memory split
> configured in the kernel, a negative number (!= -1) is a
> valid (successful) return value.
>
> Without this patch, the IOSystemInit() will often detect
> failure incorrectly.
>
> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>

Eric, you forgot the add the upstream-status field as:


I have done it here, so no need to resend it but please do it next time.

Lauren, this patch should be reviewed internally.
Eric Nelson - June 25, 2014, 4:22 p.m.
On 06/25/2014 09:18 AM, Otavio Salvador wrote:
> Hello Eric,
> Hello Lauren,
> 
> On Sat, Jun 21, 2014 at 2:52 PM, Eric Nelson
> <eric.nelson@boundarydevices.com> wrote:
>> The IOGetVirtMem() routine returns the address of a memory block
>> or -1 (MAP_FAILED) to indicate an error.
>>
>> Many callers of this routine tested the return value for <= 0
>> to detect failure, and at least with a 3G/1G memory split
>> configured in the kernel, a negative number (!= -1) is a
>> valid (successful) return value.
>>
>> Without this patch, the IOSystemInit() will often detect
>> failure incorrectly.
>>
>> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
> 
> Eric, you forgot the add the upstream-status field as:
> 
> diff --git a/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
> b/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
> index 26826ba..348a536 100644
> --- a/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
> +++ b/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
> @@ -3,6 +3,8 @@ From: Eric Nelson <eric.nelson@boundarydevices.com>
>  Date: Fri, 20 Jun 2014 19:42:38 -0700
>  Subject: [PATCH] IOGetVirtMem returns -1 (MAP_FAILED) on failure
> 
> +Upstream-Status: Pending
> +
>  Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
>  ---
>   vpu/vpu_io.c  | 2 +-
> 
> I have done it here, so no need to resend it but please do it next time.
> 

Thanks Otavio.

> Lauren, this patch should be reviewed internally.
> 

This should be a quick scan, since the routines are pretty simple.

Regards,


Eric
Lauren Post - June 26, 2014, 12:22 a.m.
>>Lauren, this patch should be reviewed internally.

I've forwarded it to the ownwers of imx-vpu to review.  Sorry I missed this last weekend.
Eric Nelson - June 26, 2014, 1:03 a.m.
On 06/25/2014 05:22 PM, Lauren Post wrote:
> 
>>> Lauren, this patch should be reviewed internally.
> 
> I've forwarded it to the ownwers of imx-vpu to review.  Sorry I missed this last weekend.
> 

Thanks Lauren.

Patch

diff --git a/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
b/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
index 26826ba..348a536 100644
--- a/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
+++ b/recipes-bsp/imx-vpu/imx-vpu/0001-IOGetVirtMem-returns-1-MAP_FAILED-on-failure.patch
@@ -3,6 +3,8 @@  From: Eric Nelson <eric.nelson@boundarydevices.com>
 Date: Fri, 20 Jun 2014 19:42:38 -0700
 Subject: [PATCH] IOGetVirtMem returns -1 (MAP_FAILED) on failure

+Upstream-Status: Pending
+
 Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
 ---
  vpu/vpu_io.c  | 2 +-