linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mxs-dma : assign the dma cookie before we enable the dma channel
@ 2012-04-07  5:29 Huang Shijie
  2012-04-07  8:14 ` Shawn Guo
  0 siblings, 1 reply; 3+ messages in thread
From: Huang Shijie @ 2012-04-07  5:29 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Acked-by: Sam Gandhi <samgandhi9@gmail.com>
Signed-off-by: Huang Shijie <shijie8@gmail.com>
---
 drivers/dma/mxs-dma.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index a1e2d00..1e16d0e 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -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)
-- 
1.7.4.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] mxs-dma : assign the dma cookie before we enable the dma channel
  2012-04-07  5:29 [PATCH] mxs-dma : assign the dma cookie before we enable the dma channel Huang Shijie
@ 2012-04-07  8:14 ` Shawn Guo
  2012-04-07 16:36   ` Vinod Koul
  0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2012-04-07  8:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, Apr 07, 2012 at 01:29:35AM -0400, Huang Shijie wrote:
> 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.
> 
> Acked-by: Sam Gandhi <samgandhi9@gmail.com>
> Signed-off-by: Huang Shijie <shijie8@gmail.com>

Acked-by: Shawn Guo <shawn.guo@linaor.org>

The mxs mmc and audio still works with the change.

-- 
Regards,
Shawn

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] mxs-dma : assign the dma cookie before we enable the dma channel
  2012-04-07  8:14 ` Shawn Guo
@ 2012-04-07 16:36   ` Vinod Koul
  0 siblings, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2012-04-07 16:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Sat, 2012-04-07 at 16:14 +0800, Shawn Guo wrote:
> On Sat, Apr 07, 2012 at 01:29:35AM -0400, Huang Shijie wrote:
> > 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.
> > 
> > Acked-by: Sam Gandhi <samgandhi9@gmail.com>
> > Signed-off-by: Huang Shijie <shijie8@gmail.com>
> 
> Acked-by: Shawn Guo <shawn.guo@linaor.org>
> 
> The mxs mmc and audio still works with the change.
> 
Thanks, I will apply this on 4/18.
I am away till then :-)

-- 
~Vinod

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-04-07 16:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-07  5:29 [PATCH] mxs-dma : assign the dma cookie before we enable the dma channel Huang Shijie
2012-04-07  8:14 ` Shawn Guo
2012-04-07 16:36   ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).