From: Simon Horman <horms@kernel.org>
To: Nicolai Buchwitz <nb@tipi-net.de>
Cc: netdev-bot+sashiko@kernel.org, opendmb@gmail.com,
florian.fainelli@broadcom.com,
bcm-kernel-feedback-list@broadcom.com, andrew+netdev@lunn.ch,
davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
pabeni@redhat.com, justin.chen@broadcom.com,
f.fainelli@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v3 1/2] net: bcmgenet: recover from a failed resume
Date: Wed, 28 Oct 2026 17:23:05 +0000 [thread overview]
Message-ID: <20261028172305.GB257209@horms.kernel.org> (raw)
In-Reply-To: <7a86dc120223465e88cc265a6f597657@tipi-net.de>
On Fri, Oct 23, 2026 at 02:04:34PM +0200, Nicolai Buchwitz wrote:
> On 23.10.2026 13:55, netdev-bot+sashiko@kernel.org wrote:
> > [...]
>
> > [Severity: Medium]
> >
> > After a failed non-WoL resume, can the next non-WoL suspend leave an
> > external PHY powered up with its link active?
> >
> > On the normal non-WoL path, bcmgenet_suspend() halts and suspends the
> > PHY:
> >
> > bcmgenet_netif_stop(dev, true)
> > phy_stop()
> > PHY_HALTED -> phy_suspend() (BMCR power-down)
> >
> > The failed resume has already done this before bcmgenet_init_dma()
> > fails:
> >
> > bcmgenet_resume()
> > phy_init_hw() drv->soft_reset() clears BMCR_PDOWN and sets
> > phydev->suspended = 0
> > genphy_config_aneg() restarts autoneg
> > bcmgenet_init_dma() fails -> return ret
> > (phy_resume() is never reached)
> >
> > This new early return then skips any PHY power-down. Calling phy_stop()
> > here would not work either, because the PHY is still in PHY_HALTED.
> >
> > Nothing else seems to power the PHY down. bcmgenet_mii_probe() sets
> > mac_managed_pm = true, so mdio_bus_phy_suspend() returns early, and
> > bcmgenet_suspend_noirq() only powers down an internal GPHY via
> > GENET_POWER_PASSIVE.
> >
> > So an external PHY whose driver has both .soft_reset and .suspend (for
> > example genphy_soft_reset with genphy_suspend) would stay powered with
> > its link up through system sleep.
> >
> > This would not show up with the bcm54xx PHY on CM4, which has no
> > .soft_reset, or with the Generic PHY driver.
> >
> > Does the !priv->tx_cbs path need a phy_suspend() call (or similar) when
> > WoL is not in use?
> >
> > >
> > > netif_device_detach(dev);
> > >
> > > if (device_may_wakeup(d) && priv->wolopts) {
> >
> > [ ... ]
>
> Same as in v2: pre-existing, phy_init_hw() powers it up in the failed
> resume and nothing starts it again. Fair that it's reachable now, before
> this series that suspend just hung. Nobody seems to have hit it either, it
> needs a failed resume plus a PHY with soft_reset, so pretty much an edge
> case, don't you think?
>
> I'd rather not add a phy_suspend() I can't test ... the CM4's bcm54xx has
> no soft_reset, so the PHY never gets powered up there anyway. The proper
> fix is to stop leaving the half state behind, that's on my list after the
> MTU series.
FWIIW, I agree that is an appropriate approach here.
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2026-10-28 17:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-22 8:54 [PATCH net v3 0/2] net: bcmgenet: fixes for a failed resume and the ring rebuild Nicolai Buchwitz
2026-10-22 8:54 ` [PATCH net v3 1/2] net: bcmgenet: recover from a failed resume Nicolai Buchwitz
2026-10-23 11:55 ` netdev-bot+sashiko
2026-10-23 12:04 ` Nicolai Buchwitz
2026-10-28 17:23 ` Simon Horman [this message]
2026-10-22 8:54 ` [PATCH net v3 2/2] net: bcmgenet: restore the Tx coalescing setting when the rings are rebuilt Nicolai Buchwitz
2026-10-28 17:23 ` Simon Horman
2026-10-28 17:25 ` Florian Fainelli
2026-10-26 23:36 ` [PATCH net v3 0/2] net: bcmgenet: fixes for a failed resume and the ring rebuild Jakub Kicinski
2026-10-27 22:53 ` Florian Fainelli
2026-10-28 23:20 ` patchwork-bot+netdevbpf
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=20261028172305.GB257209@horms.kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=florian.fainelli@broadcom.com \
--cc=justin.chen@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nb@tipi-net.de \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=opendmb@gmail.com \
--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