]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf/x86/intel/uncore: Clean up func_id
authorKan Liang <kan.liang@linux.intel.com>
Wed, 8 Jan 2025 14:30:16 +0000 (06:30 -0800)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 10 Jan 2025 17:16:50 +0000 (18:16 +0100)
commit3f710be02ea648001ba18fb2c9fa7765e743dec2
tree3af5f23970c3d17c13c09cc603b299bb8a2f8d4b
parent0e45818ec1896c2b4aee0ec6721022ad625ea531
perf/x86/intel/uncore: Clean up func_id

The below warning may be triggered on GNR when the PCIE uncore units are
exposed.

WARNING: CPU: 4 PID: 1 at arch/x86/events/intel/uncore.c:1169 uncore_pci_pmu_register+0x158/0x190

The current uncore driver assumes that all the devices in the same PMU
have the exact same devfn. It's true for the previous platforms. But it
doesn't work for the new PCIE uncore units on GNR.

The assumption doesn't make sense. There is no reason to limit the
devices from the same PMU to the same devfn. Also, the current code just
throws the warning, but still registers the device. The WARN_ON_ONCE()
should be removed.

The func_id is used by the later event_init() to check if a event->pmu
has valid devices. For cpu and mmio uncore PMUs, they are always valid.
For pci uncore PMUs, it's set when the PMU is registered. It can be
replaced by the pmu->registered. Clean up the func_id.

Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Tested-by: Eric Hu <eric.hu@intel.com>
Link: https://lkml.kernel.org/r/20250108143017.1793781-1-kan.liang@linux.intel.com
arch/x86/events/intel/uncore.c
arch/x86/events/intel/uncore.h
arch/x86/events/intel/uncore_snb.c