From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 639F7C433EF for ; Mon, 6 Jun 2022 08:50:45 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4LGnJN0tl9z3f79 for ; Mon, 6 Jun 2022 18:50:44 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=CCK6R9fY; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::131; helo=mail-lf1-x131.google.com; envelope-from=shengjiu.wang@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=CCK6R9fY; dkim-atps=neutral Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4LGdk1362Cz30BK for ; Mon, 6 Jun 2022 13:08:55 +1000 (AEST) Received: by mail-lf1-x131.google.com with SMTP id a15so21280351lfb.9 for ; Sun, 05 Jun 2022 20:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=G2x6Km6jqmzUcms9TJteVuhDuyeG5cr45Q2FwBy0BUc=; b=CCK6R9fYFA6FcUuhSHpVJrg7bqI1Q6u2hrGOxBQr5cCj3b+oYek9Rkz9VhsSa5hVqL W3IdO6AMLNyE/IsPHZEBo5+xJYifb7XniGljFIEU8ZyTe4y1zObFV2983/ilcRDfzYnM TFMw9bHgvY2Sv3yFGXSeIvKdMC8G0wl8MAnfpYJrzx6jSsyPR7iZkp+C7uP8mYmUTMMN 5klo/sEoo0vDpy+0krLD7QXWJljBaBUhpr/9DSMR6A5lkeMej1BNTPhE8YZMrcjud2bP +YI9cvVMWjA4ZWijXH8KArha7QoQjTSOWll/1I19qlusHOREB/QxWlwa1Jro9jII3DTE vd+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=G2x6Km6jqmzUcms9TJteVuhDuyeG5cr45Q2FwBy0BUc=; b=7ho16sUOXsQy+2pB5ac/Ep87M2/r79pB8vmPlBETT5DDTvI+jU9AI2OpEVZa2fpOFh MKKPAH/iGqHnshQe0Wk1QbvzVbSQ/VPXWAPvyB8/woGtV0Gf5CxpBK4421r2qhjQGDgY uRg6uW7Y3n3aIjECgJX4vIQXlbECo48MuDz9OtdOXBkd6BMY2WydSPZUvBYWw4NsxzSC S2TBLOP6AtOsgs5RCRxvB7gAg09rJhV8dRVTlyR8zqOdk5mmmtBOsVULylbVWQLLzlg/ 3txIVQCNfHIY8sGZsH6vVNj7/g02+5PlkBjOW1n8LZHQK3DJp7FxCX2NlcSzy0+Uv7EO kIaA== X-Gm-Message-State: AOAM532ZkJLk7tyWR80rFDwnU+2ogjynQm6pm/GiXsHNxhD6OClMaEdS liokbc/p1TehDJqD/vG9ATwmblakTkwKr8tZemQ= X-Google-Smtp-Source: ABdhPJyxIQkRNb/4Awsg9fDOiczn7ze05jH4883awHV7OMNsYV0FAJjOMfHcUI2NJvEU9biFnXSg0O8yCFq0KKTarDw= X-Received: by 2002:a05:6512:1399:b0:448:9f0b:bf4f with SMTP id p25-20020a056512139900b004489f0bbf4fmr13663742lfa.67.1654484931130; Sun, 05 Jun 2022 20:08:51 -0700 (PDT) MIME-Version: 1.0 References: <20220602072024.33236-1-zhangqilong3@huawei.com> In-Reply-To: <20220602072024.33236-1-zhangqilong3@huawei.com> From: Shengjiu Wang Date: Mon, 6 Jun 2022 11:08:39 +0800 Message-ID: Subject: Re: [PATCH V4] ASoC: fsl_xcvr:Fix unbalanced pm_runtime_enable in fsl_xcvr_probe To: zhangqilong Content-Type: multipart/alternative; boundary="0000000000009b396105e0beca21" X-Mailman-Approved-At: Mon, 06 Jun 2022 18:49:00 +1000 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, Xiubo Li , linuxppc-dev , Takashi Iwai , Liam Girdwood , Jaroslav Kysela , Nicolin Chen , Mark Brown , Fabio Estevam Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" --0000000000009b396105e0beca21 Content-Type: text/plain; charset="UTF-8" On Thu, Jun 2, 2022 at 3:18 PM 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") > Signed-off-by: Zhang Qilong > Acked-by: Shengjiu Wang 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 > > --0000000000009b396105e0beca21 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Jun 2, 2022 at 3:18 PM zhangq= ilong <zhangqilong3@huawei.co= m> 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 regard= s
Wang shengjiu=C2=A0
---
v2:
- Add remove to put PM usage counter.

v3:
- Modify the commit message.
---
=C2=A0sound/soc/fsl/fsl_xcvr.c | 9 +++++++++
=C2=A01 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 *pde= v)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0*/
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D devm_snd_dmaengine_pcm_register(dev, NU= LL, 0);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pm_runtime_disable(= dev);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dev_err(dev, "= failed to pcm register\n");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 return ret;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
@@ -1235,6 +1236,7 @@ static int fsl_xcvr_probe(struct platform_device *pde= v)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ret =3D devm_snd_soc_register_component(dev, &a= mp;fsl_xcvr_comp,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 &fsl_xcvr_dai, 1);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 if (ret) {
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0pm_runtime_disable(= dev);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 dev_err(dev, "= failed to register component %s\n",
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 fsl_xcvr_comp.name);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 }
@@ -1242,6 +1244,12 @@ static int fsl_xcvr_probe(struct platform_device *pd= ev)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 return ret;
=C2=A0}

+static int fsl_xcvr_remove(struct platform_device *pdev)
+{
+=C2=A0 =C2=A0 =C2=A0 =C2=A0pm_runtime_disable(&pdev->dev);
+=C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;
+}
+
=C2=A0static __maybe_unused int fsl_xcvr_runtime_suspend(struct device *dev= )
=C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 struct fsl_xcvr *xcvr =3D dev_get_drvdata(dev);=
@@ -1370,6 +1378,7 @@ static struct platform_driver fsl_xcvr_driver =3D { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .pm =3D &fsl_xc= vr_pm_ops,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 .of_match_table =3D= fsl_xcvr_dt_ids,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 },
+=C2=A0 =C2=A0 =C2=A0 =C2=A0.remove =3D fsl_xcvr_remove,
=C2=A0};
=C2=A0module_platform_driver(fsl_xcvr_driver);

--
2.31.1

--0000000000009b396105e0beca21--