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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 4E989C433EF for ; Wed, 20 Apr 2022 07:49:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5056B18A8; Wed, 20 Apr 2022 09:49:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5056B18A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1650440995; bh=2mRpXuk95u3wV5Kstv+0lYYBB/ApOGsY+16BvYY39MQ=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=cACJPDczbt5atAkd9fIE4hrbRqqyMS38UU8djW2+FNop7SC/0E2baoq1RZ4yp1F8f kRR6CbnlIsdtQBmPZ6ITkO0U2OkUQi1vHL8mEJYsiiL/AHi67QwiyEsGjvem9Hld2f /lE2KeRK6tdsIv3EcRhaA31zP+SDz+fY6jpzIZ7g= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C8CE2F80116; Wed, 20 Apr 2022 09:49:04 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3444EF80125; Wed, 20 Apr 2022 09:49:03 +0200 (CEST) Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1714EF800F8 for ; Wed, 20 Apr 2022 09:48:56 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1714EF800F8 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 4B86C1C0B87; Wed, 20 Apr 2022 09:48:56 +0200 (CEST) Date: Wed, 20 Apr 2022 09:48:55 +0200 From: Pavel Machek To: cgel.zte@gmail.com Subject: Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Message-ID: <20220420074855.GA25823@amd> References: <20220412083000.2532711-1-chi.minghao@zte.com.cn> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <20220412083000.2532711-1-chi.minghao@zte.com.cn> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: alsa-devel@alsa-project.org, Xiubo.Lee@gmail.com, shengjiu.wang@gmail.com, Zeal Robot , linuxppc-dev@lists.ozlabs.org, lgirdwood@gmail.com, Minghao Chi , linux-kernel@vger.kernel.org, nicoleotsuka@gmail.com, broonie@kernel.org, festevam@gmail.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Minghao Chi >=20 > Using pm_runtime_resume_and_get is more appropriate > for simplifing code >=20 > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- > sound/soc/fsl/fsl_esai.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c > index ed444e8f1d6b..1a2bdf8e76f0 100644 > --- a/sound/soc/fsl/fsl_esai.c > +++ b/sound/soc/fsl/fsl_esai.c > @@ -1050,11 +1050,9 @@ static int fsl_esai_probe(struct platform_device *= pdev) > goto err_pm_disable; > } > =20 > - ret =3D pm_runtime_get_sync(&pdev->dev); > - if (ret < 0) { > - pm_runtime_put_noidle(&pdev->dev); > + ret =3D pm_runtime_resume_and_get(&pdev->dev); > + if (ret < 0) > goto err_pm_get_sync; > - } > =20 > ret =3D fsl_esai_hw_init(esai_priv); > if (ret) Please take a closer look at that function. a) error labels are now misnamed b) there's leak if ret =3D fsl_esai_hw_init(esai_priv); if (ret) goto err_pm_get_sync; happens. Best regards, Pavel =20 --=20 People of Russia, stop Putin before his war on Ukraine escalates. --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmJfuucACgkQMOfwapXb+vIiGACffOMVcK21uP4rckwMmbnzLCim 9/QAnjyoa8+Std4g2m6imouSbgDhSKdo =cpOV -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3-- 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3060C433EF for ; Wed, 20 Apr 2022 07:49:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376346AbiDTHvp (ORCPT ); Wed, 20 Apr 2022 03:51:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344870AbiDTHvn (ORCPT ); Wed, 20 Apr 2022 03:51:43 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46D70340E0 for ; Wed, 20 Apr 2022 00:48:58 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 4B86C1C0B87; Wed, 20 Apr 2022 09:48:56 +0200 (CEST) Date: Wed, 20 Apr 2022 09:48:55 +0200 From: Pavel Machek To: cgel.zte@gmail.com Cc: shengjiu.wang@gmail.com, Xiubo.Lee@gmail.com, festevam@gmail.com, nicoleotsuka@gmail.com, lgirdwood@gmail.com, broonie@kernel.org, alsa-devel@alsa-project.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Minghao Chi , Zeal Robot Subject: Re: [PATCH] ASoC: fsl: using pm_runtime_resume_and_get instead of pm_runtime_get_sync Message-ID: <20220420074855.GA25823@amd> References: <20220412083000.2532711-1-chi.minghao@zte.com.cn> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BOKacYhQ+x31HxR3" Content-Disposition: inline In-Reply-To: <20220412083000.2532711-1-chi.minghao@zte.com.cn> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --BOKacYhQ+x31HxR3 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > From: Minghao Chi >=20 > Using pm_runtime_resume_and_get is more appropriate > for simplifing code >=20 > Reported-by: Zeal Robot > Signed-off-by: Minghao Chi > --- > sound/soc/fsl/fsl_esai.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) >=20 > diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c > index ed444e8f1d6b..1a2bdf8e76f0 100644 > --- a/sound/soc/fsl/fsl_esai.c > +++ b/sound/soc/fsl/fsl_esai.c > @@ -1050,11 +1050,9 @@ static int fsl_esai_probe(struct platform_device *= pdev) > goto err_pm_disable; > } > =20 > - ret =3D pm_runtime_get_sync(&pdev->dev); > - if (ret < 0) { > - pm_runtime_put_noidle(&pdev->dev); > + ret =3D pm_runtime_resume_and_get(&pdev->dev); > + if (ret < 0) > goto err_pm_get_sync; > - } > =20 > ret =3D fsl_esai_hw_init(esai_priv); > if (ret) Please take a closer look at that function. a) error labels are now misnamed b) there's leak if ret =3D fsl_esai_hw_init(esai_priv); if (ret) goto err_pm_get_sync; happens. Best regards, Pavel =20 --=20 People of Russia, stop Putin before his war on Ukraine escalates. --BOKacYhQ+x31HxR3 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmJfuucACgkQMOfwapXb+vIiGACffOMVcK21uP4rckwMmbnzLCim 9/QAnjyoa8+Std4g2m6imouSbgDhSKdo =cpOV -----END PGP SIGNATURE----- --BOKacYhQ+x31HxR3--