Bug 217755

Summary: cpupower: does not correctly display boost state support when ran by non-root users while using amd-pstate-epp driver in active mode
Product: Tools Reporter: chenhq2005
Component: OtherAssignee: Mario Limonciello (AMD) (mario.limonciello)
Status: ASSIGNED ---    
Severity: normal CC: chenhq2005, mario.limonciello, Perry.Yuan
Priority: P3    
Hardware: AMD   
OS: Linux   
Kernel Version: Subsystem:
Regression: No Bisected commit-id:

Description chenhq2005 2023-08-03 07:03:17 UTC
I have a HP Omen 16-c0005AX with a AMD R7-5800H processor.
When running cpupower with a normal user, it indicates that the boost state is not active:

$ cpupower frequency-info
analyzing CPU 1:
  driver: amd-pstate-epp
  CPUs which run at the same hardware frequency: 1
  CPUs which need to have their frequency coordinated by software: 1
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 4.46 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 4.46 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 400 MHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: no

However it is actually active, but cpupower only correctly detects it when ran as root:

$ sudo cpupower frequency-info
analyzing CPU 12:
  driver: amd-pstate-epp
  CPUs which run at the same hardware frequency: 12
  CPUs which need to have their frequency coordinated by software: 12
  maximum transition latency:  Cannot determine or is not supported.
  hardware limits: 400 MHz - 4.46 GHz
  available cpufreq governors: performance powersave
  current policy: frequency should be within 400 MHz and 4.46 GHz.
                  The governor "powersave" may decide which speed to use
                  within this range.
  current CPU frequency: Unable to call hardware
  current CPU frequency: 3.13 GHz (asserted by call to kernel)
  boost state support:
    Supported: yes
    Active: yes
    Boost States: 0
    Total States: 3
    Pstate-P0:  3200MHz
    Pstate-P1:  1300MHz
    Pstate-P2:  1200MHz

cpupower tools used is the one comes with latest stable kernel (6.4).
Comment 1 Mario Limonciello (AMD) 2023-08-11 21:38:54 UTC
I've sent up a fix.

https://lore.kernel.org/linux-pm/20230811213501.17293-1-mario.limonciello@amd.com/T/#u
Comment 2 Mario Limonciello (AMD) 2023-08-15 16:05:41 UTC
This was already queued up to be fixed in 6.6-rc1

a1cf97c2d43ae ("cpupower: Recognise amd-pstate active mode driver")

Can close this at 6.6-rc1.