Skip to contentSkip to conversation

V4L2: omap_vout: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP

PATCH In review Amber Jain 3 participants 4 messages May 31, 2011 – Jun 1, 2011 Media (V4L/DVB)

lore
Share & tools
lore

Amber Jain

author
#0 lore raw

PATCH 1/1 V4L2: omap_vout: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP

Remove GFP_DMA from the __get_free_pages() call from omap_vout as ZONE_DMA is not configured on OMAP. Earlier the page allocator used to return a page from ZONE_NORMAL even when GFP_DMA is passed and CONFIG_ZONE_DMA is disabled. As a result of commit a197b59ae6e8bee56fcef37ea2482dc08414e2ac, page allocator returns null in such a scenario with a warning emitted to kernel log.

---
 drivers/media/video/omap/omap_vout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/omap/omap_vout.c +1 -1
index 4ada9be..8cac624 100644
@@ -181,7 +181,7 @@ static unsigned long omap_vout_alloc_buffer(u32 buf_size, u32 *phys_addr)
 
 	size = PAGE_ALIGN(buf_size);
 	order = get_order(size);
-	virt_addr = __get_free_pages(GFP_KERNEL | GFP_DMA, order);
+	virt_addr = __get_free_pages(GFP_KERNEL, order);
 	addr = virt_addr;
 
 	if (virt_addr) {
Signature · 1 line
1.7.1
author
#1 lore raw

PATCH 1/1 OMAP2: V4L2: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP

Remove GFP_DMA from the __get_free_pages() call from omap24xxcam as ZONE_DMA is not configured on OMAP. Earlier the page allocator used to return a page from ZONE_NORMAL even when GFP_DMA is passed and CONFIG_ZONE_DMA is disabled. As a result of commit a197b59ae6e8bee56fcef37ea2482dc08414e2ac, page allocator returns null in such a scenario with a warning emitted to kernel log.

---
 drivers/media/video/omap24xxcam.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/media/video/omap24xxcam.c +2 -2
index f6626e8..d92d4c6 100644
@@ -309,11 +309,11 @@ static int omap24xxcam_vbq_alloc_mmap_buffer(struct videobuf_buffer *vb)
 			order--;
 
 		/* try to allocate as many contiguous pages as possible */
-		page = alloc_pages(GFP_KERNEL | GFP_DMA, order);
+		page = alloc_pages(GFP_KERNEL, order);
 		/* if allocation fails, try to allocate smaller amount */
 		while (page == NULL) {
 			order--;
-			page = alloc_pages(GFP_KERNEL | GFP_DMA, order);
+			page = alloc_pages(GFP_KERNEL, order);
 			if (page == NULL && !order) {
 				err = -ENOMEM;
 				goto out;
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#2 lore raw

Re: [PATCH] OMAP2: V4L2: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP

Hi Amber,

Thanks for the patch.

Quoted 10 lines · Amber Jain

Remove GFP_DMA from the __get_free_pages() call from omap24xxcam as ZONE_DMA is not configured on OMAP. Earlier the page allocator used to return a page from ZONE_NORMAL even when GFP_DMA is passed and CONFIG_ZONE_DMA is disabled. As a result of commit a197b59ae6e8bee56fcef37ea2482dc08414e2ac, page allocator returns null in such a scenario with a warning emitted to kernel log.

---
 drivers/media/video/omap24xxcam.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Quoted 21 lines
drivers/media/video/omap24xxcam.c +2 -2
index f6626e8..d92d4c6 100644
@@ -309,11 +309,11 @@ static int omap24xxcam_vbq_alloc_mmap_buffer(struct videobuf_buffer *vb)
 			order--;
 
 		/* try to allocate as many contiguous pages as possible */
-		page = alloc_pages(GFP_KERNEL | GFP_DMA, order);
+		page = alloc_pages(GFP_KERNEL, order);
 		/* if allocation fails, try to allocate smaller amount */
 		while (page == NULL) {
 			order--;
-			page = alloc_pages(GFP_KERNEL | GFP_DMA, order);
+			page = alloc_pages(GFP_KERNEL, order);
 			if (page == NULL && !order) {
 				err = -ENOMEM;
 				goto out;
Signature · 1 line
1.7.1
Signature · 2 lines
Sakari Ailus
sakari dot ailus at iki dot fi
Tested-by Acked-by on v1 1/1
#3 lore raw
In reply to Amber Jain
Quoted 18 lines

-----Original Message-----
From: JAIN, AMBER
Sent: Tuesday, May 31, 2011 8:16 PM
To: [email protected]
Cc: Hiremath, Vaibhav; [email protected]; JAIN, AMBER
Subject: [PATCH] V4L2: omap_vout: Remove GFP_DMA allocation as ZONE_DMA is not configured on OMAP

Remove GFP_DMA from the __get_free_pages() call from omap_vout as ZONE_DMA is not configured on OMAP. Earlier the page allocator used to return a page
from ZONE_NORMAL even when GFP_DMA is passed and CONFIG_ZONE_DMA is disabled.
As a result of commit a197b59ae6e8bee56fcef37ea2482dc08414e2ac, page allocator
returns null in such a scenario with a warning emitted to kernel log.

Quoted 2 lines

---

[Hiremath, Vaibhav] Tested on OMAP3EVM.

Thanks,
Vaibhav

Quoted 20 lines
 drivers/media/video/omap/omap_vout.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/media/video/omap/omap_vout.c +1 -1
index 4ada9be..8cac624 100644
@@ -181,7 +181,7 @@ static unsigned long omap_vout_alloc_buffer(u32
 buf_size, u32 *phys_addr)
 
 	size = PAGE_ALIGN(buf_size);
 	order = get_order(size);
-	virt_addr = __get_free_pages(GFP_KERNEL | GFP_DMA, order);
+	virt_addr = __get_free_pages(GFP_KERNEL, order);
 	addr = virt_addr;
 

if (virt_addr) {
--
1.7.1