[PATCH 2/4] firmware: smccc: lfa: Drop nested CPU hotplug read lock

Jiangtian Feng jiangtianfeng at linux.alibaba.com
Wed Dec 2 17:38:15 PST 2026


stop_machine() already takes cpus_read_lock() internally. Taking another
read lock outside can deadlock if a hotplug writer starts waiting
between the two acquisitions.

Call stop_machine() directly and let it manage the hotplug lock.

Link: https://lore.kernel.org/all/705b63c3-297a-4bf8-9eb2-b826e280e7da@nvidia.com/
Signed-off-by: Jiangtian Feng <jiangtianfeng at linux.alibaba.com>
---
 drivers/firmware/smccc/lfa_fw.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/firmware/smccc/lfa_fw.c b/drivers/firmware/smccc/lfa_fw.c
index 383157ab7cea..1864176f3410 100644
--- a/drivers/firmware/smccc/lfa_fw.c
+++ b/drivers/firmware/smccc/lfa_fw.c
@@ -460,10 +460,8 @@ static int activate_fw_component(struct fw_component *comp)
 		comp->use_cpu_rendezvous = comp->cpu_rendezvous_forced ||
 					   comp->cpu_rendezvous;
 		if (comp->use_cpu_rendezvous) {
-			cpus_read_lock();
 			ret = stop_machine(call_lfa_activate, comp,
 					   cpu_online_mask);
-			cpus_read_unlock();
 		} else {
 			ret = call_lfa_activate(comp);
 		}
-- 
2.47.3




More information about the linux-arm-kernel mailing list