wifi: iwlwifi: mvm: remove warning on unallocated BAID
authorJohannes Berg <johannes.berg@intel.com>
Fri, 27 Dec 2024 08:00:57 +0000 (10:00 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 13 Jan 2025 13:01:51 +0000 (14:01 +0100)
Due to the firmware allocating the BAID, we can only install
the data structure after the BAID is valid from the firmware's
point of view. As a result, the firmware can start sending
frame release notifications to the driver immediately. This
isn't supposed to happen by protocol, since the peer STA is
not expected to use the blockack session until the AddBA has
a response. However, firmware doesn't know that, our RX path
can't know when it was, so simply don't WARN in this case but
only have a debug message.

Since the BAID comes from firmware, also use IWL_FW_CHECK()
instead of a warning for the validity check.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20241227095718.4360f2b9e185.I447f9a5fc6dfdc78ec238200338e2da040ee7e61@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c

index c03cb7c..09fd875 100644 (file)
@@ -636,15 +636,21 @@ static void iwl_mvm_release_frames_from_notif(struct iwl_mvm *mvm,
        IWL_DEBUG_HT(mvm, "Frame release notification for BAID %u, NSSN %d\n",
                     baid, nssn);
 
-       if (WARN_ON_ONCE(baid == IWL_RX_REORDER_DATA_INVALID_BAID ||
-                        baid >= ARRAY_SIZE(mvm->baid_map)))
+       if (IWL_FW_CHECK(mvm,
+                        baid == IWL_RX_REORDER_DATA_INVALID_BAID ||
+                        baid >= ARRAY_SIZE(mvm->baid_map),
+                        "invalid BAID from FW: %d\n", baid))
                return;
 
        rcu_read_lock();
 
        ba_data = rcu_dereference(mvm->baid_map[baid]);
-       if (WARN(!ba_data, "BAID %d not found in map\n", baid))
+       if (!ba_data) {
+               IWL_DEBUG_RX(mvm,
+                            "Got valid BAID %d but not allocated, invalid frame release!\n",
+                            baid);
                goto out;
+       }
 
        /* pick any STA ID to find the pointer */
        sta_id = ffs(ba_data->sta_mask) - 1;