Skip to content

Commit

Permalink
sh: guard cookie consistency across termination in the DMA driver
Browse files Browse the repository at this point in the history
If all descriptors on a channel are terminated or the channel is released,
update the completed cookie counter to match the last cookie. This prevents
inconsistency warning on resumed DMA operation.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Guennadi Liakhovetski authored and Paul Mundt committed May 22, 2010
1 parent 7a5c106 commit 9255f1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/dma/shdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,10 @@ static void sh_dmae_chan_ld_cleanup(struct sh_dmae_chan *sh_chan, bool all)
{
while (__ld_cleanup(sh_chan, all))
;

if (all)
/* Terminating - forgive uncompleted cookies */
sh_chan->completed_cookie = sh_chan->common.cookie;
}

static void sh_chan_xfer_ld_queue(struct sh_dmae_chan *sh_chan)
Expand Down

0 comments on commit 9255f1d

Please sign in to comment.