From: Mark Brown <broonie@kernel.org>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>
Cc: kjlu@umn.edu, Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
Peter Ujfalusi <peter.ujfalusi@ti.com>,
Rob Herring <robh@kernel.org>,
"Alexander A. Klimov" <grandmaster@al2klimov.de>,
"Gustavo A. R. Silva" <gustavoars@kernel.org>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: codecs: Fix rumtime PM imbalance in tas2552_probe
Date: Wed, 7 Apr 2021 13:51:47 +0100 [thread overview]
Message-ID: <20210407125147.GD5510@sirena.org.uk> (raw)
In-Reply-To: <20210407065402.17729-1-dinghao.liu@zju.edu.cn>
[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]
On Wed, Apr 07, 2021 at 02:54:00PM +0800, Dinghao Liu wrote:
> - pm_runtime_set_active(&client->dev);
> - pm_runtime_set_autosuspend_delay(&client->dev, 1000);
> - pm_runtime_use_autosuspend(&client->dev);
> - pm_runtime_enable(&client->dev);
> - pm_runtime_mark_last_busy(&client->dev);
> - pm_runtime_put_sync_autosuspend(&client->dev);
> -
> dev_set_drvdata(&client->dev, data);
>
> ret = devm_snd_soc_register_component(&client->dev,
> @@ -733,6 +726,13 @@ static int tas2552_probe(struct i2c_client *client,
> if (ret < 0)
> dev_err(&client->dev, "Failed to register component: %d\n", ret);
>
> + pm_runtime_set_active(&client->dev);
> + pm_runtime_set_autosuspend_delay(&client->dev, 1000);
> + pm_runtime_use_autosuspend(&client->dev);
It's not clear to me that just moving the operations after the
registration is a good fix - once the component is registered we could
start trying to do runtime PM operations with it which AFAIR won't count
references and so on properly if runtime PM isn't enabled so if we later
enable runtime PM we might have the rest of the code in a confused state
about what's going on.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2021-04-07 12:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-07 6:54 [PATCH] ASoC: codecs: Fix rumtime PM imbalance in tas2552_probe Dinghao Liu
2021-04-07 12:51 ` Mark Brown [this message]
2021-04-08 5:44 ` dinghao.liu
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=20210407125147.GD5510@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alsa-devel@alsa-project.org \
--cc=dinghao.liu@zju.edu.cn \
--cc=grandmaster@al2klimov.de \
--cc=gustavoars@kernel.org \
--cc=kjlu@umn.edu \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@ti.com \
--cc=robh@kernel.org \
--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