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 09F801DE895; Mon, 4 Nov 2024 10:54:31 +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=1730717671; cv=none; b=OHnip0zHfUhvBjqBINpTtd2v4ApSQIyOhZD77RRCmyJ5O61Y59S3gq1UviKwGjULP+g3Lzfv0un52HclN78UUU2aCvWRAQA93/crJMSfKy43mD1UDyacAxXEv99j6jkc/nu19MW/v4kKV+CyjkP99C6FxI+v2lmWEqCHW581aaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730717671; c=relaxed/simple; bh=R8neRxYf06YyIZRmB8pI9pkEix/MjhPkTSVTAKKZID0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=dXBDJ/pEX3ivLvg9Vs6TKdx5FYISxDMAP+t0GnQirVadn9RqKklYuuwhFv+Qh7V4pcGBjnDfgT5dLIkjeIxxI8Wv7j/IyOHLOxAH+E5H69msfYaxwx1mB/UXjizpehzOi74gaCH/cLoG4qxwhhuMn3hCW3u3uTs4//3PFgVfvAQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=u3kga5ZO; 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="u3kga5ZO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E1ADC4CECE; Mon, 4 Nov 2024 10:54:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730717670; bh=R8neRxYf06YyIZRmB8pI9pkEix/MjhPkTSVTAKKZID0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u3kga5ZOIx2QHL57/RTNgXEQI5XEhBiKP4zrPBlXqPb+gbb49GcGhqIyNmAevGqnr 4YcijdbblmsWnmbm5Atd9iyOZ0K6U7oz5pbk7vU3zfLiIinuBSURX+UtTKByE1MBqM 4U4cGtKQ6710tHXgMMAD25wP6+sWjrKcg0mRdFyXtsXcXpkoBZ/ZGGs2F49Ccf7HcG ZFNBTma+D63dq4vTU9XUVqzwUmpBeZK1ZiG3xjspoTPdpTBvcD8e3+ZUDmhpayEwD2 KhgOKtNClY8Qw8x48yMkWxv5/yBCB+cYibdGfKTxUcmImL48d6wqtJs/wurnNbo/2g sm/AJkgKayfUQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Daniel Gabay , Miri Korenblit , Johannes Berg , Sasha Levin , kvalo@kernel.org, shaul.triebitz@intel.com, gregory.greenman@intel.com, yedidya.ben.shimol@intel.com, emmanuel.grumbach@intel.com, benjamin.berg@intel.com, linux-wireless@vger.kernel.org Subject: [PATCH AUTOSEL 5.15 04/10] wifi: iwlwifi: mvm: Use the sync timepoint API in suspend Date: Mon, 4 Nov 2024 05:53:53 -0500 Message-ID: <20241104105414.97666-4-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241104105414.97666-1-sashal@kernel.org> References: <20241104105414.97666-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@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.15.170 Content-Transfer-Encoding: 8bit From: Daniel Gabay [ Upstream commit 9715246ca0bfc9feaec1b4ff5b3d38de65a7025d ] When starting the suspend flow, HOST_D3_START triggers an _async_ firmware dump collection for debugging purposes. The async worker may race with suspend flow and fail to get NIC access, resulting in the following warning: "Timeout waiting for hardware access (CSR_GP_CNTRL 0xffffffff)" Fix this by switching to the sync version to ensure the dump completes before proceeding with the suspend flow, avoiding potential race issues. Signed-off-by: Daniel Gabay Signed-off-by: Miri Korenblit Link: https://patch.msgid.link/20241010140328.9aae318cd593.I4b322009f39489c0b1d8893495c887870f73ed9c@changeid Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/fw/init.c | 4 +++- drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/fw/init.c b/drivers/net/wireless/intel/iwlwifi/fw/init.c index 2ecec00db9da7..263560f259778 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/init.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c @@ -35,10 +35,12 @@ void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans, } IWL_EXPORT_SYMBOL(iwl_fw_runtime_init); +/* Assumes the appropriate lock is held by the caller */ void iwl_fw_runtime_suspend(struct iwl_fw_runtime *fwrt) { iwl_fw_suspend_timestamp(fwrt); - iwl_dbg_tlv_time_point(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, NULL); + iwl_dbg_tlv_time_point_sync(fwrt, IWL_FW_INI_TIME_POINT_HOST_D3_START, + NULL); } IWL_EXPORT_SYMBOL(iwl_fw_runtime_suspend); diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c index 24c1666b2c88a..80b6e646abe18 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -1380,7 +1380,9 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan) iwl_mvm_pause_tcm(mvm, true); + mutex_lock(&mvm->mutex); iwl_fw_runtime_suspend(&mvm->fwrt); + mutex_unlock(&mvm->mutex); return __iwl_mvm_suspend(hw, wowlan, false); } -- 2.43.0