Skip to content

Commit 6bf6be1

Browse files
yu-chen-surfJeff Kirsher
authored andcommitted
e1000e: Do not wake up the system via WOL if device wakeup is disabled
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: bc7f75f ("[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>
1 parent b8ad540 commit 6bf6be1

File tree

1 file changed

+10
-4
lines changed
  • drivers/net/ethernet/intel/e1000e

1 file changed

+10
-4
lines changed

drivers/net/ethernet/intel/e1000e/netdev.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6611,11 +6611,17 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
66116611
struct net_device *netdev = pci_get_drvdata(pdev);
66126612
struct e1000_adapter *adapter = netdev_priv(netdev);
66136613
struct e1000_hw *hw = &adapter->hw;
6614-
u32 ctrl, ctrl_ext, rctl, status;
6615-
/* Runtime suspend should only enable wakeup for link changes */
6616-
u32 wufc = runtime ? E1000_WUFC_LNKC : adapter->wol;
6614+
u32 ctrl, ctrl_ext, rctl, status, wufc;
66176615
int retval = 0;
66186616

6617+
/* Runtime suspend should only enable wakeup for link changes */
6618+
if (runtime)
6619+
wufc = E1000_WUFC_LNKC;
6620+
else if (device_may_wakeup(&pdev->dev))
6621+
wufc = adapter->wol;
6622+
else
6623+
wufc = 0;
6624+
66196625
status = er32(STATUS);
66206626
if (status & E1000_STATUS_LU)
66216627
wufc &= ~E1000_WUFC_LNKC;
@@ -6672,7 +6678,7 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool runtime)
66726678
if (adapter->hw.phy.type == e1000_phy_igp_3) {
66736679
e1000e_igp3_phy_powerdown_workaround_ich8lan(&adapter->hw);
66746680
} else if (hw->mac.type >= e1000_pch_lpt) {
6675-
if (!(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
6681+
if (wufc && !(wufc & (E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_BC)))
66766682
/* ULP does not support wake from unicast, multicast
66776683
* or broadcast.
66786684
*/

0 commit comments

Comments
 (0)