aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKan Liang <kan.liang@linux.intel.com>2018-07-30 08:28:08 -0400
committerIngo Molnar <mingo@kernel.org>2018-07-31 01:43:37 -0400
commit156c8b58ef5cfd97245928c95669fd4cb0f9c388 (patch)
tree3f012a5dc382cf25ad640359f36d681d461c0678
parent527838d470e3a6e79e8ee9d5ddf28920df2a196e (diff)
perf/x86/intel/uncore: Fix hardcoded index of Broadwell extra PCI devices
Masayoshi Mizuma reported that a warning message is shown while a CPU is hot-removed on Broadwell servers: WARNING: CPU: 126 PID: 6 at arch/x86/events/intel/uncore.c:988 uncore_pci_remove+0x10b/0x150 Call Trace: pci_device_remove+0x42/0xd0 device_release_driver_internal+0x148/0x220 pci_stop_bus_device+0x76/0xa0 pci_stop_root_bus+0x44/0x60 acpi_pci_root_remove+0x1f/0x80 acpi_bus_trim+0x57/0x90 acpi_bus_trim+0x2e/0x90 acpi_device_hotplug+0x2bc/0x4b0 acpi_hotplug_work_fn+0x1a/0x30 process_one_work+0x174/0x3a0 worker_thread+0x4c/0x3d0 kthread+0xf8/0x130 This bug was introduced by: commit 15a3e845b01c ("perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs") The index of "QPI Port 2 filter" was hardcode to 2, but this conflicts with the index of "PCU.3" which is "HSWEP_PCI_PCU_3", which equals to 2 as well. To fix the conflict, the hardcoded index needs to be cleaned up: - introduce a new enumerator "BDX_PCI_QPI_PORT2_FILTER" for "QPI Port 2 filter" on Broadwell, - increase UNCORE_EXTRA_PCI_DEV_MAX by one, - clean up the hardcoded index. Debugged-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Suggested-by: Ingo Molnar <mingo@kernel.org> Reported-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Tested-by: Masayoshi Mizuma <m.mizuma@jp.fujitsu.com> Signed-off-by: Kan Liang <kan.liang@linux.intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vince Weaver <vincent.weaver@maine.edu> Cc: msys.mizuma@gmail.com Cc: stable@vger.kernel.org Fixes: 15a3e845b01c ("perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs") Link: http://lkml.kernel.org/r/1532953688-15008-1-git-send-email-kan.liang@linux.intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r--arch/x86/events/intel/uncore.h2
-rw-r--r--arch/x86/events/intel/uncore_snbep.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/arch/x86/events/intel/uncore.h b/arch/x86/events/intel/uncore.h
index c9e1e0bef3c3..e17ab885b1e9 100644
--- a/arch/x86/events/intel/uncore.h
+++ b/arch/x86/events/intel/uncore.h
@@ -28,7 +28,7 @@
28#define UNCORE_PCI_DEV_TYPE(data) ((data >> 8) & 0xff) 28#define UNCORE_PCI_DEV_TYPE(data) ((data >> 8) & 0xff)
29#define UNCORE_PCI_DEV_IDX(data) (data & 0xff) 29#define UNCORE_PCI_DEV_IDX(data) (data & 0xff)
30#define UNCORE_EXTRA_PCI_DEV 0xff 30#define UNCORE_EXTRA_PCI_DEV 0xff
31#define UNCORE_EXTRA_PCI_DEV_MAX 3 31#define UNCORE_EXTRA_PCI_DEV_MAX 4
32 32
33#define UNCORE_EVENT_CONSTRAINT(c, n) EVENT_CONSTRAINT(c, n, 0xff) 33#define UNCORE_EVENT_CONSTRAINT(c, n) EVENT_CONSTRAINT(c, n, 0xff)
34 34
diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index 87dc0263a2e1..51d7c117e3c7 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -1029,6 +1029,7 @@ void snbep_uncore_cpu_init(void)
1029enum { 1029enum {
1030 SNBEP_PCI_QPI_PORT0_FILTER, 1030 SNBEP_PCI_QPI_PORT0_FILTER,
1031 SNBEP_PCI_QPI_PORT1_FILTER, 1031 SNBEP_PCI_QPI_PORT1_FILTER,
1032 BDX_PCI_QPI_PORT2_FILTER,
1032 HSWEP_PCI_PCU_3, 1033 HSWEP_PCI_PCU_3,
1033}; 1034};
1034 1035
@@ -3286,15 +3287,18 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = {
3286 }, 3287 },
3287 { /* QPI Port 0 filter */ 3288 { /* QPI Port 0 filter */
3288 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f86), 3289 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f86),
3289 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 0), 3290 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
3291 SNBEP_PCI_QPI_PORT0_FILTER),
3290 }, 3292 },
3291 { /* QPI Port 1 filter */ 3293 { /* QPI Port 1 filter */
3292 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f96), 3294 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f96),
3293 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 1), 3295 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
3296 SNBEP_PCI_QPI_PORT1_FILTER),
3294 }, 3297 },
3295 { /* QPI Port 2 filter */ 3298 { /* QPI Port 2 filter */
3296 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f46), 3299 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6f46),
3297 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV, 2), 3300 .driver_data = UNCORE_PCI_DEV_DATA(UNCORE_EXTRA_PCI_DEV,
3301 BDX_PCI_QPI_PORT2_FILTER),
3298 }, 3302 },
3299 { /* PCU.3 (for Capability registers) */ 3303 { /* PCU.3 (for Capability registers) */
3300 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0), 3304 PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0),