Message ID | 20241106132437.38024-2-abelova@astralinux.ru (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | cpufreq: amd-pstate: add check for cpufreq_cpu_get's return value | expand |
Hi! I found out this commit should be backported to 6.6 first. Should I resend this letter after it is done or I may ping it later? Anastasia Belova
[AMD Official Use Only - AMD Internal Distribution Only] > -----Original Message----- > From: Anastasia Belova <abelova@astralinux.ru> > Sent: Thursday, November 7, 2024 1:57 AM > To: stable@vger.kernel.org; Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Cc: lvc-project@linuxtesting.org; Huang, Ray <Ray.Huang@amd.com>; Rafael J. > Wysocki <rafael@kernel.org>; Viresh Kumar <viresh.kumar@linaro.org>; linux- > pm@vger.kernel.org; linux-kernel@vger.kernel.org; Yuan, Perry > <Perry.Yuan@amd.com> > Subject: Re: [PATCH 6.1 1/1] cpufreq: amd-pstate: add check for cpufreq_cpu_get's > return value > > Hi! > > I found out this commit should be backported to 6.6 first. > Should I resend this letter after it is done or I may ping it later? > > Anastasia Belova + Mario and Gautham for help. Best Regards. Perry.
diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c index 90dcf26f0973..106aef210003 100644 --- a/drivers/cpufreq/amd-pstate.c +++ b/drivers/cpufreq/amd-pstate.c @@ -309,9 +309,14 @@ static void amd_pstate_adjust_perf(unsigned int cpu, unsigned long max_perf, min_perf, des_perf, cap_perf, lowest_nonlinear_perf, max_freq; struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); - struct amd_cpudata *cpudata = policy->driver_data; + struct amd_cpudata *cpudata; unsigned int target_freq; + if (!policy) + return; + + cpudata = policy->driver_data; + cap_perf = READ_ONCE(cpudata->highest_perf); lowest_nonlinear_perf = READ_ONCE(cpudata->lowest_nonlinear_perf); max_freq = READ_ONCE(cpudata->max_freq);