linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: intel_pstate: Avoid using CPPC when ACPI CPC is not valid
@ 2021-11-18 12:45 Kai-Heng Feng
  2021-11-18 13:14 ` Rafael J. Wysocki
  2021-11-19  6:30 ` kernel test robot
  0 siblings, 2 replies; 3+ messages in thread
From: Kai-Heng Feng @ 2021-11-18 12:45 UTC (permalink / raw)
  To: srinivas.pandruvada, lenb, rafael, viresh.kumar
  Cc: Kai-Heng Feng, open list:INTEL PSTATE DRIVER, open list

If ACPI CPC is not valid, dereference cpc_desc in cppc_get_perf() causes
a NULL pointer dereference. So avoid using CPPC for that scenario.

Fixes: 46573fd6369f ("cpufreq: intel_pstate: hybrid: Rework HWP calibration")
Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/cpufreq/intel_pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 815df3daae9df..24c7d705b99b6 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -3369,7 +3369,7 @@ static int __init intel_pstate_init(void)
 			if (!default_driver)
 				default_driver = &intel_pstate;
 
-			if (boot_cpu_has(X86_FEATURE_HYBRID_CPU))
+			if (boot_cpu_has(X86_FEATURE_HYBRID_CPU) && acpi_cpc_valid())
 				intel_pstate_cppc_set_cpu_scaling();
 
 			goto hwp_cpu_matched;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-19  6:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-18 12:45 [PATCH] cpufreq: intel_pstate: Avoid using CPPC when ACPI CPC is not valid Kai-Heng Feng
2021-11-18 13:14 ` Rafael J. Wysocki
2021-11-19  6:30 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).