]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: atlantic: preserve PCI wake-from-D3 on shutdown when WOL enabled
authorZoran Ilievski <goodboy@rexbytes.com>
Mon, 11 May 2026 06:40:02 +0000 (08:40 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 12 May 2026 23:41:41 +0000 (16:41 -0700)
The shutdown handler aq_pci_shutdown() unconditionally calls
pci_wake_from_d3(pdev, false), clearing the PCI PME_En bit even when
wake-on-LAN has been configured. While aq_nic_shutdown() correctly
programs the NIC firmware via aq_nic_set_power() to listen for magic
packets, the PCI subsystem will not propagate the resulting PME wake
event from D3, so the system never wakes after poweroff.

WOL from suspend (S3) is unaffected because aq_suspend_common() does
not touch pci_wake_from_d3() and relies on the PM core's wake
configuration via device_may_wakeup().

This affects all atlantic-supported NICs (AQC107/108/111/112/113);
users have reported that WOL works if the atlantic driver is never
loaded, but breaks once it has run its shutdown path.

Pass the configured WOL state to pci_wake_from_d3() instead of a
literal false, so the PCI PME_En bit is preserved when the user has
armed WOL via ethtool.

Fixes: 90869ddfefeb ("net: aquantia: Implement pci shutdown callback")
Cc: stable@vger.kernel.org
Signed-off-by: Zoran Ilievski <goodboy@rexbytes.com>
Reviewed-by: Sukhdeep Singh <sukhdeeps@marvell.com>
Link: https://patch.msgid.link/20260511064002.1857-1-goodboy@rexbytes.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/aquantia/atlantic/aq_pci_func.c

index e9e38af680c34a6042f56c936f491d14876d3c47..39e1b606a75a9dd2749b9d3e57f533f1574334b4 100644 (file)
@@ -371,7 +371,7 @@ static void aq_pci_shutdown(struct pci_dev *pdev)
        pci_disable_device(pdev);
 
        if (system_state == SYSTEM_POWER_OFF) {
-               pci_wake_from_d3(pdev, false);
+               pci_wake_from_d3(pdev, self->aq_hw->aq_nic_cfg->wol);
                pci_set_power_state(pdev, PCI_D3hot);
        }
 }