Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1949555lqo; Mon, 13 May 2024 03:35:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV0qFN+f+V9zfZ0jxVbGLuP1rcbPQiob+u9R0n3TnBfiq3mHn+zGJQdv1qatLbGuP5f3phptOXOoEszk84+NsWPZE96HkfGCYhsJOUHBA== X-Google-Smtp-Source: AGHT+IFlZ9CNk7KK+MhYxb7tj8CaMe8rhKT5I5m017q1sCtKJTeyxjv5j6XySbGpzwFB1KQh7124 X-Received: by 2002:a17:90a:6542:b0:2b3:be55:bf6f with SMTP id 98e67ed59e1d1-2b6cc76bdf6mr7992523a91.22.1715596548776; Mon, 13 May 2024 03:35:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715596548; cv=pass; d=google.com; s=arc-20160816; b=bR801angFoDgVKj+hPhuVwY3o+wLQ/fMvhbd5/U0PTtZqGwccn1yuPj36JqERcGUK+ e7F6KPiPLVDmn1ns5jR98KPRBj22pElXyY7Ru3UmeZu61O6mt+duaLzGVOViS7H8J7Rm MQ4bwwfN/JKk/C5ZFku36iyBXM44AH7VnD0iv+rxizcFybhVA2bqZVwHF3Lg8EfBHWhJ piW12OGcMwE/6aE71M76aE7dSGEB6wwED94zq8dC9NoKagmLI1HqYIqQJWkMuys2rfBi I8I7le9dYCqKIwgk0Q3LficTQ/2i7aJLkxStAcVe5a3u/GOUxqsxyGL6TLuHSsbPZm0b p0+A== 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=9rezLr5cewW8bt/KeIgRLlRiZDHQ40lQZXeYiNQqbOo=; fh=TquNsOiV+zNY1csTpltVB6A9QFW5SbuNs6JlqcKCQkw=; b=X2bhQmsJ7AqpzeCT9FR/5h+0nFOl/eji/htR5s3ghRf7bQ4Km0Z7oEHep/khTzETun l2EFg9wcwY6eGWdTSykKBLNZLuv+CXARbbJwYFpH4FKtbE4EIkOGMkklzBIngM31ujYn pdZc+aRMJAtehi2UOa0OebGux6lVuEJ77g2C/kXryr2hf0jRcjLM4bZN+Xp4F4MC8RHA E7QKLfaxVLk+uY8RRUwF1wMGZedC2ItdKAneL+xBt6YvFakvCKLEvl29NNSNymeyhWXC ECG6fuEjzKxgLuGd1hOoUxWG7tMmZBEUnJQvFKwZKBDFdZez2ylIw8BspmZP5lLNLYvT csHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hZdnAe89; 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-7584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7584-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b628fb9adbsi11147491a91.141.2024.05.13.03.35.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 03:35:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-7584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=hZdnAe89; 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-7584-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-wireless+bounces-7584-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CD684B22184 for ; Mon, 13 May 2024 10:27:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED47714A623; Mon, 13 May 2024 10:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="hZdnAe89" X-Original-To: linux-wireless@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 55CA714A4E2 for ; Mon, 13 May 2024 10:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715596046; cv=none; b=SFGJB/0tZeCxcO1lq5Z4w0Js1MVVu+4d6JuD1TVDUMI/JXp2TDFEh15QUYyLCRQHXdCFhf8ZxlfmRmyv8oNCWsVA99Uo1jeuJbYPF3eJhojM05rCxtJRpDbgX9qf1q+N4xhny6yxSXuw1iXeD9JKzJyEJqvnmeezyVMh6az0CkE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715596046; c=relaxed/simple; bh=vON7C3yzzNYKstMeK9jY6q/ClYPhuR0C9p5D2HAr03I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Sd6DOU03LkcHrsm8HF0vLyz+xmkt6lb43c8zOiAbq2NBjBYW8bHr5YnxnCkA1Da9VMr1odm61nkCU/6xswcPZ+SDxaWOHfR16xZkIxk9GN1pj4HIPd35T+HuNSL+dSNDZYNc5chJaFxyQo5nz4C1RN/MxD3dt6zFO+B6Jq77VXE= 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=hZdnAe89; arc=none smtp.client-ip=198.175.65.12 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=1715596046; x=1747132046; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=vON7C3yzzNYKstMeK9jY6q/ClYPhuR0C9p5D2HAr03I=; b=hZdnAe892out3sYjWGT+mzwwrLEAQlgnP0vKmEsv0KM+BNXzjq5ZWs2b Vm16MNN9Y3hfUUu7WRc35xXEhdxpXxAetsAMzoIabX5LaHHIgliPeLG6/ COxGt1XwwcIaN5WkbAr8j/gpP1QR0jnv7X1HCDVUWNN/G1nBrj5XigOPa LWCR4nAfgdm2NqonVnNKGm5gN9THaVgjTN6SdoAdx4ruW+2TSh1acbE3D 0ErxHoutUsgLu6QXwdCudGlVO6/1FIqcaD7LEPVSvMzUWH3iCdsKm5+P9 uiA0QCozOP/CfqYqA/oJJ4ckS9qnXYZ2t9xJCXdG+Pud0B8gAVzpi9MwU Q==; X-CSE-ConnectionGUID: /IUuYwinTyS/jqyjp1NGSA== X-CSE-MsgGUID: 7ny05GgnRIOwcgm8wkzsZw== X-IronPort-AV: E=McAfee;i="6600,9927,11071"; a="22928653" X-IronPort-AV: E=Sophos;i="6.08,158,1712646000"; d="scan'208";a="22928653" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2024 03:27:26 -0700 X-CSE-ConnectionGUID: Vv8AGKtjT8qzzMYZMLeipQ== X-CSE-MsgGUID: 8whYSqsURgacSJKhpyr0MQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,158,1712646000"; d="scan'208";a="53516406" Received: from weis0040.iil.intel.com ([10.12.217.108]) by fmviesa002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 May 2024 03:27:23 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Johannes Berg Subject: [PATCH 3/7] wifi: iwlwifi: mvm: handle BA session teardown in RF-kill Date: Mon, 13 May 2024 13:27:10 +0300 Message-Id: <20240513132416.0762cd80fb3d.I43c5877f3b546159b2db4f36d6d956b333c41cf0@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240513102714.469087-1-miriam.rachel.korenblit@intel.com> References: <20240513102714.469087-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 290670310ae8..70b769eb5861 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -6129,7 +6129,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 0fcbc400caef..b98256edb52e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-sta.c @@ -1009,7 +1009,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 491c449fd431..908d0bc474da 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c @@ -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; -- 2.34.1