From: Florian Fainelli <f.fainelli@gmail.com>
To: Heiner Kallweit <hkallweit1@gmail.com>,
Joakim Zhang <qiangqing.zhang@nxp.com>,
"christian.melki@t2data.com" <christian.melki@t2data.com>,
"andrew@lunn.ch" <andrew@lunn.ch>,
"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
dl-linux-imx <linux-imx@nxp.com>
Subject: Re: [PATCH] net: phy: fix PHY possibly unwork after MDIO bus resume back
Date: Tue, 6 Apr 2021 11:32:18 -0700 [thread overview]
Message-ID: <1ceca7ac-ed6f-de73-6afb-34fd0a7e5db3@gmail.com> (raw)
In-Reply-To: <b34ccbf5-18eb-681b-3336-4c93325c2a43@gmail.com>
On 4/6/2021 4:42 AM, Heiner Kallweit wrote:
>
> Waiting for ANEG_COMPLETE to be set wouldn't be a good option. Aneg may never
> complete for different reasons, e.g. no physical link. And even if we use a
> timeout this may add unwanted delays.
>
>> Do you have any other insights that can help me further locate the issue? Thanks.
>>
>
> I think current MAC/PHY PM handling isn't perfect. Often we have the following
> scenario:
>
> *suspend*
> 1. PHY is suspended (mdio_bus_phy_suspend)
> 2. MAC suspend callback (typically involving phy_stop())
>
> *resume*
> 1. MAC resume callback (typically involving phy_start())
> 2. PHY is resumed (mdio_bus_phy_resume), incl. calling phy_init_hw()
>
> Calling phy_init_hw() after phy_start() doesn't look right.
> It seems to work in most cases, but there's a certain risk
> that phy_init_hw() overwrites something, e.g. the advertised
> modes.
> I think we have two valid scenarios:
>
> 1. phylib PM callbacks are used, then the MAC driver shouldn't
> touch the PHY in its PM callbacks, especially not call
> phy_stop/phy_start.
>
> 2. MAC PM callbacks take care also of the PHY. Then I think we would
> need a flag at the phy_device telling it to make the PHY PM
> callbacks a no-op.
Maybe part of the problem is that the FEC is calling phy_{stop,start} in
its suspend/resume callbacks instead of phy_{suspend,resume} which would
play nice and tell the MDIO bus PM callbacks that the PHY has already
been suspended.
I am also suspicious about whether Wake-on-LAN actually works with the
FEC, you cannot wake from LAN if the PHY is stopped and powered down.
--
Florian
next prev parent reply other threads:[~2021-04-06 18:32 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-04 10:07 [PATCH] net: phy: fix PHY possibly unwork after MDIO bus resume back Joakim Zhang
2021-04-04 14:09 ` Heiner Kallweit
2021-04-04 22:48 ` Heiner Kallweit
2021-04-05 8:43 ` Christian Melki
2021-04-05 12:09 ` Heiner Kallweit
2021-04-05 13:53 ` Christian Melki
2021-04-05 14:58 ` Heiner Kallweit
2021-04-05 23:18 ` Florian Fainelli
2021-04-06 2:07 ` Joakim Zhang
2021-04-06 6:28 ` Heiner Kallweit
2021-04-06 10:07 ` Joakim Zhang
2021-04-06 11:42 ` Heiner Kallweit
2021-04-06 18:21 ` Heiner Kallweit
2021-04-07 1:43 ` Joakim Zhang
2021-04-07 7:12 ` Heiner Kallweit
2021-04-07 7:46 ` Joakim Zhang
2021-04-07 10:05 ` Joakim Zhang
2021-04-07 10:21 ` Heiner Kallweit
2021-04-07 10:38 ` Joakim Zhang
2021-04-06 18:32 ` Florian Fainelli [this message]
2021-04-06 18:43 ` Heiner Kallweit
2021-04-06 18:47 ` Florian Fainelli
2021-04-06 2:06 ` Joakim Zhang
2021-04-06 1:39 ` Joakim Zhang
2021-04-06 1:37 ` Joakim Zhang
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=1ceca7ac-ed6f-de73-6afb-34fd0a7e5db3@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=christian.melki@t2data.com \
--cc=davem@davemloft.net \
--cc=hkallweit1@gmail.com \
--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=qiangqing.zhang@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).