]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/dma/shdma.c
sh: guard cookie consistency across termination in the DMA driver
[net-next-2.6.git] / drivers / dma / shdma.c
index 427d514796dd28d8547c48e3ffe15ca16247fcef..a2a519fd2a24fc3ec9f4d1daa63fba110d99684e 100644 (file)
@@ -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)