public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Vinod Koul <vkoul@kernel.org>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>,
	dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/11] dmaengine: dw-axi-dmac: fix reading register hen runtime suspended
Date: Sat, 15 Apr 2023 18:02:14 +0800	[thread overview]
Message-ID: <ZDp2JjQRkSzwx03g@xhacker> (raw)
In-Reply-To: <ZDbrTvfPdnvW4Gue@matsya>

On Wed, Apr 12, 2023 at 11:03:02PM +0530, Vinod Koul wrote:
> s/hen/when..? or something else
> 
> On 14-03-23, 01:04, Jisheng Zhang wrote:
> > We should runtime resume the device before calling
> > axi_chan_is_hw_enable().
> 
> why is that can you please explain..

If the device is suspended, I.E not resumed, accessing any
registers in axi_chan_is_hw_enable() will cause cpu abort.

I will add this info into commit log of v2.

> 
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> > ---
> >  drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 15 +++++++++++----
> >  1 file changed, 11 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > index 7f3a60e28e38..23a10dbdecb7 100644
> > --- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > +++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
> > @@ -462,13 +462,17 @@ static void dw_axi_dma_synchronize(struct dma_chan *dchan)
> >  
> >  static int dma_chan_alloc_chan_resources(struct dma_chan *dchan)
> >  {
> > +	int ret;
> >  	struct axi_dma_chan *chan = dchan_to_axi_dma_chan(dchan);
> >  
> > +	pm_runtime_get(chan->chip->dev);
> > +
> >  	/* ASSERT: channel is idle */
> >  	if (axi_chan_is_hw_enable(chan)) {
> >  		dev_err(chan2dev(chan), "%s is non-idle!\n",
> >  			axi_chan_name(chan));
> > -		return -EBUSY;
> > +		ret = -EBUSY;
> > +		goto err_busy;
> >  	}
> >  
> >  	/* LLI address must be aligned to a 64-byte boundary */
> > @@ -478,13 +482,16 @@ static int dma_chan_alloc_chan_resources(struct dma_chan *dchan)
> >  					  64, 0);
> >  	if (!chan->desc_pool) {
> >  		dev_err(chan2dev(chan), "No memory for descriptors\n");
> > -		return -ENOMEM;
> > +		ret = -ENOMEM;
> > +		goto err_busy;
> >  	}
> >  	dev_vdbg(dchan2dev(dchan), "%s: allocating\n", axi_chan_name(chan));
> >  
> > -	pm_runtime_get(chan->chip->dev);
> > -
> >  	return 0;
> > +
> > +err_busy:
> > +	pm_runtime_put(chan->chip->dev);
> > +	return ret;
> >  }
> >  
> >  static void dma_chan_free_chan_resources(struct dma_chan *dchan)
> > -- 
> > 2.39.2
> 
> -- 
> ~Vinod

  reply	other threads:[~2023-04-15 10:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 17:04 [PATCH 00/11] dmaengine: dw-axi_dmac: bug fix clean up and more features Jisheng Zhang
2023-03-13 17:04 ` [PATCH 01/11] dmaengine: dw-axi-dmac: fix reading register hen runtime suspended Jisheng Zhang
2023-04-12 17:33   ` Vinod Koul
2023-04-15 10:02     ` Jisheng Zhang [this message]
2023-03-13 17:04 ` [PATCH 02/11] dmaengine: dw-axi-dmac: remove unnecessary devm_free_irq() calling Jisheng Zhang
2023-04-12 17:38   ` Vinod Koul
2023-04-15 10:03     ` Jisheng Zhang
2023-03-13 17:04 ` [PATCH 03/11] dmaengine: dw-axi-dmac: remove unnecessary axi_dma_enable() calling Jisheng Zhang
2023-03-13 17:04 ` [PATCH 04/11] dmaengine: dw-axi-dmac: remove redudant axi_dma_disable() calling Jisheng Zhang
2023-04-12 17:36   ` Vinod Koul
2023-03-13 17:04 ` [PATCH 05/11] dmaengine: dw-axi-dmac: delay irq getting until request_irq Jisheng Zhang
2023-03-13 17:04 ` [PATCH 06/11] dmaengine: dw-axi-dmac: move ch irq handling into common routine Jisheng Zhang
2023-03-13 17:04 ` [PATCH 07/11] dmaengine: dw-axi-dmac: support per channel irq Jisheng Zhang
2023-03-13 17:04 ` [PATCH 08/11] dmaengine: dw-axi-dmac: support dma-channel-mask Jisheng Zhang
2023-03-13 17:04 ` [PATCH 09/11] dmaengine: dw-axi-dmac: try best to get residue when tx is running Jisheng Zhang
2023-03-13 17:04 ` [PATCH 10/11] dmaengine: dw-axi-dmac: move dma_chan_tx_status() Jisheng Zhang
2023-03-13 17:04 ` [PATCH 11/11] dmaengine: dw-axi-dmac: support polled mode Jisheng Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDp2JjQRkSzwx03g@xhacker \
    --to=jszhang@kernel.org \
    --cc=Eugeniy.Paltsev@synopsys.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox