From: dinghao.liu@zju.edu.cn
To: "Peter Ujfalusi" <peter.ujfalusi@ti.com>
Cc: kjlu@umn.edu, "Jarkko Nikula" <jarkko.nikula@bitmer.com>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
alsa-devel@alsa-project.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: Re: [PATCH] ASoC: ti: Fix runtime PM imbalance in omap2_mcbsp_set_clks_src
Date: Mon, 25 May 2020 16:48:47 +0800 (GMT+08:00) [thread overview]
Message-ID: <46a95b71.c7abd.1724b0524b8.Coremail.dinghao.liu@zju.edu.cn> (raw)
In-Reply-To: <16f653b3-2a36-7b2c-60be-73d550e47774@ti.com>
>
>
> On 25/05/2020 10.22, Dinghao Liu wrote:
> > When clk_set_parent() returns an error code, a pairing
> > runtime PM usage counter increment is needed to keep the
> > counter balanced.
> >
> > Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
> > ---
> > sound/soc/ti/omap-mcbsp.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/sound/soc/ti/omap-mcbsp.c b/sound/soc/ti/omap-mcbsp.c
> > index 3d41ca2238d4..84b4de9b670c 100644
> > --- a/sound/soc/ti/omap-mcbsp.c
> > +++ b/sound/soc/ti/omap-mcbsp.c
> > @@ -80,6 +80,7 @@ static int omap2_mcbsp_set_clks_src(struct omap_mcbsp *mcbsp, u8 fck_src_id)
> > if (r) {
> > dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n",
> > src);
> > + pm_runtime_get_sync(mcbsp->dev);
>
> > clk_put(fck_src);
> > return r;
> > }
>
> I think it would be cleaner in this way:
>
> pm_runtime_put_sync(mcbsp->dev);
>
> r = clk_set_parent(mcbsp->fclk, fck_src);
> if (r)
> dev_err(mcbsp->dev, "CLKS: could not clk_set_parent() to %s\n",
> src);
>
> pm_runtime_get_sync(mcbsp->dev);
> clk_put(fck_src);
>
> return r;
>
> - Péter
>
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Thank you for your advice! This is better and I will fix this
in the next version of patch.
Regards,
Dinghao
prev parent reply other threads:[~2020-05-25 8:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-25 7:22 Dinghao Liu
2020-05-25 8:37 ` Peter Ujfalusi
2020-05-25 8:48 ` dinghao.liu [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=46a95b71.c7abd.1724b0524b8.Coremail.dinghao.liu@zju.edu.cn \
--to=dinghao.liu@zju.edu.cn \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=jarkko.nikula@bitmer.com \
--cc=kjlu@umn.edu \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@ti.com \
--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
all inboxes | Powered by JetHome®