Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: zhangqilong <zhangqilong3@huawei.com>
To: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>,
	"olivier.moysan@foss.st.com" <olivier.moysan@foss.st.com>,
	"perex@perex.cz" <perex@perex.cz>,
	"tiwai@suse.com" <tiwai@suse.com>,
	"mcoquelin.stm32@gmail.com" <mcoquelin.stm32@gmail.com>,
	"alexandre.torgue@foss.st.com" <alexandre.torgue@foss.st.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"linux-stm32@st-md-mailman.stormreply.com"
	<linux-stm32@st-md-mailman.stormreply.com>
Subject: 答复: [PATCH -next] ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe
Date: Mon, 26 Sep 2022 14:24:14 +0000	[thread overview]
Message-ID: <baa8d7791be0479d9bfd9e2f0df779d2@huawei.com> (raw)
In-Reply-To: <b1cd2763-8914-7bce-8f91-666bae219bf4@foss.st.com>

> Hello Zhang,
> 
> On 9/26/22 11:14, Zhang Qilong wrote:
> > The pm_runtime_enable will increase power disable depth. Thus a
> > pairing decrement is needed on the error handling path to keep it
> > balanced according to context.
> >
> > Fixes:efc162cbd480f ("ASoC: stm: Use dev_err_probe() helper")
> > Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
> > ---
> >  sound/soc/stm/stm32_i2s.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/stm/stm32_i2s.c b/sound/soc/stm/stm32_i2s.c
> > index 6aafe793eec4..5a717443b105 100644
> > --- a/sound/soc/stm/stm32_i2s.c
> > +++ b/sound/soc/stm/stm32_i2s.c
> > @@ -1139,12 +1139,15 @@ static int stm32_i2s_probe(struct
> platform_device *pdev)
> >  	pm_runtime_enable(&pdev->dev);
> >
> >  	ret = snd_dmaengine_pcm_register(&pdev->dev,
> &stm32_i2s_pcm_config, 0);
> > -	if (ret)
> > +	if (ret) {
> > +		pm_runtime_disable(&pdev->dev);
> >  		return dev_err_probe(&pdev->dev, ret, "PCM DMA register
> error\n");
> > +	}
> >
> >  	ret = snd_soc_register_component(&pdev->dev,
> &stm32_i2s_component,
> >  					 i2s->dai_drv, 1);
> >  	if (ret) {
> > +		pm_runtime_disable(&pdev->dev);
> >  		snd_dmaengine_pcm_unregister(&pdev->dev);
> >  		return ret;
> >  	}
> 
> Seems that there the error has been introduced in this commit:
> 32a956a1fadf ("ASoC: stm32: i2s: add pm_runtime support") The
> pm_runtime_enable should be at the end of the stm32_i2s_probe as
> done here:
> https://github.com/STMicroelectronics/linux/blob/v5.15-stm32mp/sound/
> soc/stm/stm32_i2s.c#L1200
> 
> Please, could you update your patch in this way?
> With also an update of the "Fixes:" reference in the commit message

Hi,

Very useful guide, and I have send v2 version. In addition, I found several similar problems at the same time and fixed it through a patch set.

Thanks,
Zhang
> 
> Thanks,
> Arnaud

      reply	other threads:[~2022-09-26 14:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-26  9:14 [PATCH -next] ASoC: stm: Fix PM disable depth imbalance in stm32_i2s_probe Zhang Qilong
2022-09-26 12:52 ` Arnaud POULIQUEN
2022-09-26 14:24   ` zhangqilong [this message]

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=baa8d7791be0479d9bfd9e2f0df779d2@huawei.com \
    --to=zhangqilong3@huawei.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=arnaud.pouliquen@foss.st.com \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=olivier.moysan@foss.st.com \
    --cc=perex@perex.cz \
    --cc=tiwai@suse.com \
    /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