summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGowtham Tammana2017-03-04 00:06:13 -0600
committerGowtham Tammana2017-04-12 17:26:21 -0500
commit295443bf56f2100b7b2714c2c30b31ba86e96a0c (patch)
tree70be24b577d47d07438d341e999eb4b352db41b7
parent030df5ecf503ef3c83dca6e732e6d47d4a11cd4b (diff)
downloadti-gc320-driver-295443bf56f2100b7b2714c2c30b31ba86e96a0c.tar.gz
ti-gc320-driver-295443bf56f2100b7b2714c2c30b31ba86e96a0c.tar.xz
ti-gc320-driver-295443bf56f2100b7b2714c2c30b31ba86e96a0c.zip
Use __GFP_DMA32 for allocationsti-5.0.11.p7-k4.9
GC320 cannot access memory with address >32 bits. Explicitly request all the allocations to be in DMA32 zone by setting __GFP_DMA32 flag. All omap bo allocations are in DMA32 zone, so no special care is needed for handling omap bo buffers in the driver. Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rwxr-xr-xsrc/hal/os/linux/kernel/gc_hal_kernel_allocator.c6
-rwxr-xr-xsrc/hal/os/linux/kernel/gc_hal_kernel_os.c5
2 files changed, 6 insertions, 5 deletions
diff --git a/src/hal/os/linux/kernel/gc_hal_kernel_allocator.c b/src/hal/os/linux/kernel/gc_hal_kernel_allocator.c
index 11c7add..d07d859 100755
--- a/src/hal/os/linux/kernel/gc_hal_kernel_allocator.c
+++ b/src/hal/os/linux/kernel/gc_hal_kernel_allocator.c
@@ -183,7 +183,7 @@ _NonContiguousAlloc(
183 183
184 if (!pages) 184 if (!pages)
185 { 185 {
186 pages = vmalloc(size); 186 pages = __vmalloc(size, GFP_KERNEL | __GFP_DMA32, PAGE_KERNEL);
187 187
188 if (!pages) 188 if (!pages)
189 { 189 {
@@ -194,7 +194,7 @@ _NonContiguousAlloc(
194 194
195 for (i = 0; i < NumPages; i++) 195 for (i = 0; i < NumPages; i++)
196 { 196 {
197 p = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | gcdNOWARN); 197 p = alloc_page(GFP_KERNEL | __GFP_DMA32 | gcdNOWARN);
198 198
199 if (!p) 199 if (!p)
200 { 200 {
@@ -381,7 +381,7 @@ _DefaultAlloc(
381 if (Mdl->u.contiguousPages == gcvNULL) 381 if (Mdl->u.contiguousPages == gcvNULL)
382 { 382 {
383 Mdl->u.contiguousPages = 383 Mdl->u.contiguousPages =
384 alloc_pages(GFP_KERNEL | __GFP_HIGHMEM | gcdNOWARN, order); 384 alloc_pages(GFP_KERNEL | __GFP_DMA32 | gcdNOWARN, order);
385 385
386#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) 386#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
387 Mdl->exact = gcvFALSE; 387 Mdl->exact = gcvFALSE;
diff --git a/src/hal/os/linux/kernel/gc_hal_kernel_os.c b/src/hal/os/linux/kernel/gc_hal_kernel_os.c
index 2b477df..f8ec4ab 100755
--- a/src/hal/os/linux/kernel/gc_hal_kernel_os.c
+++ b/src/hal/os/linux/kernel/gc_hal_kernel_os.c
@@ -706,7 +706,7 @@ gckOS_Construct(
706 gcmkONERROR(gcvSTATUS_OUT_OF_MEMORY); 706 gcmkONERROR(gcvSTATUS_OUT_OF_MEMORY);
707 } 707 }
708 708
709 os->paddingPage = alloc_page(GFP_KERNEL | __GFP_HIGHMEM | gcdNOWARN); 709 os->paddingPage = alloc_page(GFP_KERNEL | __GFP_DMA32 | gcdNOWARN);
710 if (os->paddingPage == gcvNULL) 710 if (os->paddingPage == gcvNULL)
711 { 711 {
712 /* Out of memory. */ 712 /* Out of memory. */
@@ -1073,7 +1073,8 @@ gckOS_AllocateMemory(
1073 1073
1074 if (Bytes > PAGE_SIZE) 1074 if (Bytes > PAGE_SIZE)
1075 { 1075 {
1076 memory = (gctPOINTER) vmalloc(Bytes); 1076 memory = (gctPOINTER) __vmalloc(Bytes,
1077 GFP_KERNEL | __GFP_DMA32, PAGE_KERNEL);
1077 } 1078 }
1078 else 1079 else
1079 { 1080 {