Skip to content

Commit

Permalink
ARM: S3C64XX: DMA: Protect buffer pointers while manipulation
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jassi Brar authored and Ben Dooks committed Nov 9, 2009
1 parent 799dd75 commit 210012a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/arm/plat-s3c64xx/dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 210012a

Please sign in to comment.