wifi: iwlwifi: mvm: fix erroneous queue index mask
authorJohannes Berg <johannes.berg@intel.com>
Mon, 5 Feb 2024 19:21:14 +0000 (21:21 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Feb 2024 14:00:48 +0000 (15:00 +0100)
commit2e0e766bd8a7f14f10c3e70b8203c4c1e6d9ec76
treeb4c8fd7b55a16ed2660e3eeb363119c433add461
parent0c1c91604f3e3fc41f4d77dcfc3753860a9a32c9
wifi: iwlwifi: mvm: fix erroneous queue index mask

When retrieving the queue index ("SCD SSN") from the TX response,
it's currently masked with 0xFFF. However, now that we have queues
longer than 4k, that became wrong, so make the mask depend on the
hardware family.

This fixes an issue where if we get a single frame reclaim while
in the top half of an 8k long queue, we'd reclaim-wrap the queue
twice (once on this and then again on the next non-single reclaim)
which at least triggers the WARN_ON_ONCE() in iwl_txq_reclaim(),
but could have other negative side effects (such as unmapping a
frame that wasn't transmitted yet, and then taking an IOMMU fault)
as well.

Fixes: 7b3e42ea2ead ("iwlwifi: support multiple tfd queue max sizes for different devices")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240205211151.4148a6ef54e0.I733a70f679c25f9f99097a8dcb3a1f8165da6997@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/tx.c