Skip to contentSkip to conversation

S3C64XX DMA: Protect buffer pointers while manipulation

PATCH New Jassi Brar 1 participant 1 message Nov 5, 2009

Subsystems (3)
lore
Share & tools
lore

Jassi Brar

author
#0 lore raw

PATCH 1/5 S3C64XX DMA: Protect buffer pointers while manipulation

---
 arch/arm/plat-s3c64xx/dma.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/plat-s3c64xx/dma.c +5 -0
index 266a107..6fa706f 100644
@@ -339,6 +339,7 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
 	struct s3c64xx_dma_buff *next;
 	struct s3c64xx_dma_buff *buff;
 	struct pl080s_lli *lli;
+	unsigned long flags;
 	int ret;
 
 	WARN_ON(!chan);
@@ -366,6 +367,8 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
 
 	s3c64xx_dma_fill_lli(chan, lli, data, size);
 
+	local_irq_save(flags);
+
 	if ((next = chan->next) != NULL) {
 		struct s3c64xx_dma_buff *end = chan->end;
 		struct pl080s_lli *endlli = end->lli;
@@ -397,6 +400,8 @@ int s3c2410_dma_enqueue(unsigned int channel, void *id,
 		s3c64xx_lli_to_regs(chan, lli);
 	}
 
+	local_irq_restore(flags);
+
 	show_lli(lli);
 
 	dbg_showchan(chan);
Signature · 1 line
1.6.2.5