From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7B1591EB229; Tue, 3 Sep 2024 20:48:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396518; cv=none; b=ZlcC2B0CTyJUS+f2or5lGj2HA8C4KOFISuVj9BH1iFpYa0VbwpeSDMkgx9B2+NS6cpvMcqr54VkBJ+5T353o1BNTHThSfG5fEn7p+o3l5nCw3kKa6hKNUo7paphas8M9fcxlsibfuG/OViPxbOBEiRoDlfLKxHweJSraxhiy+Q8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725396518; c=relaxed/simple; bh=SjUQEhA6/B1Yfuyb5mPVH3QvnXks9L1Adxm1/+AZ2e4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ErZTOJWwUcREVF95Zzs5nRamXMlwOnglX5rGID61gG7tO9LAUj9ptExlqjXj4maHOcykhTSfTeZR5Zl7BunDQvXkFEC6HF/+95IgHply+Lu7P+Zbn3G4Of9reiNllqo1Y5VtLeblvuyKkmbWS2dOrZV4TAd+p4829+9Xv9FIVUA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Og8MuGvH; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Og8MuGvH" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C2074C4CEC8; Tue, 3 Sep 2024 20:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1725396518; bh=SjUQEhA6/B1Yfuyb5mPVH3QvnXks9L1Adxm1/+AZ2e4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Og8MuGvHGqaM1nrefheQltDl+4/MFbH/ucwReZzoPLqe6w6E0YBud66in6H9NVqE7 r4ZDPQroELNttSVCHWdWcnAI/HLfUphXtA4E+u9AkEtAYbSeQIBkB2NVfhCFOOe3vv PsxcNQjI+ei0LzLsmLhjBEhUQWk41nckH+no/jqquQhNboJTHxEETKcpqM3xwTHhqW nxSRnJDvGsM/wrXQRXFHwxOowYU33LiI8ZDWTJYBEPYbnDu9roXWNZeRmhQ2lngh8v FfgzuHHIBzWQt0N21XdKfihYA/btU9pCZVadPC0Lau3d5kbFEineVXT2phOcvi52F8 /QXgcM/dAj6OA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Emmanuel Grumbach , Miri Korenblit , Johannes Berg , Sasha Levin , kvalo@kernel.org, gregory.greenman@intel.com, ilan.peer@intel.com, shaul.triebitz@intel.com, benjamin.berg@intel.com, linux-wireless@vger.kernel.org Subject: [PATCH AUTOSEL 5.4 8/8] wifi: iwlwifi: mvm: don't wait for tx queues if firmware is dead Date: Tue, 3 Sep 2024 15:28:44 -0400 Message-ID: <20240903192859.1108979-8-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240903192859.1108979-1-sashal@kernel.org> References: <20240903192859.1108979-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.282 Content-Transfer-Encoding: 8bit From: Emmanuel Grumbach [ Upstream commit 3a84454f5204718ca5b4ad2c1f0bf2031e2403d1 ] There is a WARNING in iwl_trans_wait_tx_queues_empty() (that was recently converted from just a message), that can be hit if we wait for TX queues to become empty after firmware died. Clearly, we can't expect anything from the firmware after it's declared dead. Don't call iwl_trans_wait_tx_queues_empty() in this case. While it could be a good idea to stop the flow earlier, the flush functions do some maintenance work that is not related to the firmware, so keep that part of the code running even when the firmware is not running. Signed-off-by: Emmanuel Grumbach Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20240825191257.a7cbd794cee9.I44a739fbd4ffcc46b83844dd1c7b2eb0c7b270f6@changeid [edit commit message] Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c index 3c523774ef0e6..c8c884bb5090e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -4666,6 +4666,10 @@ static void iwl_mvm_flush_no_vif(struct iwl_mvm *mvm, u32 queues, bool drop) int i; if (!iwl_mvm_has_new_tx_api(mvm)) { + /* we can't ask the firmware anything if it is dead */ + if (test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, + &mvm->status)) + return; if (drop) { mutex_lock(&mvm->mutex); iwl_mvm_flush_tx_path(mvm, @@ -4747,8 +4751,11 @@ static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, /* this can take a while, and we may need/want other operations * to succeed while doing this, so do it without the mutex held + * If the firmware is dead, this can't work... */ - if (!drop && !iwl_mvm_has_new_tx_api(mvm)) + if (!drop && !iwl_mvm_has_new_tx_api(mvm) && + !test_bit(IWL_MVM_STATUS_HW_RESTART_REQUESTED, + &mvm->status)) iwl_trans_wait_tx_queues_empty(mvm->trans, msk); } -- 2.43.0