summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJassi Brar <jassi.brar@samsung.com>2009-11-05 05:44:20 +0100
committerBen Dooks <ben-linux@fluff.org>2009-11-10 00:50:39 +0100
commit210012a6cd8770a73d1aa74b742667b462d04511 (patch)
treec3a1c556222de34be855711b252ea467f77aaf20 /arch
parentMerge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git... (diff)
downloadlinux-210012a6cd8770a73d1aa74b742667b462d04511.tar.xz
linux-210012a6cd8770a73d1aa74b742667b462d04511.zip
ARM: S3C64XX: DMA: Protect buffer pointers while manipulation
Ensure the DMA buffer points are not updated from another source during the process of enquing a buffer. Signed-off-by: Jassi Brar <jassi.brar@samsung.com> [ben-linux@fluff.org: Updated patch comment] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/plat-s3c64xx/dma.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c64xx/dma.c b/arch/arm/plat-s3c64xx/dma.c
index 266a10745a85..6fa706f0f42a 100644
--- a/arch/arm/plat-s3c64xx/dma.c
+++ b/arch/arm/plat-s3c64xx/dma.c
@@ -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);