Netdev List
 help / color / mirror / Atom feed
From: Magnus Leatti <magnusleatti@kernelriot.com>
To: me@ziyao.cc, Maxime Chevallier <maxime.chevallier@bootlin.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Giuseppe Nespolino <g.nespolino@gmail.com>,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] net: stmmac: dwmac-motorcomm: quiesce the device at shutdown
Date: Mon, 16 Nov 2026 11:58:20 -0300	[thread overview]
Message-ID: <20261116145820.3005689-1-magnusleatti@kernelriot.com> (raw)
In-Reply-To: <avsTEglKKD_wl_Fi@pie>

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

  reply	other threads:[~2026-11-16 14:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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 15:08   ` Yao Zi
2026-11-16 15:17     ` Yao Zi
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261116145820.3005689-1-magnusleatti@kernelriot.com \
    --to=magnusleatti@kernelriot.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=g.nespolino@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=maxime.chevallier@bootlin.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=me@ziyao.cc \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox