Re: [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown

From: Magnus Leatti

Date: Mon Nov 16 2026 - 09:59:01 EST


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