mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] perf/dwc_pcie: Fix lockdep warnings in device and event setup
@ 2026-08-11 13:17 Zhanpeng Zhang
  2026-08-11 16:06 ` [PATCH v2 1/2] perf/dwc_pcie: Avoid nested bus notifier locking Zhanpeng Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Zhanpeng Zhang @ 2026-08-11 13:17 UTC (permalink / raw)
  To: Shuai Xue, Jing Zhang
  Cc: Will Deacon, Mark Rutland, Yicong Yang, Baolin Wang,
	Jonathan Cameron, linux-arm-kernel, linux-perf-users,
	linux-kernel, Zhanpeng Zhang

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)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-10-04 17:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-11 13:17 [PATCH v2 0/2] perf/dwc_pcie: Fix lockdep warnings in device and event setup Zhanpeng Zhang
2026-08-11 16:06 ` [PATCH v2 1/2] perf/dwc_pcie: Avoid nested bus notifier locking Zhanpeng Zhang
2026-08-13  6:04   ` Yicong Yang
2026-08-11 16:07 ` [PATCH v2 2/2] perf/dwc_pcie: Skip sibling walks for new group leaders Zhanpeng Zhang
2026-08-13  6:15   ` Yicong Yang
2026-10-04 17:15 ` [PATCH v2 0/2] perf/dwc_pcie: Fix lockdep warnings in device and event setup Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®