Skip to contentSkip to conversation

FAILED: patch "[PATCH] e1000e: Do not wake up the system via WOL if device wakeup is" failed to apply to 4.9-stable tree

PATCH [email protected] 3 participants 3 messages Jun 23, 2020 – Jun 24, 2020

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 6bf6be1127f7e6d4bf39f84d56854e944d045d74 Mon Sep 17 00:00:00 2001
From: Chen Yu <[email protected]>
Date: Fri, 22 May 2020 01:59:00 +0800
Subject: [PATCH] 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 bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver")
drivers/net/ethernet/intel/e1000e/netdev.c +10 -4
index a279f4fa9962..e2ad3f38c75c 100644
@@ -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.
 			 */
maintainer
#1 lore raw
Quoted 29 lines · On Tue, Jun 23, 2020 at 01:58:29PM +0200, [email protected] wrote:

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 6bf6be1127f7e6d4bf39f84d56854e944d045d74 Mon Sep 17 00:00:00 2001
From: Chen Yu <[email protected]>
Date: Fri, 22 May 2020 01:59:00 +0800
Subject: [PATCH] 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.

Quoted 7 lines
Fixes bc7f75fa9788 ("[E1000E]: New pci-express e1000 driver")

Conflict was because we don't have c8744f44aeae ("e1000e: Add Support for CannonLake") on 4.9 and 4.4. I've worked around that and queued this patch for both of those branches.

Signature · 2 lines
Thanks,
Sasha
#2 lore raw
Quoted 9 lines · Sasha Levin
Quoted 8 lines · On Tue, Jun 23, 2020 at 01:58:29PM +0200, [email protected] wrote:

The patch below does not apply to the 4.9-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

thanks,

Quoted 9 lines
Quoted 4 lines

greg k-h

------------------ original commit in Linus's tree ------------------

Conflict was because we don't have c8744f44aeae ("e1000e: Add Support for CannonLake") on 4.9 and 4.4. I've worked around that and queued this patch for both of those branches.

Thanks for pointing this out, Sasha.

Best,
Chenyu

Quoted 3 lines
Signature · 2 lines
Thanks,
Sasha