diff mbox

[1/1] ARM: mxs-dma: reset after disable channel

Message ID 1311048596-19932-1-git-send-email-b29396@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Aisheng Dong July 19, 2011, 4:09 a.m. UTC
We met some channels in abnormal state after disable.
Reset it to get a clean state.

Signed-off-by: Dong Aisheng <b29396@freescale.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Cc: Shawn Guo <shawn.guo@linaro.org>
---
 drivers/dma/mxs-dma.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Shawn Guo July 19, 2011, 4:02 a.m. UTC | #1
On Tue, Jul 19, 2011 at 12:09:56PM +0800, Dong Aisheng wrote:
> We met some channels in abnormal state after disable.
> Reset it to get a clean state.
> 
> Signed-off-by: Dong Aisheng <b29396@freescale.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> ---

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

Hi Vinod,

Please consider to merge it for v3.1.  The mxs audio driver needs the
fix.

Regards,
Shawn

>  drivers/dma/mxs-dma.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> index 88aad4f..5a24010 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
>  	switch (cmd) {
>  	case DMA_TERMINATE_ALL:
>  		mxs_dma_disable_chan(mxs_chan);
> +		mxs_dma_reset_chan(mxs_chan);
>  		break;
>  	case DMA_PAUSE:
>  		mxs_dma_pause_chan(mxs_chan);
> -- 
> 1.7.0.4
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
Wolfram Sang July 19, 2011, 8:21 a.m. UTC | #2
On Tue, Jul 19, 2011 at 12:02:16PM +0800, Shawn Guo wrote:
> On Tue, Jul 19, 2011 at 12:09:56PM +0800, Dong Aisheng wrote:
> > We met some channels in abnormal state after disable.
> > Reset it to get a clean state.
> > 
> > Signed-off-by: Dong Aisheng <b29396@freescale.com>
> > Cc: Vinod Koul <vinod.koul@intel.com>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > ---
> 
> Acked-by: Shawn Guo <shawn.guo@linaro.org>

Just to make sure: Did you investigate where the "abnormal" state came
from and if that could be fixed?

Regards,

   Wolfram
Shawn Guo July 19, 2011, 8:45 a.m. UTC | #3
On Tue, Jul 19, 2011 at 10:21:46AM +0200, Wolfram Sang wrote:
> On Tue, Jul 19, 2011 at 12:02:16PM +0800, Shawn Guo wrote:
> > On Tue, Jul 19, 2011 at 12:09:56PM +0800, Dong Aisheng wrote:
> > > We met some channels in abnormal state after disable.
> > > Reset it to get a clean state.
> > > 
> > > Signed-off-by: Dong Aisheng <b29396@freescale.com>
> > > Cc: Vinod Koul <vinod.koul@intel.com>
> > > Cc: Shawn Guo <shawn.guo@linaro.org>
> > > ---
> > 
> > Acked-by: Shawn Guo <shawn.guo@linaro.org>
> 
> Just to make sure: Did you investigate where the "abnormal" state came
> from and if that could be fixed?
> 
I suppose this is a question for Aisheng, as he is the one who actually
saw the "abnormal" state.  But since mxs_dma_disable_chan() is being
called in mxs_dma_control(DMA_TERMINATE_ALL) for case audio, it's should
be pretty safe reset the channel here.
Wolfram Sang July 19, 2011, 9:13 a.m. UTC | #4
On Tue, Jul 19, 2011 at 04:45:37PM +0800, Shawn Guo wrote:
> On Tue, Jul 19, 2011 at 10:21:46AM +0200, Wolfram Sang wrote:
> > On Tue, Jul 19, 2011 at 12:02:16PM +0800, Shawn Guo wrote:
> > > On Tue, Jul 19, 2011 at 12:09:56PM +0800, Dong Aisheng wrote:
> > > > We met some channels in abnormal state after disable.
> > > > Reset it to get a clean state.
> > > > 
> > > > Signed-off-by: Dong Aisheng <b29396@freescale.com>
> > > > Cc: Vinod Koul <vinod.koul@intel.com>
> > > > Cc: Shawn Guo <shawn.guo@linaro.org>
> > > > ---
> > > 
> > > Acked-by: Shawn Guo <shawn.guo@linaro.org>
> > 
> > Just to make sure: Did you investigate where the "abnormal" state came
> > from and if that could be fixed?
> > 
> I suppose this is a question for Aisheng, as he is the one who actually
> saw the "abnormal" state.  

OK.

> But since mxs_dma_disable_chan() is being
> called in mxs_dma_control(DMA_TERMINATE_ALL) for case audio, it's should
> be pretty safe reset the channel here.

It might be safe but can still hide the real bug ;)
Aisheng Dong July 19, 2011, 9:20 a.m. UTC | #5
> -----Original Message-----
> From: Guo Shawn-R65073
> Sent: Tuesday, July 19, 2011 4:46 PM
> To: Wolfram Sang
> Cc: Dong Aisheng-B29396; vinod.koul@intel.com; shawn.guo@linaro.org;
> linux-arm-kernel@lists.infradead.org
> Subject: Re: [PATCH 1/1] ARM: mxs-dma: reset after disable channel
> 
> On Tue, Jul 19, 2011 at 10:21:46AM +0200, Wolfram Sang wrote:
> > On Tue, Jul 19, 2011 at 12:02:16PM +0800, Shawn Guo wrote:
> > > On Tue, Jul 19, 2011 at 12:09:56PM +0800, Dong Aisheng wrote:
> > > > We met some channels in abnormal state after disable.
> > > > Reset it to get a clean state.
> > > >
> > > > Signed-off-by: Dong Aisheng <b29396@freescale.com>
> > > > Cc: Vinod Koul <vinod.koul@intel.com>
> > > > Cc: Shawn Guo <shawn.guo@linaro.org>
> > > > ---
> > >
> > > Acked-by: Shawn Guo <shawn.guo@linaro.org>
> >
> > Just to make sure: Did you investigate where the "abnormal" state came
> > from and if that could be fixed?
> >
> I suppose this is a question for Aisheng, as he is the one who actually
> saw the "abnormal" state.  But since mxs_dma_disable_chan() is being
> called in mxs_dma_control(DMA_TERMINATE_ALL) for case audio, it's should
> be pretty safe reset the channel here.

