From patchwork Thu Oct 10 11:05:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 13829954 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 4E4FD1C32FE for ; Thu, 10 Oct 2024 11:05:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558330; cv=none; b=sygUNViQqSBBzsC3ztS03ZG/XGJD7CPUDn6Zzly4CMNlSFuFa/T0sk695NHKP+96GhaOXNBHRrqMoKm0WBXQd4WTWs3UHJ/RfffFZbdmdueWutUbjOIG/zGTGzvnND80Qt0M8PlX6P7pYs3n09um4wa0Jz0dt2XNW+hMUvSjPlo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728558330; c=relaxed/simple; bh=j3LMXfx1i2LgR5ltVQ8hBW6+psbXDTuE60/dfP+o9CI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZeMXh2+IPecp+WiRET2C40321jbekID6eJzQdV7hD4ET9ACa9gAHu4tJk58udGV2QL/wzUQqrxhJWW3aade+0CF3KTtw0JxkjJHR92WdTQPbikhJrvn7rQMEL6zfbbzfYkRBqidaDMTHv2Ae3kwGM2hUtSvcxUHVfFJAm2c1DNk= 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=fPt1trjn; arc=none smtp.client-ip=198.175.65.14 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fPt1trjn" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1728558329; x=1760094329; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=j3LMXfx1i2LgR5ltVQ8hBW6+psbXDTuE60/dfP+o9CI=; b=fPt1trjniqLLxDcZd4qlLGXNOH446cyA9AWTNsQEoME1HZQZC+v2Elpc sJsiIbHcz0stWz01CAitxrF+/vEF6rWcOqUp3ewVO863qpjGvsFm1Kp1O OYTvNH1LiUAEfDItXrFe7bLybPveeTQOt76Idjue/bSfZbcEe6NA5G41b EyQEAi7bZrMcNR0dzzmwV2UyIV5rWO7KD8ruoVsnyk5U01KOZHoHxxVHw AZQADyUE9dkICcG6WmrprBJtbQI/q/0IRiYVRtLULzOxm8pvHdTxY8CoF hFcBcWR4GUwjP46xmRz8ffjp7Yavpo4TsCsmbPIyPnT8YilTYXyaBGzmQ A==; X-CSE-ConnectionGUID: mOgaLg4QQrqGOFJxbli+zw== X-CSE-MsgGUID: 7De9WOb5T+OuJD67gxiogQ== X-IronPort-AV: E=McAfee;i="6700,10204,11220"; a="31697740" X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="31697740" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:29 -0700 X-CSE-ConnectionGUID: Dz4C3l1ES3G8r9ssjz7VwA== X-CSE-MsgGUID: 3uJEuBpjS8ikXrtd630eUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.11,192,1725346800"; d="scan'208";a="81362326" Received: from weis0040.iil.intel.com ([10.12.217.108]) by orviesa005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Oct 2024 04:05:28 -0700 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Daniel Gabay Subject: [PATCH 5/9] wifi: iwlwifi: mvm: Use the sync timepoint API in suspend Date: Thu, 10 Oct 2024 14:05:03 +0300 Message-Id: <20241010140328.9aae318cd593.I4b322009f39489c0b1d8893495c887870f73ed9c@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241010110507.1006209-1-miriam.rachel.korenblit@intel.com> References: <20241010110507.1006209-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 From: Daniel Gabay 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 --- 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 d8b083be5b6b..de87e0e3e072 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/init.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/init.c @@ -39,10 +39,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 99a541d442bb..f4f87edb86e5 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c @@ -1398,7 +1398,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); }