lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <78c7edc3-f431-9735-238d-9aa2b45ec45e@linux.intel.com>
Date:   Wed, 20 Apr 2022 08:28:31 -0500
From:   Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To:     cgel.zte@...il.com
Cc:     lgirdwood@...il.com, ranjani.sridharan@...ux.intel.com,
        kai.vehmanen@...ux.intel.com, daniel.baluta@....com,
        broonie@...nel.org, sound-open-firmware@...a-project.org,
        alsa-devel@...a-project.org, linux-kernel@...r.kernel.org,
        Minghao Chi <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] ASoC: SOF: using pm_runtime_resume_and_get to simplify
 the code



On 4/19/22 22:03, cgel.zte@...il.com wrote:
> From: Minghao Chi <chi.minghao@....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@....com.cn>
> Signed-off-by: Minghao Chi <chi.minghao@....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;
>  	}
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