All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe
@ 2022-06-02  7:20 zhangqilong
  2022-06-06  3:08   ` Shengjiu Wang
  2022-06-07 10:46 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: zhangqilong @ 2022-06-02  7:20 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, perex, tiwai
  Cc: alsa-devel, festevam, lgirdwood, nicoleotsuka, broonie, linuxppc-dev

a) Add missing pm_runtime_disable() when probe error out. It could
avoid pm_runtime implementation complains when removing and probing
again the driver.
b) Add remove for missing pm_runtime_disable().

Fix:c590fa80b3928 ("ASoC: fsl_xcvr: register platform component before registering cpu dai")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
---
v2:
- Add remove to put PM usage counter.

v3:
- Modify the commit message.
---
 sound/soc/fsl/fsl_xcvr.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
index d0556c79fdb1..55e640cba87d 100644
--- a/sound/soc/fsl/fsl_xcvr.c
+++ b/sound/soc/fsl/fsl_xcvr.c
@@ -1228,6 +1228,7 @@ static int fsl_xcvr_probe(struct platform_device *pdev)
 	 */
 	ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0);
 	if (ret) {
+		pm_runtime_disable(dev);
 		dev_err(dev, "failed to pcm register\n");
 		return ret;
 	}
@@ -1235,6 +1236,7 @@ static int fsl_xcvr_probe(struct platform_device *pdev)
 	ret = devm_snd_soc_register_component(dev, &fsl_xcvr_comp,
 					      &fsl_xcvr_dai, 1);
 	if (ret) {
+		pm_runtime_disable(dev);
 		dev_err(dev, "failed to register component %s\n",
 			fsl_xcvr_comp.name);
 	}
@@ -1242,6 +1244,12 @@ static int fsl_xcvr_probe(struct platform_device *pdev)
 	return ret;
 }
 
+static int fsl_xcvr_remove(struct platform_device *pdev)
+{
+	pm_runtime_disable(&pdev->dev);
+	return 0;
+}
+
 static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
 {
 	struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
@@ -1370,6 +1378,7 @@ static struct platform_driver fsl_xcvr_driver = {
 		.pm = &fsl_xcvr_pm_ops,
 		.of_match_table = fsl_xcvr_dt_ids,
 	},
+	.remove = fsl_xcvr_remove,
 };
 module_platform_driver(fsl_xcvr_driver);
 
-- 
2.31.1


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

* Re: [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe
  2022-06-02  7:20 [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe zhangqilong
@ 2022-06-06  3:08   ` Shengjiu Wang
  2022-06-07 10:46 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Shengjiu Wang @ 2022-06-06  3:08 UTC (permalink / raw)
  To: zhangqilong
  Cc: alsa-devel, Xiubo Li, linuxppc-dev, Takashi Iwai, Liam Girdwood,
	Nicolin Chen, Mark Brown, Fabio Estevam

On Thu, Jun 2, 2022 at 3:18 PM zhangqilong <zhangqilong3@huawei.com> wrote:

> a) Add missing pm_runtime_disable() when probe error out. It could
> avoid pm_runtime implementation complains when removing and probing
> again the driver.
> b) Add remove for missing pm_runtime_disable().
>
> Fix:c590fa80b3928 ("ASoC: fsl_xcvr: register platform component before
> registering cpu dai")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
>

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>

Best regards
Wang shengjiu

> ---
> v2:
> - Add remove to put PM usage counter.
>
> v3:
> - Modify the commit message.
> ---
>  sound/soc/fsl/fsl_xcvr.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
> index d0556c79fdb1..55e640cba87d 100644
> --- a/sound/soc/fsl/fsl_xcvr.c
> +++ b/sound/soc/fsl/fsl_xcvr.c
> @@ -1228,6 +1228,7 @@ static int fsl_xcvr_probe(struct platform_device
> *pdev)
>          */
>         ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0);
>         if (ret) {
> +               pm_runtime_disable(dev);
>                 dev_err(dev, "failed to pcm register\n");
>                 return ret;
>         }
> @@ -1235,6 +1236,7 @@ static int fsl_xcvr_probe(struct platform_device
> *pdev)
>         ret = devm_snd_soc_register_component(dev, &fsl_xcvr_comp,
>                                               &fsl_xcvr_dai, 1);
>         if (ret) {
> +               pm_runtime_disable(dev);
>                 dev_err(dev, "failed to register component %s\n",
>                         fsl_xcvr_comp.name);
>         }
> @@ -1242,6 +1244,12 @@ static int fsl_xcvr_probe(struct platform_device
> *pdev)
>         return ret;
>  }
>
> +static int fsl_xcvr_remove(struct platform_device *pdev)
> +{
> +       pm_runtime_disable(&pdev->dev);
> +       return 0;
> +}
> +
>  static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
>  {
>         struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
> @@ -1370,6 +1378,7 @@ static struct platform_driver fsl_xcvr_driver = {
>                 .pm = &fsl_xcvr_pm_ops,
>                 .of_match_table = fsl_xcvr_dt_ids,
>         },
> +       .remove = fsl_xcvr_remove,
>  };
>  module_platform_driver(fsl_xcvr_driver);
>
> --
> 2.31.1
>
>

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

