Bug 194791
Summary: | iwlwifi: 7260: WoWLAN prevents suspend if CONFIG_IWLWIFI_PCIE_RTPM=y - WIFILNX-697 | ||
---|---|---|---|
Product: | Drivers | Reporter: | Oliver Freyermuth (o.freyermuth) |
Component: | network-wireless | Assignee: | DO NOT USE - assign "network-wireless-intel" component instead (linuxwifi) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | luca, o.freyermuth |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.10.1 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Oliver Freyermuth
2017-03-05 14:57:11 UTC
As we mentioned in bug 172411, this feature requires some integration with the platform to work correctly. We have recently added "EXPERT" to the config dependency and improved the help to reflect that. This is the commit where this was changed (merged in 4.11-rc1): commit 6eac0e817aee2518a96b5ce9d02b904e0667f370 Author: Emmanuel Grumbach <emmanuel.grumbach@intel.com> AuthorDate: Sat Jan 7 23:03:40 2017 +0200 Commit: Luca Coelho <luciano.coelho@intel.com> CommitDate: Wed Feb 8 17:54:20 2017 +0200 iwlwifi: make RTPM depend on EXPERT Enabling the RTPM Kconfig option can be fairly risky. Runtime PM must be validated against a specific platform before it can be safely enabled. Hence, it makes no sense for distros and other big OS vendors to enable it since they ship code to various systems and unknown platform. Make sure that this is hinted properly by making the IWLWIFI_PCIE_RTPM Kconfig option depend on EXPERT. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=172411 Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> I'll change this since we already have a "fix". Okay, reopening it since this is not the same as before. You're not even using RTPM and it is preventing suspend. We'll try to fix it properly. :) No wait - it only fails if I set CONFIG_IWLWIFI_PCIE_RTPM=y , but suspending works just fine if I set CONFIG_IWLWIFI_PCIE_RTPM=n. So indeed "hiding" the option would "fix" the issue. Note, however, that on the two platforms I tested on this was the only issue I ever encountered after enabling RTPM in the kernel, apart from that, wifi was working very fine. Yes, you're right, but suspend should work when PCIE_RTPM=y, especially if we are *not* entering runtime suspend. :) I believe I found out the reason for this problem. Since RTPM is not configured properly in the platform side, we keep an RTPM reference to prevent it from entering runtime suspend. The interaction between RTPM suspend and system suspend is messy and, in this case, we are preventing suspend because we couldn't properly enter D0i3 mode. This should only be the case if WoWLAN "any" was set, so we also need to check the system_pm_mode. Could you try this fix and check whether it works for you? diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c index 7f05fc56587a..d73c7a58db1d 100644 --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c @@ -2877,7 +2877,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 == IWL_PLAT_PM_MODE_D0I3) + if ((trans->runtime_pm_mode == IWL_PLAT_PM_MODE_D0I3) && + (trans->system_pm_mode == IWL_PLAT_PM_MODE_D0I3)) return iwl_pci_fw_enter_d0i3(trans); return 0; Thanks! Understood :-). The test was successful: I can confirm that, applying your patch, I can now enter suspend just fine with WoWLAN active (tried magic packet and tcp modes) even if CONFIG_IWLWIFI_PCIE_RTPM=y is set. I tested with 4.10.1. Thanks a lot and cheers! Oliver Great! Thank you very much for reporting and testing. I'll push this patch via the normal route. |