From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: cgel.zte@gmail.com
Cc: lgirdwood@gmail.com, ranjani.sridharan@linux.intel.com,
kai.vehmanen@linux.intel.com, daniel.baluta@nxp.com,
broonie@kernel.org, sound-open-firmware@alsa-project.org,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] ASoC: SOF: using pm_runtime_resume_and_get to simplify the code
Date: Wed, 20 Apr 2022 08:28:31 -0500 [thread overview]
Message-ID: <78c7edc3-f431-9735-238d-9aa2b45ec45e@linux.intel.com> (raw)
In-Reply-To: <20220420030315.2575691-1-chi.minghao@zte.com.cn>
On 4/19/22 22:03, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
>
> Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and
> pm_runtime_put_noidle. This change is just to simplify the code, no
> actual functional changes.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn>
Well, maybe that's a simplification, but we've been using the same pattern for years now.
Is there really a clear direction to use this new function?
the overwhelming majority of drivers in sound/soc still rely on the pm_runtime_get_sync (111 v. 7).
> ---
> sound/soc/sof/sof-client-probes.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/sof/sof-client-probes.c b/sound/soc/sof/sof-client-probes.c
> index 797dedb26163..c4c6e03c8133 100644
> --- a/sound/soc/sof/sof-client-probes.c
> +++ b/sound/soc/sof/sof-client-probes.c
> @@ -503,10 +503,9 @@ static ssize_t sof_probes_dfs_points_read(struct file *file, char __user *to,
> if (!buf)
> return -ENOMEM;
>
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> if (ret < 0 && ret != -EACCES) {
> dev_err_ratelimited(dev, "debugfs read failed to resume %d\n", ret);
> - pm_runtime_put_noidle(dev);
> goto exit;
> }
>
> @@ -568,10 +567,9 @@ sof_probes_dfs_points_write(struct file *file, const char __user *from,
>
> desc = (struct sof_probe_point_desc *)tkns;
>
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> if (ret < 0 && ret != -EACCES) {
> dev_err_ratelimited(dev, "debugfs write failed to resume %d\n", ret);
> - pm_runtime_put_noidle(dev);
> goto exit;
> }
>
> @@ -621,10 +619,9 @@ sof_probes_dfs_points_remove_write(struct file *file, const char __user *from,
> goto exit;
> }
>
> - ret = pm_runtime_get_sync(dev);
> + ret = pm_runtime_resume_and_get(dev);
> if (ret < 0) {
> dev_err_ratelimited(dev, "debugfs write failed to resume %d\n", ret);
> - pm_runtime_put_noidle(dev);
> goto exit;
> }
>
next prev parent reply other threads:[~2022-04-20 15:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-20 3:03 [PATCH] ASoC: SOF: using pm_runtime_resume_and_get to simplify the code cgel.zte
2022-04-20 13:28 ` Pierre-Louis Bossart [this message]
2022-04-20 15:23 ` Mark Brown
2022-04-20 16:11 ` Pierre-Louis Bossart
2022-04-20 16:23 ` Mark Brown
2022-04-20 21:41 ` Mark Brown
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=78c7edc3-f431-9735-238d-9aa2b45ec45e@linux.intel.com \
--to=pierre-louis.bossart@linux.intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=daniel.baluta@nxp.com \
--cc=kai.vehmanen@linux.intel.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ranjani.sridharan@linux.intel.com \
--cc=sound-open-firmware@alsa-project.org \
--cc=zealci@zte.com.cn \
/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