ASoC: SOF: using pm_runtime_resume_and_get to simplify the code
Subsystems (3)
PATCH 1/1 ASoC: SOF: using pm_runtime_resume_and_get to simplify the code
From: Minghao Chi <[email protected]>
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.
--- sound/soc/sof/sof-client-probes.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
sound/soc/sof/sof-client-probes.c +3 -6
@@ -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; }
Signature · 1 line
2.25.1
Quoted 8 lines · On 4/19/22 22:03, [email protected] wrote:
From: Minghao Chi <[email protected]>
Using
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi <[email protected]>
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).
Quoted 44 lines
--- sound/soc/sof/sof-client-probes.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)sound/soc/sof/sof-client-probes.c +3
-6@@ -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; }
Mark Brown
maintainerQuoted 10 lines · Pierre-Louis Bossart
Quoted 5 lines · On 4/19/22 22:03, [email protected] wrote:
From: Minghao Chi <[email protected]>
Using
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes.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?
It seems like a much better pattern and there's been a steady stream of conversion patches. The whole get/idle thing is pretty much just sharp edges.
Quoted 1 line
the overwhelming majority of drivers in
sound/socstill rely on thepm_runtime_get_sync(111 v. 7).
We'll get there I'm sure.
Pierre-Louis Bossart
Acked-byQuoted 12 lines · Mark Brown
Quoted 10 lines · Pierre-Louis Bossart
Quoted 5 lines · On 4/19/22 22:03, [email protected] wrote:
From: Minghao Chi <[email protected]>
Using
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes.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?
Quoted 7 lines
It seems like a much better pattern and there's been a steady stream of conversion patches. The whole get/idle thing is pretty much just sharp edges.
Quoted 1 line
the overwhelming majority of drivers in
sound/socstill rely on thepm_runtime_get_sync(111 v. 7).We'll get there I'm sure.
ok, I'll send follow-up patches for the remaining code.
For this patch:
Mark Brown
maintainerQuoted 1 line · Pierre-Louis Bossart
ok, I'll send follow-up patches for the remaining code.
Thanks, like you say there's a lot to get through here!
Mark Brown
maintainerQuoted 8 lines · On Wed, 20 Apr 2022 03:03:15 +0000, [email protected] wrote:
From: Minghao Chi <[email protected]>
Using
pm_runtime_resume_and_get()to replacepm_runtime_get_syncandpm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: SOF: using pm_runtime_resume_and_get to simplify the code
commit: b3598fe6d009b2f2144115dfc381615c8b534aec
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark