diff options
| author | Chad Monroe <chad@monroe.io> | 2026-07-24 12:48:12 +0000 |
|---|---|---|
| committer | Felix Fietkau <nbd@nbd.name> | 2026-08-01 14:49:42 +0000 |
| commit | 4c3cf4a8b15090bfff518c09903bf7d3ff0ae110 (patch) | |
| tree | ff66d40f944cfdafb3cf04b2e7ffc9d4a050d13e /tools/perf/scripts/python/task-analyzer.py | |
| parent | 6ff1c217a00335c92aa6a9b35b3ff3b128efbfea (diff) | |
wifi: mt76: serialize scan-link teardown with dev->mutex
The offchannel scan link is allocated in mt76_hw_scan() under
dev->mutex, but torn down without it: mt76_scan_complete() runs from
mt76_scan_work() on the mac80211 workqueue, or from mt76_abort_scan(),
and calls mt76_put_vif_phy_link(), whose vif_link_remove clears the
per-phy omac_mask and the device-wide vif_mask/mld_idx_mask with plain
read-modify-write. A vif link add or remove for another interface,
running concurrently under dev->mutex, can interleave with these
unlocked writes and lose an update: a cleared bit belonging to a live
link gets handed out again (two links sharing an omac/bss/wcid index,
breaking own-MAC unicast RX for the first one), or a freed bit stays
set until reboot and eventually exhausts the index space.
Take dev->mutex around the scan completion, mirroring the ROC teardown
in mt76_roc_complete_work()/mt76_abort_roc(), and switch the channel
restore to __mt76_set_channel() since the caller now holds the lock.
mt76_abort_scan() keeps cancelling the scan work before taking the
mutex, so the work-vs-abort ordering is unchanged.
Signed-off-by: Chad Monroe <chad@monroe.io>
Link: https://patch.msgid.link/20260724124813.3961474-28-nbd@nbd.name
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
