[PATCH v5 13/18] xen/cpufreq: normalize hwp driver check with hwp_active()

Penny Zheng posted 18 patches 5 months, 1 week ago
There is a newer version of this series
[PATCH v5 13/18] xen/cpufreq: normalize hwp driver check with hwp_active()
Posted by Penny Zheng 5 months, 1 week ago
Instead of using hypercall passing parameter to identify hwp driver,
we shall use hwp_active(). Also, we've already used hwp_active() in
do_get_pm_info() in the same file to do hwp driver check, it's
better syncing with same way.

Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>
---
v4 -> v5:
- new commit
---
 xen/drivers/acpi/pmstat.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/xen/drivers/acpi/pmstat.c b/xen/drivers/acpi/pmstat.c
index 514475cf5c..c09e001ec3 100644
--- a/xen/drivers/acpi/pmstat.c
+++ b/xen/drivers/acpi/pmstat.c
@@ -253,9 +253,7 @@ static int get_cpufreq_para(struct xen_sysctl_pm_op *op)
     else
         strlcpy(op->u.get_para.scaling_driver, "Unknown", CPUFREQ_NAME_LEN);
 
-    if ( IS_ENABLED(CONFIG_INTEL) &&
-         !strncmp(op->u.get_para.scaling_driver, XEN_HWP_DRIVER_NAME,
-                  CPUFREQ_NAME_LEN) )
+    if ( hwp_active() )
         ret = get_hwp_para(policy->cpu, &op->u.get_para.u.cppc_para);
     else
     {
-- 
2.34.1
Re: [PATCH v5 13/18] xen/cpufreq: normalize hwp driver check with hwp_active()
Posted by Jan Beulich 4 months, 2 weeks ago
On 27.05.2025 10:48, Penny Zheng wrote:
> Instead of using hypercall passing parameter to identify hwp driver,
> we shall use hwp_active(). Also, we've already used hwp_active() in
> do_get_pm_info() in the same file to do hwp driver check, it's
> better syncing with same way.
> 
> Signed-off-by: Penny Zheng <Penny.Zheng@amd.com>

Acked-by: Jan Beulich <jbeulich@suse.com>

Is this okay to apply ahead of most/all of the earlier patches?

Jan