Skip to content

Commit 156c8b5

Browse files
Kan LiangIngo Molnar
authored andcommitted
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 15a3e84 ("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 <[email protected]> Suggested-by: Ingo Molnar <[email protected]> Reported-by: Masayoshi Mizuma <[email protected]> Tested-by: Masayoshi Mizuma <[email protected]> Signed-off-by: Kan Liang <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Stephane Eranian <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Vince Weaver <[email protected]> Cc: [email protected] Cc: [email protected] Fixes: 15a3e84 ("perf/x86/intel/uncore: Fix SBOX support for Broadwell CPUs") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 527838d commit 156c8b5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

arch/x86/events/intel/uncore.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#define UNCORE_PCI_DEV_TYPE(data) ((data >> 8) & 0xff)
2929
#define UNCORE_PCI_DEV_IDX(data) (data & 0xff)
3030
#define UNCORE_EXTRA_PCI_DEV 0xff
31-
#define UNCORE_EXTRA_PCI_DEV_MAX 3
31+
#define UNCORE_EXTRA_PCI_DEV_MAX 4
3232

3333
#define UNCORE_EVENT_CONSTRAINT(c, n) EVENT_CONSTRAINT(c, n, 0xff)
3434

arch/x86/events/intel/uncore_snbep.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,6 +1029,7 @@ void snbep_uncore_cpu_init(void)
10291029
enum {
10301030
SNBEP_PCI_QPI_PORT0_FILTER,
10311031
SNBEP_PCI_QPI_PORT1_FILTER,
1032+
BDX_PCI_QPI_PORT2_FILTER,
10321033
HSWEP_PCI_PCU_3,
10331034
};
10341035

@@ -3286,15 +3287,18 @@ static const struct pci_device_id bdx_uncore_pci_ids[] = {
32863287
},
32873288
{ /* QPI Port 0 filter */
32883289
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),
32903292
},
32913293
{ /* QPI Port 1 filter */
32923294
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),
32943297
},
32953298
{ /* QPI Port 2 filter */
32963299
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),
32983302
},
32993303
{ /* PCU.3 (for Capability registers) */
33003304
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x6fc0),

0 commit comments

Comments
 (0)