[PATCH v2 0/2] perf/dwc_pcie: Fix lockdep warnings in device and event setup
Zhanpeng Zhang <[email protected]>
| Newsgroups | org.kernel.vger.linux-perf-users,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
The DWC PCIe PMU driver creates a synthetic platform device for each Root Port from its PCI bus notifier. If a PCI host bridge is registered during late init, platform device registration enters the platform bus notifier chain while the PCI bus notifier lock remains held, and lockdep reports possible recursive locking. Patch 1 moves platform device reconciliation out of the notifier callback. The event initialization path has a separate locking issue. It walks a new group leader's sibling list even though perf does not hold the event context lock required by for_each_sibling_event(). Patch 2 skips those walks for group leaders while preserving validation for group members. The series was tested on a RISC-V system with CONFIG_KASAN, CONFIG_PROVE_LOCKING, CONFIG_DEBUG_LOCK_ALLOC and CONFIG_LOCKDEP enabled. Late PCI discovery and a system-wide DWC PCIe PMU perf stat complete without lockdep reports, and the kernel remains untainted. Zhanpeng Zhang (2): perf/dwc_pcie: Avoid nested bus notifier locking perf/dwc_pcie: Skip sibling walks for new group leaders drivers/perf/dwc_pcie_pmu.c | 161 +++++++++++++++++++++++++++--------- 1 file changed, 122 insertions(+), 39 deletions(-) -- 2.50.1 (Apple Git-155)