summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2014-03-18 20:40:59 +0800
committerRichard Liu <r66033@freescale.com>2014-05-15 15:07:29 +0800
commitecd7caaa5ec4328f324decde008bacfc93099bdc (patch)
tree462b9fc54bd664c46fe98bcc186b8c92be288616
parenteb955578de7088c054a9a3ace150e788b27cada6 (diff)
ENGR00303820 [#887] refine physical address check for external memory
2G above address will cause system reboot and fixed in original patch, error check code is added based on the original logic. Signed-off-by: Xianzhong <b07117@freescale.com> Acked-by: Jason Liu
-rw-r--r--drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c31
1 files changed, 18 insertions, 13 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
index b75e7f64030e..9e2c452c7c65 100644
--- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
+++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c
@@ -736,22 +736,27 @@ _AllocateMemory_Retry:
gctUINT32 physAddr=0;
gctUINT32 baseAddress = 0;
- gckOS_LockPages(Kernel->os,
- node->Virtual.physical,
- node->Virtual.bytes,
- gcvFALSE,
- &node->Virtual.logical,
- &node->Virtual.pageCount);
+ gcmkONERROR(
+ gckOS_LockPages(Kernel->os,
+ node->Virtual.physical,
+ node->Virtual.bytes,
+ gcvFALSE,
+ &node->Virtual.logical,
+ &node->Virtual.pageCount));
/* Convert logical address into a physical address. */
- gckOS_GetPhysicalAddress(Kernel->os, node->Virtual.logical, &physAddr);
+ gcmkONERROR(
+ gckOS_GetPhysicalAddress(Kernel->os,
+ node->Virtual.logical,
+ &physAddr));
- gckOS_UnlockPages(Kernel->os,
- node->Virtual.physical,
- node->Virtual.bytes,
- node->Virtual.logical);
+ gcmkONERROR(
+ gckOS_UnlockPages(Kernel->os,
+ node->Virtual.physical,
+ node->Virtual.bytes,
+ node->Virtual.logical));
- gckOS_GetBaseAddress(Kernel->os, &baseAddress);
+ gcmkONERROR(gckOS_GetBaseAddress(Kernel->os, &baseAddress));
gcmkASSERT(physAddr >= baseAddress);
@@ -762,7 +767,7 @@ _AllocateMemory_Retry:
{
gckOS_Print("gpu virtual memory 0x%x cannot be allocated for external use !\n", physAddr);
- gckVIDMEM_Free(node);
+ gcmkONERROR(gckVIDMEM_Free(node));
node = gcvNULL;
}