* [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5
@ 2026-11-16 9:17 Magnus Leatti
2026-11-16 9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Magnus Leatti @ 2026-11-16 9:17 UTC (permalink / raw)
To: me, Maxime Chevallier, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Maxime Coquelin, Alexandre Torgue, Giuseppe Nespolino, netdev,
linux-stm32, linux-arm-kernel, linux-kernel
The YT6801 accepts "ethtool -s eth0 wol g" today and then ignores magic
packets once the system is powered off. This series makes S5
Wake-on-LAN work. Both patches touch only the glue.
Patch 1 adds a shutdown hook that stops the device. The glue has none,
so the MAC and DMA keep running into reboot and kexec.
Patch 2 arms the chip when powering off with Wake-on-LAN set. The
sequence follows the vendor driver, with two differences that come
from measurements on the test board:
- The function stays in D0 instead of D3hot. With MAC Wake-on-LAN
phylib keeps polling the PHY until power is removed, and in D3hot
that poll fails with -EBUSY and warns from phy_error_precise(). It
happened 111 ms after D3hot on a normal power-off.
- Bit 9 of LPW_CTRL is not set. The chip wakes without it.
Every write that is left was removed once to see what it does: without
OOB WoL or the packet wake bit there is no wake. Without the MAC
address rewrite, or without the 2 ms wait before it, the chip wakes on
the factory address only.
Tested on a Celeron N3350 mini PC, net-next at 6964ff21c5d8:
net-next wol g no wake, 3 of 3
patched wol g wake, 8 of 8
patched wol u wake on unicast, 1 of 1
patched wol d no wake, 3 of 3
patched wol g, interface down no wake, 1 of 1
patched wol g, power/wakeup disabled no wake, 1 of 1
patched wol g, reboot reboots, link back, 3 of 3
A second board, a PSJ8500-N97 mini PC (Intel N97), behaves the same.
This series does S5 only, on purpose. S5 wake is the important case
and it is not implemented. The change for it is small and stays in the
glue. Wake from suspend and hibernation has a larger blast radius.
Giuseppe, this is the OOB WoL enable you and Yao discussed in the
s2idle thread [1]: it is only enabled when powering off, because only
a chip reset disables it again. If you can try "wol g" and a power-off
on the Slimbook, a laptop would be a good third board.
[1] https://lore.kernel.org/netdev/apSDPwF49Z1Zd0kJ@pie/
Magnus Leatti (2):
net: stmmac: dwmac-motorcomm: quiesce the device at shutdown
net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5
.../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 84 +++++++++++++++++++
1 file changed, 84 insertions(+)
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
--
2.56.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown
2026-11-16 9:17 [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5 Magnus Leatti
@ 2026-11-16 9:17 ` Magnus Leatti
2026-11-16 14:33 ` Yao Zi
2026-11-16 9:17 ` [PATCH net-next 2/2] net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5 Magnus Leatti
2026-11-16 11:23 ` [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and " Giuseppe Nespolino
2 siblings, 1 reply; 7+ messages in thread
From: Magnus Leatti @ 2026-11-16 9:17 UTC (permalink / raw)
To: me, Maxime Chevallier, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Maxime Coquelin, Alexandre Torgue, Giuseppe Nespolino, netdev,
linux-stm32, linux-arm-kernel, linux-kernel
The driver has no .shutdown hook. At reboot, kexec and power-off the
MAC and the DMA engine are left running.
Add a shutdown hook that calls stmmac_suspend(). With Wake-on-LAN off
it detaches the netdev and stops the DMA, the MAC and the PHY. With
Wake-on-LAN set it stops the DMA, arms the PMT register and keeps the
receiver and the PHY up, as it does for suspend. That is not enough to
wake this chip from S5, so the system still does not wake.
stmmac_suspend() ends in stmmac_pci_plat_suspend(), which enables PME
if wakeup is enabled for the device. Disable it again, since nothing
arms the chip.
A failed resume leaves the netdev detached with NAPI disabled. Skip the
hook in that state: stmmac_suspend() must not run a second time.
Signed-off-by: Magnus Leatti <magnusleatti@kernelriot.com>
---
.../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
index 42f0b11a7b60..1e142ad39e33 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
@@ -204,6 +204,27 @@ static int motorcomm_resume(struct device *dev, void *bsp_priv)
return 0;
}
+static void motorcomm_shutdown(struct pci_dev *pdev)
+{
+ struct net_device *ndev = dev_get_drvdata(&pdev->dev);
+
+ /*
+ * A failed resume leaves the netdev detached with NAPI disabled, and
+ * stmmac_suspend() must not run on it a second time.
+ */
+ if (!netif_device_present(ndev))
+ return;
+
+ /* Stop the device before reboot, kexec or power-off */
+ stmmac_suspend(&pdev->dev);
+
+ /*
+ * stmmac_pci_plat_suspend() enables PME if wakeup is enabled for the
+ * device. Nothing arms the chip to wake the system, so undo that.
+ */
+ pci_wake_from_d3(pdev, false);
+}
+
static struct plat_stmmacenet_data *
motorcomm_default_plat_data(struct pci_dev *pdev)
{
@@ -374,6 +395,7 @@ static struct pci_driver dwmac_motorcomm_pci_driver = {
.id_table = dwmac_motorcomm_pci_id_table,
.probe = motorcomm_probe,
.remove = motorcomm_remove,
+ .shutdown = motorcomm_shutdown,
.driver = {
.pm = &stmmac_simple_pm_ops,
},
--
2.56.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH net-next 2/2] net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5
2026-11-16 9:17 [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5 Magnus Leatti
2026-11-16 9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
@ 2026-11-16 9:17 ` Magnus Leatti
2026-11-16 11:23 ` [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and " Giuseppe Nespolino
2 siblings, 0 replies; 7+ messages in thread
From: Magnus Leatti @ 2026-11-16 9:17 UTC (permalink / raw)
To: me, Maxime Chevallier, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Maxime Coquelin, Alexandre Torgue, Giuseppe Nespolino, netdev,
linux-stm32, linux-arm-kernel, linux-kernel
The driver reports "Supports Wake-on: ug" and accepts "wol g", but a
YT6801 in S5 ignores magic packets. At power-off stmmac_suspend() arms
the PMT register, but the chip's out-of-band WoL block stays disabled
as motorcomm_init() leaves it, the packet wake bit in WOL_CTRL is clear
and PME is turned off.
When powering off with Wake-on-LAN set, the interface up and wakeup
enabled for the device, keep PME enabled and arm the chip after
stmmac_suspend():
- Enable OOB WoL. Without it the chip does not wake.
- Write the MAC address in use to the first address filter again.
Enabling OOB WoL reloads the factory address there. Without the
rewrite the chip wakes on the factory address and ignores the one
in use. The rewrite follows a 2 ms wait, as in the vendor driver:
without the wait the reload lands after the rewrite.
- Set the packet wake enable bit in WOL_CTRL. Without it the chip
does not wake.
The sequence follows the vendor driver, with two differences. The
vendor also sets bit 9 of LPW_CTRL. The chip wakes without it, so it is
left alone. The vendor puts the function in D3hot. Here it stays in D0.
With MAC Wake-on-LAN phylink keeps the PHY running and phylib keeps
polling it until power is removed. In D3hot the MDIO registers read as
all-ones, the poll fails with -EBUSY and phylib warns from
phy_error_precise(). That warning was seen 111 ms after entering D3hot
on a normal power-off.
The PHY is left at the negotiated speed. Reboot and kexec are not
armed: OOB WoL can only be disabled again by a chip reset, so it is
enabled only when powering off, and the next probe resets the chip. If
the interface is down at power-off, the system does not wake.
Suspend is not changed. Hibernation that powers off through the
shutdown path arms the chip the same way. Neither was tested.
Tested on a Celeron N3350 mini PC, magic packets sent from another host
75 s after power-off:
net-next wol g no wake, 3 of 3
patched wol g wake, 8 of 8 (28-31 s to ping)
patched wol u wake on unicast, 1 of 1
patched wol d no wake, 3 of 3
patched wol g, interface down no wake, 1 of 1
patched wol g, power/wakeup disabled no wake, 1 of 1
patched wol g, reboot reboots, link back, 3 of 3
The kernel log of each of these shutdowns, read back after the next
boot, shows no warning from the shutdown path.
A second board, a PSJ8500-N97 mini PC (Intel N97), behaves the same.
Signed-off-by: Magnus Leatti <magnusleatti@kernelriot.com>
---
.../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 68 ++++++++++++++++++-
1 file changed, 65 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
index 1e142ad39e33..034547ad1e98 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
@@ -27,6 +27,9 @@
#define EPHY_CTRL 0x1004
/* Clearing this bit asserts resets for internal MDIO bus and PHY */
#define EPHY_MDIO_PHY_RESET BIT(0)
+#define WOL_CTRL 0x100c
+/* Magic and remote wake-up packet enable */
+#define WOL_CTRL_PKT_EN BIT(1)
#define OOB_WOL_CTRL 0x1010
#define OOB_WOL_CTRL_DIS BIT(0)
#define MGMT_INT_CTRL0 0x1100
@@ -204,9 +207,51 @@ static int motorcomm_resume(struct device *dev, void *bsp_priv)
return 0;
}
+/*
+ * Arm the chip to wake the system from S5. stmmac_suspend() has already
+ * programmed the PMT register of the GMAC. The rest lives in the wrapper.
+ */
+static void motorcomm_arm_s5_wake(struct net_device *ndev)
+{
+ struct stmmac_priv *spriv = netdev_priv(ndev);
+ struct dwmac_motorcomm_priv *priv = spriv->plat->bsp_priv;
+ u32 reg;
+
+ /*
+ * motorcomm_init() disables OOB WoL right after the chip reset, as
+ * normal operation requires. With it disabled the chip ignores wake
+ * packets once the system is off. Once it has been enabled, only a
+ * chip reset disables it again, so enable it only when powering off.
+ */
+ reg = readl(priv->base + OOB_WOL_CTRL);
+ reg &= ~OOB_WOL_CTRL_DIS;
+ writel(reg, priv->base + OOB_WOL_CTRL);
+
+ /*
+ * Enabling OOB WoL reloads the address from eFuse into the first
+ * MAC address filter. Write the address in use again, or the chip
+ * wakes on the factory address only. The reload is not immediate:
+ * without the wait, taken from the vendor driver, it overwrites
+ * the address written here.
+ */
+ usleep_range(2000, 3000);
+
+ rtnl_lock();
+ phylink_rx_clk_stop_block(spriv->phylink);
+ stmmac_set_umac_addr(spriv, spriv->hw, ndev->dev_addr, 0);
+ phylink_rx_clk_stop_unblock(spriv->phylink);
+ rtnl_unlock();
+
+ reg = readl(priv->base + WOL_CTRL);
+ reg |= WOL_CTRL_PKT_EN;
+ writel(reg, priv->base + WOL_CTRL);
+}
+
static void motorcomm_shutdown(struct pci_dev *pdev)
{
struct net_device *ndev = dev_get_drvdata(&pdev->dev);
+ struct stmmac_priv *spriv = netdev_priv(ndev);
+ bool wake;
/*
* A failed resume leaves the netdev detached with NAPI disabled, and
@@ -215,14 +260,31 @@ static void motorcomm_shutdown(struct pci_dev *pdev)
if (!netif_device_present(ndev))
return;
- /* Stop the device before reboot, kexec or power-off */
+ wake = system_state == SYSTEM_POWER_OFF && netif_running(ndev) &&
+ spriv->wolopts && device_may_wakeup(&pdev->dev);
+
+ /*
+ * Stop the device before reboot, kexec or power-off. With
+ * Wake-on-LAN set, this arms the PMT register and keeps the PHY up.
+ */
stmmac_suspend(&pdev->dev);
/*
* stmmac_pci_plat_suspend() enables PME if wakeup is enabled for the
- * device. Nothing arms the chip to wake the system, so undo that.
+ * device. Keep it only when the chip is armed.
+ */
+ if (!wake) {
+ pci_wake_from_d3(pdev, false);
+ return;
+ }
+
+ /*
+ * The device is left in D0. The platform removes main power anyway,
+ * and with MAC Wake-on-LAN phylib keeps polling the PHY until then:
+ * in D3hot the MDIO registers read as all-ones and the poll fails
+ * with a warning.
*/
- pci_wake_from_d3(pdev, false);
+ motorcomm_arm_s5_wake(ndev);
}
static struct plat_stmmacenet_data *
--
2.56.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5
2026-11-16 9:17 [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5 Magnus Leatti
2026-11-16 9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
2026-11-16 9:17 ` [PATCH net-next 2/2] net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5 Magnus Leatti
@ 2026-11-16 11:23 ` Giuseppe Nespolino
2026-11-16 11:36 ` Magnus Leatti
2 siblings, 1 reply; 7+ messages in thread
From: Giuseppe Nespolino @ 2026-11-16 11:23 UTC (permalink / raw)
To: Magnus Leatti
Cc: me, Maxime Chevallier, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
Hi Magnus,
On Mon, Nov 16, 2026 at 10:17 AM Magnus Leatti wrote:
> Giuseppe, this is the OOB WoL enable you and Yao discussed in the
> s2idle thread [1]: it is only enabled when powering off, because only
> a chip reset disables it again. If you can try "wol g" and a power-off
> on the Slimbook, a laptop would be a good third board.
Tried it on the Slimbook EVO15-A8 (Ryzen 7 8845HS, BIOS N.1.14GOS07).
I ran Ubuntu's 7.0.0-43 kernel with both patches applied to the
distro's dwmac-motorcomm.c and built out of tree, so not net-next
itself. The module also carried my pending reset-on-resume change and
a register dump, neither of which runs at shutdown. Magic packet sent
from another host on the LAN about 75 s after power-off, on AC:
patched wol g, BIOS WoL disabled no wake, 1 of 1
patched wol g, BIOS WoL enabled wake, 1 of 1
distro wol g, BIOS WoL enabled no wake, 1 of 1
One thing worth knowing for laptops: on this one the firmware gates
the root port. \_SB.PCI0.GPP5._PRW (SSDT23) returns {0x0F, 0x04} only
when the BIOS setup "Wake on LAN" option is on, otherwise {0x0F, 0},
and /proc/acpi/wakeup shows GPP5 at S0. It was off here, which is why
my first attempt didn't wake.
I couldn't check for warnings from the shutdown path: the journal
stops before devices are shut down, and I have no serial console or
netconsole on this machine.
Tested-by: Giuseppe Nespolino <g.nespolino@gmail.com>
As before, I worked through this with an AI assistant; the test runs
and their results are from this machine.
Thanks,
Giuseppe
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5
2026-11-16 11:23 ` [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and " Giuseppe Nespolino
@ 2026-11-16 11:36 ` Magnus Leatti
0 siblings, 0 replies; 7+ messages in thread
From: Magnus Leatti @ 2026-11-16 11:36 UTC (permalink / raw)
To: g.nespolino
Cc: Yao Zi, Maxime Chevallier, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni, Maxime Coquelin,
Alexandre Torgue, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
Hi Giuseppe,
On 11/16/26 12:23, Giuseppe Nespolino wrote:
> Tried it on the Slimbook EVO15-A8 (Ryzen 7 8845HS, BIOS N.1.14GOS07).
[...]
> patched wol g, BIOS WoL enabled wake, 1 of 1
Thanks for testing!
A side note: it was mentioned in a different thread that this card
only shipped in older NUCs. Your Slimbook has a 2024 Ryzen in it, so
the YT6801 is a current NIC that vendors still put in new machines.
Good to have that on the list, so again, thank you :)
Magnus
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown
2026-11-16 9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
@ 2026-11-16 14:33 ` Yao Zi
2026-11-16 14:58 ` Magnus Leatti
0 siblings, 1 reply; 7+ messages in thread
From: Yao Zi @ 2026-11-16 14:33 UTC (permalink / raw)
To: Magnus Leatti, me, Maxime Chevallier, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Maxime Coquelin, Alexandre Torgue, Giuseppe Nespolino, netdev,
linux-stm32, linux-arm-kernel, linux-kernel
On Mon, Nov 16, 2026 at 06:17:56AM -0300, Magnus Leatti wrote:
> The driver has no .shutdown hook. At reboot, kexec and power-off the
> MAC and the DMA engine are left running.
>
> Add a shutdown hook that calls stmmac_suspend(). With Wake-on-LAN off
> it detaches the netdev and stops the DMA, the MAC and the PHY. With
> Wake-on-LAN set it stops the DMA, arms the PMT register and keeps the
> receiver and the PHY up, as it does for suspend. That is not enough to
> wake this chip from S5, so the system still does not wake.
>
> stmmac_suspend() ends in stmmac_pci_plat_suspend(), which enables PME
> if wakeup is enabled for the device. Disable it again, since nothing
> arms the chip.
>
> A failed resume leaves the netdev detached with NAPI disabled. Skip the
> hook in that state: stmmac_suspend() must not run a second time.
>
> Signed-off-by: Magnus Leatti <magnusleatti@kernelriot.com>
> ---
> .../ethernet/stmicro/stmmac/dwmac-motorcomm.c | 22 +++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
> index 42f0b11a7b60..1e142ad39e33 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-motorcomm.c
> @@ -204,6 +204,27 @@ static int motorcomm_resume(struct device *dev, void *bsp_priv)
> return 0;
> }
>
> +static void motorcomm_shutdown(struct pci_dev *pdev)
> +{
> + struct net_device *ndev = dev_get_drvdata(&pdev->dev);
> +
> + /*
> + * A failed resume leaves the netdev detached with NAPI disabled, and
> + * stmmac_suspend() must not run on it a second time.
> + */
> + if (!netif_device_present(ndev))
> + return;
> +
> + /* Stop the device before reboot, kexec or power-off */
> + stmmac_suspend(&pdev->dev);
I think this is abusing the API, and all the other changes in this patch
are working around its side effects. So here's my NAK.
We do want to fix the problem though to ensure the device is stopped
upon shutdown, especially iirc, many YT6801 NICs in addon card form are
totally supplied by 3v3aux, thus S5 alone won't reset the NIC reliably.
But this should be done in a cleaner way.
> + /*
> + * stmmac_pci_plat_suspend() enables PME if wakeup is enabled for the
> + * device. Nothing arms the chip to wake the system, so undo that.
> + */
> + pci_wake_from_d3(pdev, false);
> +}
> +
> static struct plat_stmmacenet_data *
> motorcomm_default_plat_data(struct pci_dev *pdev)
> {
> @@ -374,6 +395,7 @@ static struct pci_driver dwmac_motorcomm_pci_driver = {
> .id_table = dwmac_motorcomm_pci_id_table,
> .probe = motorcomm_probe,
> .remove = motorcomm_remove,
> + .shutdown = motorcomm_shutdown,
> .driver = {
> .pm = &stmmac_simple_pm_ops,
> },
> --
> 2.56.1
>
--
Thanks,
Yao Zi
Meow-mrrp-mrow, I'm a cat.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown
2026-11-16 14:33 ` Yao Zi
@ 2026-11-16 14:58 ` Magnus Leatti
0 siblings, 0 replies; 7+ messages in thread
From: Magnus Leatti @ 2026-11-16 14:58 UTC (permalink / raw)
To: me, Maxime Chevallier
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Maxime Coquelin, Alexandre Torgue,
Giuseppe Nespolino, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
Hi Yao,
On Mon, Nov 16, 2026 at 02:33:17PM +0000, Yao Zi wrote:
> I think this is abusing the API, and all the other changes in this patch
> are working around its side effects. So here's my NAK.
Hmmm... Fair. stmmac_suspend() is the PM callback, and the other two
hunks are only there because I call it outside of PM. I will kill that
approach.
> We do want to fix the problem though to ensure the device is stopped
> upon shutdown, especially iirc, many YT6801 NICs in addon card form are
> totally supplied by 3v3aux, thus S5 alone won't reset the NIC reliably.
I didn't know about the 3v3aux cards. Both of my boards have the chip
soldered down, and on the N3350 one it keeps its register state across
S5 as well.
> But this should be done in a cleaner way.
I can only see two ways to do it, which one should we go for in v2?
1) In the glue only. Take RTNL, netif_device_detach(), and dev_close()
if the interface is running. No PM callback, so no PME to undo and
no guard for a failed resume.
2) A helper in the stmmac core that stops the device for shutdown,
which the PCI glues can call.
Patch 2 adds one constraint though. For the chip to wake from S5 the PMT
register has to be armed and the PHY has to stay up at power-off. That
is what stmmac_suspend() did for me. With 1) the glue has to arm PMT by
hand after closing the device, and I have not tested that yet. With 2)
the helper can do it the way the suspend path does.
Maxime, would you take a helper like 2) in the core, or should this
stay in the glue?
I'll hold v2 until I know which way to go :)
Again, thanks for answering so quickly!
Magnus
pw-bot: cr
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-11-16 14:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 9:17 [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and Wake-on-LAN from S5 Magnus Leatti
2026-11-16 9:17 ` [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown Magnus Leatti
2026-11-16 14:33 ` Yao Zi
2026-11-16 14:58 ` Magnus Leatti
2026-11-16 9:17 ` [PATCH net-next 2/2] net: stmmac: dwmac-motorcomm: support Wake-on-LAN from S5 Magnus Leatti
2026-11-16 11:23 ` [PATCH net-next 0/2] net: stmmac: dwmac-motorcomm: shutdown hook and " Giuseppe Nespolino
2026-11-16 11:36 ` Magnus Leatti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®