aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXianzhong <b07117@freescale.com>2014-03-18 08:40:59 -0400
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:58:00 -0400
commitb0a7a9c6a4641b3f4bbcd59551b7afc3ed3662a1 (patch)
tree5e5c70730903a4fbbaab1bcf513931008f95692e
parent2f73dd368a1cfdb9f33ead5a115907e16c253670 (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 (cherry picked from commit 7d85c98bf781eb047c2000bd82ea7559c24a2446)
-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 8b9d3c789cd3..879d467e3620 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:
736 gctUINT32 physAddr=0; 736 gctUINT32 physAddr=0;
737 gctUINT32 baseAddress = 0; 737 gctUINT32 baseAddress = 0;
738 738
739 gckOS_LockPages(Kernel->os, 739 gcmkONERROR(
740 node->Virtual.physical, 740 gckOS_LockPages(Kernel->os,
741 node->Virtual.bytes, 741 node->Virtual.physical,
742 gcvFALSE, 742 node->Virtual.bytes,
743 &node->Virtual.logical, 743 gcvFALSE,
744 &node->Virtual.pageCount); 744 &node->Virtual.logical,
745 &node->Virtual.pageCount));
745 746
746 /* Convert logical address into a physical address. */ 747 /* Convert logical address into a physical address. */
747 gckOS_GetPhysicalAddress(Kernel->os, node->Virtual.logical, &physAddr); 748 gcmkONERROR(
749 gckOS_GetPhysicalAddress(Kernel->os,
750 node->Virtual.logical,
751 &physAddr));
748 752
749 gckOS_UnlockPages(Kernel->os, 753 gcmkONERROR(
750 node->Virtual.physical, 754 gckOS_UnlockPages(Kernel->os,
751 node->Virtual.bytes, 755 node->Virtual.physical,
752 node->Virtual.logical); 756 node->Virtual.bytes,
757 node->Virtual.logical));
753 758
754 gckOS_GetBaseAddress(Kernel->os, &baseAddress); 759 gcmkONERROR(gckOS_GetBaseAddress(Kernel->os, &baseAddress));
755 760
756 gcmkASSERT(physAddr >= baseAddress); 761 gcmkASSERT(physAddr >= baseAddress);
757 762
@@ -762,7 +767,7 @@ _AllocateMemory_Retry:
762 { 767 {
763 gckOS_Print("gpu virtual memory 0x%x cannot be allocated in force contiguous request!\n", physAddr); 768 gckOS_Print("gpu virtual memory 0x%x cannot be allocated in force contiguous request!\n", physAddr);
764 769
765 gckVIDMEM_Free(node); 770 gcmkONERROR(gckVIDMEM_Free(node));
766 771
767 node = gcvNULL; 772 node = gcvNULL;
768 } 773 }