# Re: \[PATCH v5 2/2\] cpupower: Fix to return negative value if no permisssion for read\_msr

- From: Shuah Khan \<skhan@linuxfoundation.org\>
- Date: 2021-07-26 20:04:44 
- List: linux-pm
- Page: https://ratatoskr.run/linux-pm/2021/07/1458717
- Thread: https://ratatoskr.run/linux-pm/2021/07/1458717/t.md

```text
On 7/23/21 12:26 AM, 徐福海 wrote:
> From: xufuhai<redacted>  <mailto:<redacted>>
>
> If the read_msr function is executed by a non-root user, the function returns
> -1, which means that there is no permission to access//dev/cpu//%d/msr, but
> cpufreq_has_boost_support should also return -1 immediately, and should not
> follow the original logic to return 0, which will cause amd The cpupower tool
> returns the boost active state as 0.
>
> Reproduce procedure:
>          cpupower frequency-info
>
> Reported-by:   yangrui<redacted>  <mailto:<redacted>>
> Signed-off-by: xufuhai<redacted>  <mailto:<redacted>>
> Signed-off-by: chenguanqiao<redacted>  <mailto:<redacted>>
> Signed-off-by: lishujin<redacted>  <mailto:<redacted>>

Please use your full names for the Signed-off-by - similar to the way you
would sign a legal document.

thanks,
-- Shuah
```
