]> git.hungrycats.org Git - linux/commitdiff
wifi: iwlwifi: mvm: handle BA session teardown in RF-kill
authorJohannes Berg <johannes.berg@intel.com>
Mon, 13 May 2024 10:27:10 +0000 (13:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jul 2024 07:53:21 +0000 (09:53 +0200)
[ Upstream commit 4d08c0b3357cba0aeffaf3abc62cae0c154f2816 ]

When entering RF-kill, mac80211 tears down BA sessions, but
due to RF-kill the commands aren't sent to the device. As a
result, there can be frames pending on the reorder buffer or
perhaps even received while doing so, leading to warnings.

Avoid the warnings by doing the BA session teardown normally
even in RF-kill, which also requires queue sync.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240513132416.0762cd80fb3d.I43c5877f3b546159b2db4f36d6d956b333c41cf0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c
drivers/net/wireless/intel/iwlwifi/mvm/sta.c

index 3b61fe8ca47fa6ba8070f3ccbc2a43108f5f41d2..d3db883dfaa5bd56fcf73d4614a05014f48cffe6 100644 (file)
@@ -6164,7 +6164,7 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
                .len[0] = sizeof(cmd),
                .data[1] = data,
                .len[1] = size,
-               .flags = sync ? 0 : CMD_ASYNC,
+               .flags = CMD_SEND_IN_RFKILL | (sync ? 0 : CMD_ASYNC),
        };
        int ret;
 
index a21e29947475fb5f9dd17c94b2c13d50ce9ab4eb..dbe668db7ce370d7a20ca0a1b99cab261e778652 100644 (file)
@@ -1012,7 +1012,8 @@ static int iwl_mvm_mld_update_sta_baids(struct iwl_mvm *mvm,
 
                cmd.modify.tid = cpu_to_le32(data->tid);
 
-               ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, 0, sizeof(cmd), &cmd);
+               ret = iwl_mvm_send_cmd_pdu(mvm, cmd_id, CMD_SEND_IN_RFKILL,
+                                          sizeof(cmd), &cmd);
                data->sta_mask = new_sta_mask;
                if (ret)
                        return ret;
index 491c449fd4316e30a12dd701e9fbdccdec12bf18..908d0bc474da6ca504f7e7b997ca9760c2672105 100644 (file)
@@ -2836,7 +2836,12 @@ static int iwl_mvm_fw_baid_op_cmd(struct iwl_mvm *mvm,
                .action = start ? cpu_to_le32(IWL_RX_BAID_ACTION_ADD) :
                                  cpu_to_le32(IWL_RX_BAID_ACTION_REMOVE),
        };
-       u32 cmd_id = WIDE_ID(DATA_PATH_GROUP, RX_BAID_ALLOCATION_CONFIG_CMD);
+       struct iwl_host_cmd hcmd = {
+               .id = WIDE_ID(DATA_PATH_GROUP, RX_BAID_ALLOCATION_CONFIG_CMD),
+               .flags = CMD_SEND_IN_RFKILL,
+               .len[0] = sizeof(cmd),
+               .data[0] = &cmd,
+       };
        int ret;
 
        BUILD_BUG_ON(sizeof(struct iwl_rx_baid_cfg_resp) != sizeof(baid));
@@ -2848,7 +2853,7 @@ static int iwl_mvm_fw_baid_op_cmd(struct iwl_mvm *mvm,
                cmd.alloc.ssn = cpu_to_le16(ssn);
                cmd.alloc.win_size = cpu_to_le16(buf_size);
                baid = -EIO;
-       } else if (iwl_fw_lookup_cmd_ver(mvm->fw, cmd_id, 1) == 1) {
+       } else if (iwl_fw_lookup_cmd_ver(mvm->fw, hcmd.id, 1) == 1) {
                cmd.remove_v1.baid = cpu_to_le32(baid);
                BUILD_BUG_ON(sizeof(cmd.remove_v1) > sizeof(cmd.remove));
        } else {
@@ -2857,8 +2862,7 @@ static int iwl_mvm_fw_baid_op_cmd(struct iwl_mvm *mvm,
                cmd.remove.tid = cpu_to_le32(tid);
        }
 
-       ret = iwl_mvm_send_cmd_pdu_status(mvm, cmd_id, sizeof(cmd),
-                                         &cmd, &baid);
+       ret = iwl_mvm_send_cmd_status(mvm, &hcmd, &baid);
        if (ret)
                return ret;