* Re: [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe
@ 2022-06-06  3:08   ` Shengjiu Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Shengjiu Wang @ 2022-06-06  3:08 UTC (permalink / raw)
  To: zhangqilong
  Cc: alsa-devel, Xiubo Li, linuxppc-dev, Takashi Iwai, Liam Girdwood,
	Jaroslav Kysela, Nicolin Chen, Mark Brown, Fabio Estevam

[-- Attachment #1: Type: text/plain, Size: 2280 bytes --]

On Thu, Jun 2, 2022 at 3:18 PM zhangqilong <zhangqilong3@huawei.com> wrote:

> a) Add missing pm_runtime_disable() when probe error out. It could
> avoid pm_runtime implementation complains when removing and probing
> again the driver.
> b) Add remove for missing pm_runtime_disable().
>
> Fix:c590fa80b3928 ("ASoC: fsl_xcvr: register platform component before
> registering cpu dai")
> Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
>

Acked-by: Shengjiu Wang <shengjiu.wang@gmail.com>

Best regards
Wang shengjiu

> ---
> v2:
> - Add remove to put PM usage counter.
>
> v3:
> - Modify the commit message.
> ---
>  sound/soc/fsl/fsl_xcvr.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/sound/soc/fsl/fsl_xcvr.c b/sound/soc/fsl/fsl_xcvr.c
> index d0556c79fdb1..55e640cba87d 100644
> --- a/sound/soc/fsl/fsl_xcvr.c
> +++ b/sound/soc/fsl/fsl_xcvr.c
> @@ -1228,6 +1228,7 @@ static int fsl_xcvr_probe(struct platform_device
> *pdev)
>          */
>         ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0);
>         if (ret) {
> +               pm_runtime_disable(dev);
>                 dev_err(dev, "failed to pcm register\n");
>                 return ret;
>         }
> @@ -1235,6 +1236,7 @@ static int fsl_xcvr_probe(struct platform_device
> *pdev)
>         ret = devm_snd_soc_register_component(dev, &fsl_xcvr_comp,
>                                               &fsl_xcvr_dai, 1);
>         if (ret) {
> +               pm_runtime_disable(dev);
>                 dev_err(dev, "failed to register component %s\n",
>                         fsl_xcvr_comp.name);
>         }
> @@ -1242,6 +1244,12 @@ static int fsl_xcvr_probe(struct platform_device
> *pdev)
>         return ret;
>  }
>
> +static int fsl_xcvr_remove(struct platform_device *pdev)
> +{
> +       pm_runtime_disable(&pdev->dev);
> +       return 0;
> +}
> +
>  static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev)
>  {
>         struct fsl_xcvr *xcvr = dev_get_drvdata(dev);
> @@ -1370,6 +1378,7 @@ static struct platform_driver fsl_xcvr_driver = {
>                 .pm = &fsl_xcvr_pm_ops,
>                 .of_match_table = fsl_xcvr_dt_ids,
>         },
> +       .remove = fsl_xcvr_remove,
>  };
>  module_platform_driver(fsl_xcvr_driver);
>
> --
> 2.31.1
>
>

[-- Attachment #2: Type: text/html, Size: 3352 bytes --]

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

* Re: [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe
  2022-06-02  7:20 [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe zhangqilong
  2022-06-06  3:08   ` Shengjiu Wang
@ 2022-06-07 10:46 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-06-07 10:46 UTC (permalink / raw)
  To: tiwai, Xiubo.Lee, shengjiu.wang, perex, zhangqilong3
  Cc: nicoleotsuka, linuxppc-dev, alsa-devel, festevam, lgirdwood

On Thu, 2 Jun 2022 15:20:24 +0800, zhangqilong wrote:
> a) Add missing pm_runtime_disable() when probe error out. It could
> avoid pm_runtime implementation complains when removing and probing
> again the driver.
> b) Add remove for missing pm_runtime_disable().
> 
> Fix:c590fa80b3928 ("ASoC: fsl_xcvr: register platform component before registering cpu dai")
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe
      commit: 9c3148dec7d2d40ef727b8789d3e9410ad6d4a1f

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

end of thread, other threads:[~2022-06-07 10:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-02  7:20 [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe zhangqilong
2022-06-06  3:08 ` Shengjiu Wang
2022-06-06  3:08   ` Shengjiu Wang
2022-06-07 10:46 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.