diff options
author | Russell King - ARM Linux <linux@arm.linux.org.uk> | 2012-03-06 17:34:06 -0500 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-03-13 02:06:06 -0400 |
commit | 4d4e58de32a192fea65ab84509d17d199bd291c8 (patch) | |
tree | be35531778c9cc6bee73beb94d07e176a6f3599d /drivers/dma/shdma.c | |
parent | 08714f60b0fc6ea3a060b69b32e77139f14e6045 (diff) |
dmaengine: move last completed cookie into generic dma_chan structure
Every DMA engine implementation declares a last completed dma cookie
in their private dma channel structures. This is pointless, and
forces driver specific code. Move this out into the common dma_chan
structure.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
[imx-sdma.c & mxs-dma.c]
Tested-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Diffstat (limited to 'drivers/dma/shdma.c')
-rw-r--r-- | drivers/dma/shdma.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index 812fd76e9c18..ae84c12e3865 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
@@ -764,12 +764,12 @@ static dma_async_tx_callback __ld_cleanup(struct sh_dmae_chan *sh_chan, bool all | |||
764 | cookie = tx->cookie; | 764 | cookie = tx->cookie; |
765 | 765 | ||
766 | if (desc->mark == DESC_COMPLETED && desc->chunks == 1) { | 766 | if (desc->mark == DESC_COMPLETED && desc->chunks == 1) { |
767 | if (sh_chan->completed_cookie != desc->cookie - 1) | 767 | if (sh_chan->common.completed_cookie != desc->cookie - 1) |
768 | dev_dbg(sh_chan->dev, | 768 | dev_dbg(sh_chan->dev, |
769 | "Completing cookie %d, expected %d\n", | 769 | "Completing cookie %d, expected %d\n", |
770 | desc->cookie, | 770 | desc->cookie, |
771 | sh_chan->completed_cookie + 1); | 771 | sh_chan->common.completed_cookie + 1); |
772 | sh_chan->completed_cookie = desc->cookie; | 772 | sh_chan->common.completed_cookie = desc->cookie; |
773 | } | 773 | } |
774 | 774 | ||
775 | /* Call callback on the last chunk */ | 775 | /* Call callback on the last chunk */ |
@@ -823,7 +823,7 @@ static dma_async_tx_callback __ld_cleanup(struct sh_dmae_chan *sh_chan, bool all | |||
823 | * Terminating and the loop completed normally: forgive | 823 | * Terminating and the loop completed normally: forgive |
824 | * uncompleted cookies | 824 | * uncompleted cookies |
825 | */ | 825 | */ |
826 | sh_chan->completed_cookie = sh_chan->common.cookie; | 826 | sh_chan->common.completed_cookie = sh_chan->common.cookie; |
827 | 827 | ||
828 | spin_unlock_irqrestore(&sh_chan->desc_lock, flags); | 828 | spin_unlock_irqrestore(&sh_chan->desc_lock, flags); |
829 | 829 | ||
@@ -891,7 +891,7 @@ static enum dma_status sh_dmae_tx_status(struct dma_chan *chan, | |||
891 | sh_dmae_chan_ld_cleanup(sh_chan, false); | 891 | sh_dmae_chan_ld_cleanup(sh_chan, false); |
892 | 892 | ||
893 | /* First read completed cookie to avoid a skew */ | 893 | /* First read completed cookie to avoid a skew */ |
894 | last_complete = sh_chan->completed_cookie; | 894 | last_complete = chan->completed_cookie; |
895 | rmb(); | 895 | rmb(); |
896 | last_used = chan->cookie; | 896 | last_used = chan->cookie; |
897 | BUG_ON(last_complete < 0); | 897 | BUG_ON(last_complete < 0); |