Linux Power Management development
 help / color / mirror / Atom feed
From: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>,
	Xi Ruoyao <xry111@xry111.site>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] cpufreq: intel_pstate: Use raw_smp_processor_id() in hwp_get_cpu_scaling()
Date: Mon, 14 Apr 2025 09:41:02 -0700	[thread overview]
Message-ID: <20250414164102.vfk64a44mvutg4dh@desk> (raw)
In-Reply-To: <12659608.O9o76ZdvQC@rjwysocki.net>

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@xry111.site>
> >
> > Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.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();

      parent reply	other threads:[~2025-04-14 16:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-12 10:34 [PATCH] cpufreq: intel_pstate: Use raw_smp_processor_id() in hwp_get_cpu_scaling() Xi Ruoyao
2025-04-13 14:44 ` srinivas pandruvada
2025-04-14 15:19   ` Rafael J. Wysocki
2025-04-14 15:26     ` srinivas pandruvada
2025-04-14 15:27       ` Rafael J. Wysocki
2025-04-14 16:41     ` Pawan Gupta [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250414164102.vfk64a44mvutg4dh@desk \
    --to=pawan.kumar.gupta@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rafael@kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox