]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00303820 [#887] refine physical address check for external memory
authorXianzhong <b07117@freescale.com>
Tue, 18 Mar 2014 12:40:59 +0000 (20:40 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 20 Aug 2014 08:06:58 +0000 (10:06 +0200)
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
(cherry picked from commit 7d85c98bf781eb047c2000bd82ea7559c24a2446)
(cherry picked from commit 04911cf737a4a40e7914ad94fd58bf92dcfa4a92)

drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel.c

index 8b9d3c789cd34030c45bf5dcfb0513ffacff6f90..879d467e36206292fe3fcce3011b4bedd69da473 100644 (file)
@@ -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 in force contiguous request!\n", physAddr);
 
-                        gckVIDMEM_Free(node);
+                        gcmkONERROR(gckVIDMEM_Free(node));
 
                         node = gcvNULL;
                     }