mxs-dma : assign the dma cookie before we enable the dma channel
Subsystems (3)
PATCH 1/1 mxs-dma : assign the dma cookie before we enable the dma channel
The dma chain may finished very fast, so an interrupt may arises before we assign the dma cookie. In this case, the mxs_dma_int_handler() may hit the BUG_ON() in dma_cookie_complete().
So assign the dma cookie before we enable the dma channel.
--- drivers/dma/mxs-dma.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/dma/mxs-dma.c +3 -1
@@ -210,10 +210,12 @@ static struct mxs_dma_chan *to_mxs_dma_chan(struct dma_chan *chan)static dma_cookie_t mxs_dma_tx_submit (struct dma_async_tx_descriptor *tx) {struct mxs_dma_chan *mxs_chan =to_mxs_dma_chan (tx->chan); +dma_cookie_t cookie; + cookie =dma_cookie_assign (tx);mxs_dma_enable_chan (mxs_chan); -return dma_cookie_assign (tx); +return cookie; }static void mxs_dma_tasklet (unsigned long data)
Signature · 1 line
1.7.4.4
PATCH 1/1 mxs-dma : assign the dma cookie before we enable the dma channel
Quoted 8 lines · Huang Shijie
The dma chain may finished very fast, so an interrupt may arises before we assign the dma cookie. In this case, the
mxs_dma_int_handler()may hit theBUG_ON()indma_cookie_complete().So assign the dma cookie before we enable the dma channel.
Acked-by Sam Gandhi <[email protected]>Signed-off-by Huang Shijie <[email protected]>
The mxs mmc and audio still works with the change.
Signature · 2 lines
Regards, Shawn
PATCH 1/1 mxs-dma : assign the dma cookie before we enable the dma channel
Quoted 5 lines · Shawn Guo
Quoted 4 lines · Huang Shijie
The dma chain may finished very fast, so an interrupt may arises before we assign the dma cookie. In this case, the
mxs_dma_int_handler()may hit theBUG_ON()indma_cookie_complete().
Quoted 9 lines
Quoted 4 lines
So assign the dma cookie before we enable the dma channel.
Acked-by Sam Gandhi <[email protected]>Signed-off-by Huang Shijie <[email protected]>Acked-by Shawn Guo <[email protected]>The mxs mmc and audio still works with the change.
Thanks, I will apply this on 4/18.
I am away till then :-)
Signature · 1 line
~Vinod