Return-Path: Received: from mail-bn3nam01on0134.outbound.protection.outlook.com ([104.47.33.134]:39072 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934916AbeCSQET (ORCPT ); Mon, 19 Mar 2018 12:04:19 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Luca Coelho , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 206/281] iwlwifi: pcie: only use d0i3 in suspend/resume if system_pm is set to d0i3 Date: Mon, 19 Mar 2018 16:01:57 +0000 Message-ID: <20180319155742.13731-206-alexander.levin@microsoft.com> References: <20180319155742.13731-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155742.13731-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Luca Coelho [ Upstream commit e4c49c4937951de1cdbe35572ade40c948dec1e1 ] We only need to handle d0i3 entry and exit during suspend resume if system_pm is set to IWL_PLAT_PM_MODE_D0I3, otherwise d0i3 entry failures will cause suspend to fail. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=3D194791 Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/= wireless/intel/iwlwifi/pcie/trans.c index 10ef44e8ecd5..fe32de252e6b 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -2824,7 +2824,8 @@ static struct iwl_trans_dump_data #ifdef CONFIG_PM_SLEEP static int iwl_trans_pcie_suspend(struct iwl_trans *trans) { - if (trans->runtime_pm_mode =3D=3D IWL_PLAT_PM_MODE_D0I3) + if (trans->runtime_pm_mode =3D=3D IWL_PLAT_PM_MODE_D0I3 && + (trans->system_pm_mode =3D=3D IWL_PLAT_PM_MODE_D0I3)) return iwl_pci_fw_enter_d0i3(trans); =20 return 0; @@ -2832,7 +2833,8 @@ static int iwl_trans_pcie_suspend(struct iwl_trans *t= rans) =20 static void iwl_trans_pcie_resume(struct iwl_trans *trans) { - if (trans->runtime_pm_mode =3D=3D IWL_PLAT_PM_MODE_D0I3) + if (trans->runtime_pm_mode =3D=3D IWL_PLAT_PM_MODE_D0I3 && + (trans->system_pm_mode =3D=3D IWL_PLAT_PM_MODE_D0I3)) iwl_pci_fw_exit_d0i3(trans); } #endif /* CONFIG_PM_SLEEP */ --=20 2.14.1