netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: WangYuli <wangyuli@uniontech.com>
Cc: andrew@lunn.ch, hkallweit1@gmail.com, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	guanwentao@uniontech.com, zhanjun@uniontech.com,
	f.fainelli@gmail.com, sebastian.hesselbarth@gmail.com,
	mugunthanvnm@ti.com, geert+renesas@glider.be
Subject: Re: [PATCH] net: phy: fix may not suspend when phy has WoL
Date: Mon, 11 Nov 2024 10:05:23 +0000	[thread overview]
Message-ID: <ZzHW4wOAH769WSJ0@shell.armlinux.org.uk> (raw)
In-Reply-To: <ACDD37BE39A4EE18+20241111080627.1076283-1-wangyuli@uniontech.com>

On Mon, Nov 11, 2024 at 04:06:27PM +0800, WangYuli wrote:
> From: Wentao Guan <guanwentao@uniontech.com>
> 
> When system suspends and mdio_bus_phy goes to suspend, if the phy
> enabled wol, phy_suspend will returned -EBUSY, and break system
> suspend.
> 
> Commit 93f41e67dc8f ("net: phy: fix WoL handling when suspending
> the PHY") fixes the case when netdev->wol_enabled=1, but some case,
> netdev->wol_enabled=0 and phydev set wol_enabled enabled, so check
> phydev->wol_enabled.

I think a better question would be... why do we propagate the -EBUSY
error code from phy_suspend() in mdio_bus_phy_suspend() ? It returns
-EBUSY "If the device has WOL enabled, we cannot suspend the PHY" so
it seems ignoring this error code would avoid adding yet more
complexity, trying to match the conditions in mdio_bus_phy_may_suspend()
with those in phy_suspend().

In any case, there's a helper for reading the WoL state.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!

  parent reply	other threads:[~2024-11-11 10:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11  8:06 [PATCH] net: phy: fix may not suspend when phy has WoL WangYuli
2024-11-11  8:24 ` Wentao Guan
2024-11-11 17:47   ` [PATCH] " Andrew Lunn
2024-11-11 17:53     ` Wentao Guan
2024-11-11  8:49 ` Wentao Guan
2024-11-11 10:05 ` Russell King (Oracle) [this message]
2024-11-11 10:59   ` [PATCH] " Wentao Guan

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=ZzHW4wOAH769WSJ0@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=geert+renesas@glider.be \
    --cc=guanwentao@uniontech.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sebastian.hesselbarth@gmail.com \
    --cc=wangyuli@uniontech.com \
    --cc=zhanjun@uniontech.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;
as well as URLs for NNTP newsgroup(s).