[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240306190539.4ab9f369@device-28.home>
Date: Wed, 6 Mar 2024 19:05:39 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: John Ernberg <john.ernberg@...ia.se>
Cc: Wei Fang <wei.fang@....com>, Shenwei Wang <shenwei.wang@....com>, Clark
Wang <xiaoning.wang@....com>, NXP Linux Team <linux-imx@....com>, "David S.
Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub
Kicinski <kuba@...nel.org>, "Paolo Abeni" <pabeni@...hat.com>, Heiner
Kallweit <hkallweit1@...il.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, Andrew Lunn <andrew@...n.ch>, Russell King
<linux@...linux.org.uk>
Subject: Re: [PATCH net v3 2/2] net: fec: Suspend the PHY on probe
Hello John,
I'm adding Andrew and Russell to the thread as PHY maintainers and
reviewers.
On Wed, 6 Mar 2024 13:37:45 +0000
John Ernberg <john.ernberg@...ia.se> wrote:
> Since the power management is now performed by the FEC instead of generic
> pm the PHY will not suspend until the link has been up.
>
> Therefor suspend it on probe. It will be resumed by {of_,}phy_connect()
> when the link is brought up.
>
> Since {of_,}phy_connect() and phy_disconnect() will resume and suspend the
> PHY when the link is brought up and down respectively, and phy_stop() and
> phy_start() will resume and suspend the PHY in the suspend-resume paths
> there is no need for any additional calls anywhere.
>
> Signed-off-by: John Ernberg <john.ernberg@...ia.se>
[...]
> @@ -2539,8 +2539,10 @@ static int fec_enet_mii_init(struct platform_device *pdev)
> /* find all the PHY devices on the bus and set mac_managed_pm to true */
> for (addr = 0; addr < PHY_MAX_ADDR; addr++) {
> phydev = mdiobus_get_phy(fep->mii_bus, addr);
> - if (phydev)
> + if (phydev) {
> phydev->mac_managed_pm = true;
> + phy_suspend(phydev);
> + }
I don't think that's correct. here phy_suspend() is being called before
the PHY got attached, so the PHY wasn't initialized at all at that
point (which I guess is your issue as the PHY is still in the state it
was configured into by the bootloader)
Following the code paths, it looks like this works for you because the
PHY you're using has a .suspend callback populated, but for any PHY
that uses the genphy driver, this will do nothing at all (the PHY isn't
yet attached to the genphy ops, therefore genphy_suspend won't be
called).
Best regards,
Maxime
Powered by blists - more mailing lists