It looked like the dma was not stopped properly, it maybe still running.
So the next time we allocated DMA chan, a dma interrupt would be generated
Before channel was starting.

I may check if we can find the root cause.

Regards
Dong Aisheng
Vinod Koul July 19, 2011, 1:44 p.m. UTC | #6
On Tue, Jul 19, 2011 at 12: 6:02 AM +0100, Shawn Guo wrote:
> > We met some channels in abnormal state after disable.
> > Reset it to get a clean state.
> >
> > Signed-off-by: Dong Aisheng <b29396@freescale.com>
> > Cc: Vinod Koul <vinod.koul@intel.com>
> > Cc: Shawn Guo <shawn.guo@linaro.org>
> > ---
> 
> Acked-by: Shawn Guo <shawn.guo@linaro.org>
> 
> Hi Vinod,
> 
> Please consider to merge it for v3.1.  The mxs audio driver needs the
> fix.
This looks good to me, in my queue now.
I am travelling back home tomorrow, so you should see this get pushed in my 
tree latest by weekend

~Vinod

> 
> Regards,
> Shawn
> 
> >  drivers/dma/mxs-dma.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> > index 88aad4f..5a24010 100644
> > --- a/drivers/dma/mxs-dma.c
> > +++ b/drivers/dma/mxs-dma.c
> > @@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum
> dma_ctrl_cmd cmd,
> >  	switch (cmd) {
> >  	case DMA_TERMINATE_ALL:
> >  		mxs_dma_disable_chan(mxs_chan);
> > +		mxs_dma_reset_chan(mxs_chan);
> >  		break;
> >  	case DMA_PAUSE:
> >  		mxs_dma_pause_chan(mxs_chan);
> > --
> > 1.7.0.4
> >
> >
> >
> > _______________________________________________
> > linux-arm-kernel mailing list
> > linux-arm-kernel@lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> >
Vinod Koul July 25, 2011, 2:25 p.m. UTC | #7
On Tue, 2011-07-19 at 12:09 +0800, Dong Aisheng wrote:
> We met some channels in abnormal state after disable.
> Reset it to get a clean state.
> 
> Signed-off-by: Dong Aisheng <b29396@freescale.com>
> Cc: Vinod Koul <vinod.koul@intel.com>
> Cc: Shawn Guo <shawn.guo@linaro.org>
> ---
>  drivers/dma/mxs-dma.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
> index 88aad4f..5a24010 100644
> --- a/drivers/dma/mxs-dma.c
> +++ b/drivers/dma/mxs-dma.c
> @@ -535,6 +535,7 @@ static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
>  	switch (cmd) {
>  	case DMA_TERMINATE_ALL:
>  		mxs_dma_disable_chan(mxs_chan);
> +		mxs_dma_reset_chan(mxs_chan);
>  		break;
>  	case DMA_PAUSE:
>  		mxs_dma_pause_chan(mxs_chan);
Applied, Thanks
diff mbox

Patch

diff --git a/drivers/dma/mxs-dma.c b/drivers/dma/mxs-dma.c
index 88aad4f..5a24010 100644
--- a/drivers/dma/mxs-dma.c
+++ b/drivers/dma/mxs-dma.c
@@ -535,6 +535,7 @@  static int mxs_dma_control(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
 	switch (cmd) {
 	case DMA_TERMINATE_ALL:
 		mxs_dma_disable_chan(mxs_chan);
+		mxs_dma_reset_chan(mxs_chan);
 		break;
 	case DMA_PAUSE:
 		mxs_dma_pause_chan(mxs_chan);