Skip to content
/ linux Public

Commit 034aabe

Browse files
haruki3hhhSasha Levin
authored andcommitted
wifi: ath10k: sdio: add missing lock protection in ath10k_sdio_fw_crashed_dump()
[ Upstream commit e55ac34 ] ath10k_sdio_fw_crashed_dump() calls ath10k_coredump_new() which requires ar->dump_mutex to be held, as indicated by lockdep_assert_held() in that function. However, the SDIO implementation does not acquire this lock, unlike the PCI and SNOC implementations which properly hold the mutex. Additionally, ar->stats.fw_crash_counter is documented as protected by ar->data_lock in core.h, but the SDIO implementation modifies it without holding this spinlock. Add the missing mutex_lock()/mutex_unlock() around the coredump operations, and add spin_lock_bh()/spin_unlock_bh() around the fw_crash_counter increment, following the pattern used in ath10k_pci_fw_dump_work() and ath10k_snoc_fw_crashed_dump(). Fixes: 3c45f21 ("ath10k: sdio: add firmware coredump support") Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20260123045822.2221549-1-n7l8m4@u.northwestern.edu Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent d787279 commit 034aabe

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+6
-0
lines changed

drivers/net/wireless/ath/ath10k/sdio.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2485,7 +2485,11 @@ void ath10k_sdio_fw_crashed_dump(struct ath10k *ar)
24852485
if (fast_dump)
24862486
ath10k_bmi_start(ar);
24872487

2488+
mutex_lock(&ar->dump_mutex);
2489+
2490+
spin_lock_bh(&ar->data_lock);
24882491
ar->stats.fw_crash_counter++;
2492+
spin_unlock_bh(&ar->data_lock);
24892493

24902494
ath10k_sdio_disable_intrs(ar);
24912495

@@ -2503,6 +2507,8 @@ void ath10k_sdio_fw_crashed_dump(struct ath10k *ar)
25032507

25042508
ath10k_sdio_enable_intrs(ar);
25052509

2510+
mutex_unlock(&ar->dump_mutex);
2511+
25062512
ath10k_core_start_recovery(ar);
25072513
}
25082514

0 commit comments

Comments
 (0)