netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: John Ernberg <john.ernberg@actia.se>
Cc: Wei Fang <wei.fang@nxp.com>, Shenwei Wang <shenwei.wang@nxp.com>,
	Clark Wang <xiaoning.wang@nxp.com>,
	NXP Linux Team <linux-imx@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andrew Lunn <andrew@lunn.ch>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [PATCH net v3 2/2] net: fec: Suspend the PHY on probe
Date: Wed, 6 Mar 2024 19:05:39 +0100	[thread overview]
Message-ID: <20240306190539.4ab9f369@device-28.home> (raw)
In-Reply-To: <20240306133734.4144808-3-john.ernberg@actia.se>

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@actia.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@actia.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

  reply	other threads:[~2024-03-06 18:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 13:37 [PATCH net v3 0/2] net: fec: Fixes to suspend / resume with mac_managed_pm John Ernberg
2024-03-06 13:37 ` [PATCH net v3 2/2] net: fec: Suspend the PHY on probe John Ernberg
2024-03-06 18:05   ` Maxime Chevallier [this message]
2024-03-19  8:37     ` John Ernberg
2024-03-19  8:51       ` Russell King (Oracle)
2024-03-20 15:25         ` John Ernberg
2024-03-20 16:54           ` Russell King (Oracle)
2024-03-20 17:13             ` Florian Fainelli
2024-03-20 19:44               ` Russell King (Oracle)
2024-03-21 16:02                 ` John Ernberg
2024-03-21 16:13                   ` Florian Fainelli
2024-03-25 12:20                     ` John Ernberg
2024-03-25 21:27                       ` Florian Fainelli
2024-03-28 11:52                         ` John Ernberg
2024-03-06 13:37 ` [PATCH net v3 1/2] net: fec: Set mac_managed_pm during probe John Ernberg

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=20240306190539.4ab9f369@device-28.home \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hkallweit1@gmail.com \
    --cc=john.ernberg@actia.se \
    --cc=kuba@kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shenwei.wang@nxp.com \
    --cc=wei.fang@nxp.com \
    --cc=xiaoning.wang@nxp.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).