netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: yicongsrfy@163.com
Cc: andrew@lunn.ch, davem@davemloft.net, edumazet@google.com,
	hkallweit1@gmail.com, kuba@kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	pabeni@redhat.com, yicong@kylinos.cn
Subject: Re: [PATCH] net: phy: avoid config_init failure on unattached PHY during resume
Date: Wed, 10 Sep 2025 10:54:05 +0100	[thread overview]
Message-ID: <aMFKvS-Dm0hhJVnO@shell.armlinux.org.uk> (raw)
In-Reply-To: <20250910091703.3575924-1-yicongsrfy@163.com>

On Wed, Sep 10, 2025 at 05:17:03PM +0800, yicongsrfy@163.com wrote:
> Then, because `phydev->interface != PHY_INTERFACE_MODE_SGMII`, it attempts
> to enter `ytphy_rgmii_clk_delay_config` to configure the RGMII tx/rx delay.
> However, since this PHY device is not associated with any GMAC and is not
> connected via an RGMII interface, the function returns `-EOPNOTSUPP`.

It seems the problem is this code:

        /* set rgmii delay mode */
        if (phydev->interface != PHY_INTERFACE_MODE_SGMII) {
                ret = ytphy_rgmii_clk_delay_config(phydev);

which assumes that phydev->interface will be either SGMII or one of
the RGMII modes. This is not the case with a PHY that has been
freshly probed unless phydev->interface is set in the probe function.

I see the probe function decodes the PHYs operating mode and
configures stuff based on that. Maybe, as it only supports RGMII
and SGMII, it should also initialise phydev->interface to the initial
operating condition of the PHY if other code in the driver relies
upon this being set to either SGMII or one of the RGMII types.

-- 
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:[~2025-09-10  9:54 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)
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) [this message]
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=aMFKvS-Dm0hhJVnO@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 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).