Skip to contentSkip to conversation

S3C64XX DMA: Debugged alloc's with GFP_KERNEL flag in Intr context.

PATCH New Jassi 2 participants 2 messages Sep 15, 2009

Subsystems (3)
lore
Share & tools
lore

Jassi

author
#0 lore raw

PATCH 3/7 S3C64XX DMA: Debugged alloc's with GFP_KERNEL flag in Intr context.

s3c2410_dma_enqueue makes call to kzalloc and dma_pool_alloc with GFP_KERNEL flag set, this can be an issue for drivers, like I2S, which call s3c2410_dma_enqueue from dma-bufferdone callback.
Changed the flag GFP_KERNEL to GFP_ATOMIC.

---
 arch/arm/plat-s3c64xx/dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s3c64xx/dma.c +2 -2
index b26d2a2..266a107 100644
@@ -345,13 +345,13 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
 	if (!chan)
 		return -EINVAL;
 
-	buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL);
+	buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_ATOMIC);
 	if (!buff) {
 		printk(KERN_ERR "%s: no memory for buffer\n", __func__);
 		return -ENOMEM;
 	}
 
-	lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma);
+	lli = dma_pool_alloc(dma_pool, GFP_ATOMIC, &buff->lli_dma);
 	if (!lli) {
 		printk(KERN_ERR "%s: no memory for lli\n", __func__);
 		ret = -ENOMEM;
Signature · 1 line
1.6.2.5
Applied
#1 lore raw

PATCH 3/7 S3C64XX DMA: Debugged alloc's with GFP_KERNEL flag in Intr context.

Quoted 4 lines · Jassi

s3c2410_dma_enqueue makes call to kzalloc and dma_pool_alloc with GFP_KERNEL flag set, this can be an issue for drivers, like I2S, which call s3c2410_dma_enqueue from dma-bufferdone callback.
Changed the flag GFP_KERNEL to GFP_ATOMIC.

applied to next-s3c64xx-fixes, with some edits to the description.

Quoted 33 lines
---
 arch/arm/plat-s3c64xx/dma.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/plat-s3c64xx/dma.c +2 -2
index b26d2a2..266a107 100644
@@ -345,13 +345,13 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
 	if (!chan)
 		return -EINVAL;
 
-	buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_KERNEL);
+	buff = kzalloc(sizeof(struct s3c64xx_dma_buff), GFP_ATOMIC);
 	if (!buff) {
 		printk(KERN_ERR "%s: no memory for buffer\n", __func__);
 		return -ENOMEM;
 	}
 
-	lli = dma_pool_alloc(dma_pool, GFP_KERNEL, &buff->lli_dma);
+	lli = dma_pool_alloc(dma_pool, GFP_ATOMIC, &buff->lli_dma);
 	if (!lli) {
 		printk(KERN_ERR "%s: no memory for lli\n", __func__);
 		ret = -ENOMEM;
Signature · 7 lines
1.6.2.5


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 5 lines
-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.