ras: aest: fix duplicate cpu_pm notifier registration - #881
ras: aest: fix duplicate cpu_pm notifier registration#881Shiraz Hashim (shashim-quic) wants to merge 1 commit into
Conversation
aest_device_probe() unconditionally calls aest_cpu_pm_init(), which registers the driver's single static cpu_pm notifier_block. On targets that expose more than one AEST platform device (e.g. QCS8300/Monaco, which has aest-processor-0, aest-l3-cluster0 and aest-l3-cluster1), the "AEST" platform driver probes once per device, so the same notifier is registered multiple times. cpu_pm's notifier_chain_register() detects the re-add of an already-linked notifier_block and fires WARN(1, "notifier callback %ps already registered", ...), producing a call trace on every boot for the 2nd and later probes. Refcount aest_cpu_pm_init()/aest_cpu_pm_exit() so the notifier is registered exactly once regardless of how many AEST devices this target exposes, and unregistered only once every probed device has been torn down. aest_device_remove() now balances aest_cpu_pm_init() with aest_cpu_pm_exit() for every device type, and the now-redundant direct aest_cpu_pm_exit() call in aest_exit() is removed since platform_driver_unregister() already drives aest_device_remove() for each bound device. Fixes: 0132f7b ("WORKAROUND: Move CPU PM notifier registration to Probe") Signed-off-by: Shiraz Hashim <shiraz.hashim@oss.qualcomm.com>
|
Merge Check Failed: No CR Numbers Found Error: No Change Request numbers were found. Please add Change Request numbers to your pull request description in the format CRs-Fixed: 12345 or link GitHub issues that are associated with Change Requests. |
PR #881 — validate-patchPR: #881
Final Summary
|
PR #881 — checker-log-analyzerPR: #881
Detailed report: Full report
|
Summary
aest_device_probe()indrivers/ras/aest/aest-core.cunconditionallyregisters a single, shared static
cpu_pmnotifier on every probe of the"AEST" platform driver. On QCS8300/Monaco three AEST platform devices are
created from DT (
aest-processor-0,aest-l3-cluster0,aest-l3-cluster1), so the driver probes three times and tries toregister the same notifier three times. The kernel's
notifier_chain_register()detects the re-add of an already-linkednotifier and fires
WARN(1, "notifier callback %ps already registered", ...)on the 2nd and 3rd probe, producing a call trace on every boot
(non-fatal — boot completes normally, but the WARN is 100% reproducible
and taints the kernel).
Fixes the shared notifier registration by refcounting
aest_cpu_pm_init()/aest_cpu_pm_exit()so it is registered exactlyonce regardless of how many AEST devices this target exposes, and
unregistered only once every probed device has been torn down.
Fixes: 0132f7b ("WORKAROUND: Move CPU PM notifier registration to Probe")
Test plan
checkpatch.pl --strict: 0 errors, 0 warnings, 0 checksEfficacy; Concurrency/Memory Ordering & Caller Impact), full 2/2
consensus reached after 4 rounds — see
debate log
notifier callback aest_cpu_pm_notify already registeredWARNappears across the 3 AEST probes
CRs-Fixed: CR4618661