Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1497508lqo; Sun, 12 May 2024 05:25:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX0OqpS4I+R8Nz2isps4+KoWuoncd+gTFh6B/X9Vg8UnSx9S+/4++77XlJfI0pMQp2l3n4+ZgW80WN46igK/Ik3bAxOX74V7Nzv3gBGcQ== X-Google-Smtp-Source: AGHT+IH+jKE+TgxeW0SvJfYFQvGQ72nCwwJJZhrQzLeUY0o6hngoz++toL8I4Wy2QEPYx3EAP1VE X-Received: by 2002:a17:90b:4f81:b0:2a0:3a16:7489 with SMTP id 98e67ed59e1d1-2b6ccfed28bmr5196420a91.44.1715516725665; Sun, 12 May 2024 05:25:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715516725; cv=pass; d=google.com; s=arc-20160816; b=J+W5EZSJqEjmrd9cqpKJ5MEjZBm+jYvHeSCwtQ96gf6JmOAhTzMst2Kq09DlDmFj/s PMaCJctJi14n1PSCdiHjLQ9w6C9V8puGUFAAKliu2goiTrL19IWMSKQ2mgfjlfXEmBKU QZGRB+TBvUVQcmrCmIhB3x9D2gTFoFC4ipPkHiWrnpol9X53KdAQb0k/RctEV/BRN+NN q5vUmMiKKZv2KgA6DmdtN5nF2dUurSPsctMPAmjFZa0gqX46+gwVQVMvLoFeA00sTg4p l7KAjW1GgYFdrWGazrTgxDGC3qsC2rG89dVlC8R2+JonPHcXeczAxJW0/DIdUbx2XbVD gWBA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:organization:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=LrULhJpwesFMMWRbFaCr3GwnPqLYHe4+h8Y35yDPsLA=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=hHtdO0Q8NFPDbxqRapjU0yp6RsJsSfEOpAuptRWQ0j/bHZFQSwPtRmz9E+WoWcavEe sfWQF+Qkpv84xJ6+gbouTmwcWlCaCMSJe6C6J2V0n83jRRU5bPfsDCKxzWp9Wnc3uZAS E2V5g13IJUOLeZxAjUB//7UtfzJdcVOy15p4bx1BKlipIb7C7J0XDJFDY+IRNqAe2aX5 GDLwYyTCVurTuTT/8u7RDpfXLAx6jnOU6+d1s56JCinl3i5fdILXl3IYkEjioCcSEAGu CwtjD7vkp7ucsygYlzZ+lYtpze0vfpax8PaprmeFKaoRJhABCiWufKFORFnaynpq871s vnLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xoi9LcuX; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-7536-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628866864si9661940a91.21.2024.05.12.05.25.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 05:25:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7536-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Xoi9LcuX; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-wireless+bounces-7536-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7536-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 491DC2813C3 for ; Sun, 12 May 2024 12:25:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA08122083; Sun, 12 May 2024 12:25:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Xoi9LcuX" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0873120DE8 for ; Sun, 12 May 2024 12:25:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715516718; cv=none; b=tdqcM4yhMGbwWugah7OcokvVBpBlxBKzaamxV4bpcoZ+J8vwi/TZw0fy8ZdFS7NLQQHucSRSrpVd5iXcXPuZ7n48GuIMh4rQP0tgQKysANJ8ug1+nyEom/PWAam15YN6CdERBxlSoEI+vADJtYbTwhR1BRIG483K4p0/c2ZZJQA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715516718; c=relaxed/simple; bh=NCJc1QXqV4XxV4LftBn7cveGvSnfZlPOy4bMToKQgVM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=M1s/eIxg38QtYg9opu7WEB+dDQIBWNFAU6ZvKm8nUKvnP9U9xIosqgHcL254Vx0Dznt7xcqjjHVvSZSvqNg2Y03x0tWxXVjGdqRGpOPpmS448BEcuQV7EQS9IOCJoQI/yfc7P9VhbFcfx7ug4frbl9uROVqtSm1Jbf7I/rneWnY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Xoi9LcuX; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1715516717; x=1747052717; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NCJc1QXqV4XxV4LftBn7cveGvSnfZlPOy4bMToKQgVM=; b=Xoi9LcuXK14x/mPzSNvl+RAt8t2aVPTvq5I4osEbC5+oV5UrF0J1y+ki iA7TKZpqsKz6J8FvqjyCy+Pnu5xZqY//c0Z/X45WHfd9k1ihWqUcUSFvd z+4vLq3+FX2BHqrbGhwAhfkoiaAIv4BdsIwsuENAu3XCm8aST4XRFSfPm 1Li7gJSSJBCzy/6VMVJkPTht4cONi9tjzzAc8iyc5WQgcU75U5exZg2hf 0tVWPF87b+g3oHdnzjOyOTTp2F99FBCt8UdwrKGC6rCnFAOnLe8a7hsJC OE+GcTNbV/QCwYt1F+mTMNHaoYIIZ5unNhfihjUzOg3EsxtViNdQrLrut Q==; X-CSE-ConnectionGUID: qatO8WlDQiigscQrkv86yg== X-CSE-MsgGUID: mc7G/GPpToW8TDT5o4wEdA== X-IronPort-AV: E=McAfee;i="6600,9927,11071"; a="11397180" X-IronPort-AV: E=Sophos;i="6.08,155,1712646000"; d="scan'208";a="11397180" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2024 05:25:16 -0700 X-CSE-ConnectionGUID: C67fVZ1MQ/ii3aBK/bXTfw== X-CSE-MsgGUID: YtLnZevcTQe3DOMYIFyPNQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,155,1712646000"; d="scan'208";a="34761293" Received: from weis0040.iil.intel.com ([10.12.217.108]) by ORVIESA003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 May 2024 05:25:15 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 01/14] wifi: iwlwifi: mvm: handle BA session teardown in RF-kill Date: Sun, 12 May 2024 15:24:54 +0300 Message-Id: <20240512152312.fa0b2c99ec20.I43c5877f3b546159b2db4f36d6d956b333c41cf0@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240512122507.3812527-1-miriam.rachel.korenblit@intel.com> References: <20240512122507.3812527-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited Content-Transfer-Encoding: 8bit From: Johannes Berg 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 Signed-off-by: Miri Korenblit --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c | 3 ++- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 12 ++++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 628b50ee0244..de9f0b446545 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -6385,7 +6385,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; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c index d20aa639eea5..0e88629f695a 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -1014,7 +1014,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; diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c index 20d4968d692a..cc79fe991c26 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -2848,7 +2848,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)); @@ -2860,7 +2865,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 { @@ -2869,8 +2874,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; -- 2.34.1