All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: yicongsrfy@163.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,
	yicong@kylinos.cn
Subject: Re: [PATCH] net: phy: avoid config_init failure on unattached PHY during resume
Date: Wed, 10 Sep 2025 09:15:59 +0100	[thread overview]
Message-ID: <aMEzv50VmUb2eUMQ@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250910025826.3484607-1-yicongsrfy@163.com>

On Wed, Sep 10, 2025 at 10:58:26AM +0800, yicongsrfy@163.com wrote:
> From: Yi Cong <yicong@kylinos.cn>
> 
> When resuming a PHY device that is not attached to a MAC (i.e.
> phydev->attached_dev is NULL), mdio_bus_phy_resume() may call into
> phy_init_hw() -> phydev->drv->config_init(), which can return -EOPNOTSUPP
> (-95) if the driver does not support initialization in this state.
> 
> This results in log messages like:
> [ 1905.106209] YT8531S Gigabit Ethernet xxxxmac_mii_bus-XXXX:00:01:
> PM: dpm_run_callback(): mdio_bus_phy_resume+0x0/0x180 [libphy] returns -95
> [ 1905.106232] YT8531S Gigabit Ethernet xxxxmac_mii_bus-XXXX:00:01:
> PM: failed to resume: error -95
> 
> In practice, only one PHY on the bus (e.g. XXXX:00:00) is typically
> attached to a MAC interface; others (like XXXX:00:01) are probed but
> not used, making such resume attempts unnecessary and misleading.
> 
> Add an early return in mdio_bus_phy_resume() when !phydev->attached_dev,
> to prevent unneeded hardware initialization and avoids false error reports.

PHYs are allowed to be attached without a net device. Your PHY
driver needs to cope with this condition.

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

  reply	other threads:[~2025-09-10  8:16 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10  2:58 [PATCH] net: phy: avoid config_init failure on unattached PHY during resume yicongsrfy
2025-09-10  8:15 ` Russell King (Oracle) [this message]
2025-09-10  9:17   ` yicongsrfy
2025-09-10  9:31     ` yicongsrfy
2025-09-10  9:57       ` Russell King (Oracle)
2025-09-10  9:54     ` Russell King (Oracle)
2025-09-11 11:25       ` yicongsrfy
2025-09-11 12:58         ` Andrew Lunn
2025-09-17  8:24           ` yicongsrfy
2025-09-17 10:06         ` Russell King (Oracle)
2025-09-19  7:38           ` yicongsrfy
2025-09-19 12:45             ` Andrew Lunn
2025-09-22  1:56               ` yicongsrfy

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=aMEzv50VmUb2eUMQ@shell.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=yicong@kylinos.cn \
    --cc=yicongsrfy@163.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.