From b460b317b21d5106f3ebd34bd51b851ad355a70a Mon Sep 17 00:00:00 2001 From: Takashi Sakamoto Date: Wed, 17 Sep 2025 09:03:45 +0900 Subject: [PATCH] firewire: core: schedule bm_work item outside of spin lock Before (re)building topology tree, fw_core_handle_bus_reset() schedules a work item under acquiring fw_card spin lock. The work item invokes bm_work() which acquires the spin lock at first, then can be stalled to wait until the building tree finishes. This is inconvenient. This commit moves the timing to schedule the work item after releasing the spin lock. Link: https://lore.kernel.org/r/20250917000347.52369-2-o-takashi@sakamocchi.jp Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-topology.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c index 8fa0772ee723f..2f73bcd5696f2 100644 --- a/drivers/firewire/core-topology.c +++ b/drivers/firewire/core-topology.c @@ -479,7 +479,6 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation, card->reset_jiffies = get_jiffies_64(); card->bm_node_id = 0xffff; card->bm_abdicate = bm_abdicate; - fw_schedule_bm_work(card, 0); local_node = build_tree(card, self_ids, self_id_count, generation); @@ -496,6 +495,8 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation, } } + fw_schedule_bm_work(card, 0); + // Just used by transaction layer. scoped_guard(spinlock, &card->topology_map.lock) { update_topology_map(card->topology_map.buffer, sizeof(card->topology_map.buffer), -- 2.47.3