linux/drivers/perf
Krishna chaitanya chundru e669388537 perf/dwc_pcie: Fix registration issue in multi PCIe controller instances
When there are multiple of instances of PCIe controllers, registration
to perf driver fails with this error.
sysfs: cannot create duplicate filename '/devices/platform/dwc_pcie_pmu.0'
CPU: 0 PID: 166 Comm: modprobe Not tainted 6.10.0-rc2-next-20240607-dirty
Hardware name: Qualcomm SA8775P Ride (DT)
Call trace:
 dump_backtrace.part.8+0x98/0xf0
 show_stack+0x14/0x1c
 dump_stack_lvl+0x74/0x88
 dump_stack+0x14/0x1c
 sysfs_warn_dup+0x60/0x78
 sysfs_create_dir_ns+0xe8/0x100
 kobject_add_internal+0x94/0x224
 kobject_add+0xa8/0x118
 device_add+0x298/0x7b4
 platform_device_add+0x1a0/0x228
 platform_device_register_full+0x11c/0x148
 dwc_pcie_register_dev+0x74/0xf0 [dwc_pcie_pmu]
 dwc_pcie_pmu_init+0x7c/0x1000 [dwc_pcie_pmu]
 do_one_initcall+0x58/0x1c0
 do_init_module+0x58/0x208
 load_module+0x1804/0x188c
 __do_sys_init_module+0x18c/0x1f0
 __arm64_sys_init_module+0x14/0x1c
 invoke_syscall+0x40/0xf8
 el0_svc_common.constprop.1+0x70/0xf4
 do_el0_svc+0x18/0x20
 el0_svc+0x28/0xb0
 el0t_64_sync_handler+0x9c/0xc0
 el0t_64_sync+0x160/0x164
kobject: kobject_add_internal failed for dwc_pcie_pmu.0 with -EEXIST,
don't try to register things with the same name in the same directory.

This is because of having same bdf value for devices under two different
controllers.

Update the logic to use sbdf which is a unique number in case of
multi instance also.

Fixes: af9597adc2 ("drivers/perf: add DesignWare PCIe PMU driver")
Signed-off-by: Krishna chaitanya chundru <quic_krichai@quicinc.com>
Reviewed-by: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20240816-dwc_pmu_fix-v2-1-198b8ab1077c@quicinc.com
Signed-off-by: Will Deacon <will@kernel.org>
2024-08-23 16:07:25 +01:00
..
amlogic perf/amlogic: Assign parents for event_source devices 2024-04-19 15:59:29 +01:00
arm_cspmu perf: add missing MODULE_DESCRIPTION() macros 2024-07-10 13:04:38 +01:00
hisilicon perf: add missing MODULE_DESCRIPTION() macros 2024-07-10 13:04:38 +01:00
alibaba_uncore_drw_pmu.c drivers/perf: Fix ali_drw_pmu driver interrupt status clearing 2024-08-23 16:03:56 +01:00
apple_m1_cpu_pmu.c drivers/perf: apple_m1: add known PMU events 2024-08-23 15:52:48 +01:00
arm_dmc620_pmu.c perf/arm-dmc620: Fix lockdep assert in ->event_init() 2024-05-17 16:48:05 +01:00
arm_dsu_pmu.c Driver core changes for 6.10-rc1 2024-05-22 12:13:40 -07:00
arm_pmu_acpi.c arm_pmu: acpi: Add a representative platform device for TRBE 2023-08-18 18:07:10 +01:00
arm_pmu_platform.c perf: arm_pmu: Use of_property_present() 2024-08-16 13:08:21 +01:00
arm_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm_pmuv3.c perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter 2024-08-16 13:09:12 +01:00
arm_smmuv3_pmu.c perf/arm-smmuv3: Assign parents for event_source device 2024-04-19 15:59:31 +01:00
arm_spe_pmu.c perf/arm-spe: Assign parents for event_source device 2024-04-19 15:59:31 +01:00
arm_v6_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm_v7_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm_xscale_pmu.c perf: arm_pmu: Remove event index to counter remapping 2024-08-16 13:09:11 +01:00
arm-cci.c Driver core changes for 6.10-rc1 2024-05-22 12:13:40 -07:00
arm-ccn.c perf: add missing MODULE_DESCRIPTION() macros 2024-07-10 13:04:38 +01:00
arm-cmn.c perf/arm-cmn: Enable support for tertiary match group 2024-07-01 14:55:08 +01:00
cxl_pmu.c perf: add missing MODULE_DESCRIPTION() macros 2024-07-10 13:04:38 +01:00
dwc_pcie_pmu.c perf/dwc_pcie: Fix registration issue in multi PCIe controller instances 2024-08-23 16:07:25 +01:00
fsl_imx8_ddr_perf.c perf: add missing MODULE_DESCRIPTION() macros 2024-07-10 13:04:38 +01:00
fsl_imx9_ddr_perf.c perf: imx_perf: add support for i.MX95 platform 2024-07-01 15:42:59 +01:00
Kconfig perf/arm: Move 32-bit PMU drivers to drivers/perf/ 2024-07-03 14:07:14 +01:00
Makefile perf/arm: Move 32-bit PMU drivers to drivers/perf/ 2024-07-03 14:07:14 +01:00
marvell_cn10k_ddr_pmu.c perf: add missing MODULE_DESCRIPTION() macros 2024-07-10 13:04:38 +01:00
marvell_cn10k_tad_pmu.c perf: marvell_cn10k_tad: Convert to platform remove callback returning void 2024-02-09 15:59:30 +00:00
qcom_l2_pmu.c perf/qcom: Assign parents for event_source devices 2024-04-19 15:59:30 +01:00
qcom_l3_pmu.c Driver core changes for 6.10-rc1 2024-05-22 12:13:40 -07:00
riscv_pmu_legacy.c perf/riscv: Assign parents for event_source devices 2024-04-19 15:59:29 +01:00
riscv_pmu_sbi.c perf: riscv: Fix selecting counters in legacy mode 2024-08-01 07:15:13 -07:00
riscv_pmu.c drivers/perf: riscv: Do not update the event data if uptodate 2024-07-03 12:56:15 -07:00
starfive_starlink_pmu.c perf: starfive: Add StarLink PMU support 2024-03-04 14:19:48 +00:00
thunderx2_pmu.c perf/thunderx2: Assign parents for event_source devices 2024-04-19 15:59:29 +01:00
xgene_pmu.c Driver core changes for 6.10-rc1 2024-05-22 12:13:40 -07:00