[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250414164102.vfk64a44mvutg4dh@desk>
Date: Mon, 14 Apr 2025 09:41:02 -0700
From: Pawan Gupta <pawan.kumar.gupta@...ux.intel.com>
To: "Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: srinivas pandruvada <srinivas.pandruvada@...ux.intel.com>,
Xi Ruoyao <xry111@...111.site>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>
Subject: Re: [PATCH] cpufreq: intel_pstate: Use raw_smp_processor_id() in
hwp_get_cpu_scaling()
On Mon, Apr 14, 2025 at 05:19:04PM +0200, Rafael J. Wysocki wrote:
> On Sunday, April 13, 2025 4:44:56 PM CEST srinivas pandruvada wrote:
> > On Sat, 2025-04-12 at 18:34 +0800, Xi Ruoyao wrote:
> > > Use raw_smp_processor_id() instead of plain smp_processor_id() in
> > > hwp_get_cpu_scaling(), otherwise we get some errors on a Lenovo
> > > Thinkpad
> > > T14P Gen 2:
> > >
> > > BUG: using smp_processor_id() in preemptible [00000000] code:
> > > swapper/0/1
> > > caller is hwp_get_cpu_scaling+0x7f/0xc0
> > >
> > > Fixes: b52aaeeadfac ("cpufreq: intel_pstate: Avoid SMP calls to get
> > > cpu-type")
> > > Signed-off-by: Xi Ruoyao <xry111@...111.site>
> >
> > Acked-by: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>
>
> It's still broken after this patch though because the function should
> use the cpu_data() of the target CPU and not of the CPU running the code.
Sorry for missing that.
I noticed that find_hybrid_pmu_for_cpu() doesn't take the cpu argument.
Does it suffer from the same problem?
init_hybrid_pmu(int cpu)
{
struct cpu_hw_events *cpuc = &per_cpu(cpu_hw_events, cpu);
struct x86_hybrid_pmu *pmu = find_hybrid_pmu_for_cpu();
Powered by blists - more mailing lists