]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerSasha Levin <sashal@kernel.org>
Tue, 26 Mar 2024 22:19:27 +0000 (18:19 -0400)
commit67e7b24a70fe8878d5641e06a7bc6f0823a5c53d
tree73013ed8cc76f96b2f93332f100fe5767a66289b
parent7559a34fc068bfa6da534e0bc25607b1abb4c676
wifi: iwlwifi: mvm: fix erroneous queue index mask

[ Upstream commit 2e0e766bd8a7f14f10c3e70b8203c4c1e6d9ec76 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/tx.c