* [net 1/3] e1000e: Do not wake up the system via WOL if device wakeup is disabled
[not found] <20200616225354.2744572-1-jeffrey.t.kirsher@intel.com>
@ 2020-06-16 22:53 ` Jeff Kirsher
2020-06-18 13:18 ` Sasha Levin
0 siblings, 1 reply; 2+ messages in thread
From: Jeff Kirsher @ 2020-06-16 22:53 UTC (permalink / raw)
To: davem
Cc: Chen Yu, netdev, nhorman, sassmann, Rafael J. Wysocki,
Andy Shevchenko, Stable, Aaron Brown, Jeff Kirsher
From: Chen Yu <yu.c.chen@intel.com>
Currently the system will be woken up via WOL(Wake On LAN) even if the
device wakeup ability has been disabled via sysfs:
cat /sys/devices/pci0000:00/0000:00:1f.6/power/wakeup
disabled
The system should not be woken up if the user has explicitly
disabled the wake up ability for this device.
This patch clears the WOL ability of this network device if the
user has disabled the wake up ability in sysfs.
Fixes: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver")
Reported-by: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Chen Yu <yu.c.chen@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
drivers/net/ethernet/intel/e1000e/netdev.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index a279f4fa9962..e2ad3f38c75c 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -6611,11 +6611,17 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
- u32 ctrl, ctrl_ext, rctl, status;
- /* Runtime suspend should only enable wakeup for link changes */
- u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
+ u32 ctrl, ctrl_ext, rctl, status, wufc;
int retval = 0;
+ /* Runtime suspend should only enable wakeup for link changes */
+ if (runtime)
+ wufc = E1000_WUFC_LNKC;
+ else if (device_may_wakeup(&pdev->dev))
+ wufc = adapter->wol;
+ else
+ wufc = 0;
+
status = er32(STATUS);
if (status & E1000_STATUS_LU)
wufc &= ~E1000_WUFC_LNKC;
@@ -6672,7 +6678,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
if (adapter->hw.phy.type == e1000_phy_igp_3) {
e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
} else if (hw->mac.type >= e1000_pch_lpt) {
- if (!(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
+ if (wufc && !(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
/* ULP does not support wake from unicast, multicast
* or broadcast.
*/
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [net 1/3] e1000e: Do not wake up the system via WOL if device wakeup is disabled
2020-06-16 22:53 ` [net 1/3] e1000e: Do not wake up the system via WOL if device wakeup is disabled Jeff Kirsher
@ 2020-06-18 13:18 ` Sasha Levin
0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-06-18 13:18 UTC (permalink / raw)
To: Sasha Levin, Jeff Kirsher, Chen Yu, davem; +Cc: Chen Yu, netdev, Stable, stable
Hi
[This is an automated email]
This commit has been processed because it contains a "Fixes:" tag
fixing commit: bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver (currently for ICH9 devices only)").
The bot has tested the following trees: v5.7.2, v5.4.46, v4.19.128, v4.14.184, v4.9.227, v4.4.227.
v5.7.2: Build OK!
v5.4.46: Build OK!
v4.19.128: Build OK!
v4.14.184: Build OK!
v4.9.227: Failed to apply! Possible dependencies:
c8744f44aeaee ("e1000e: Add Support for CannonLake")
v4.4.227: Failed to apply! Possible dependencies:
16ecba59bc333 ("e1000e: Do not read ICR in Other interrupt")
18dd239207038 ("e1000e: use BIT() macro for bit defines")
74f31299a41e7 ("e1000e: Increase PHY PLL clock gate timing")
c8744f44aeaee ("e1000e: Add Support for CannonLake")
f3ed935de059b ("e1000e: initial support for i219-LM (3)")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
--
Thanks
Sasha
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-18 13:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20200616225354.2744572-1-jeffrey.t.kirsher@intel.com>
2020-06-16 22:53 ` [net 1/3] e1000e: Do not wake up the system via WOL if device wakeup is disabled Jeff Kirsher
2020-06-18 13:18 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).