netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Marek Vasut <marex@denx.de>
Cc: Andrew Lunn <andrew@lunn.ch>, Wei Fang <wei.fang@nxp.com>,
	Oleksij Rempel <o.rempel@pengutronix.de>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Oleksij Rempel <linux@rempel-privat.de>,
	Paolo Abeni <pabeni@redhat.com>
Subject: Re: [PATCH] net: phy: at803x: Improve hibernation support on start up
Date: Thu, 10 Aug 2023 00:15:14 +0100	[thread overview]
Message-ID: <ZNQeAl9KYme8iItv@shell.armlinux.org.uk> (raw)
In-Reply-To: <76131561-18d7-945e-cb52-3c96ed208638@denx.de>

On Wed, Aug 09, 2023 at 11:34:19PM +0200, Marek Vasut wrote:
> On 8/9/23 15:40, Andrew Lunn wrote:
> > > > Hm.. how about officially defining this PHY as the clock provider and disable
> > > > PHY automatic hibernation as long as clock is acquired?
> > > > 
> > > Sorry, I don't know much about the clock provider/consumer, but I think there
> > > will be more changes if we use clock provider/consume mechanism.
> > 
> > Less changes is not always best. What happens when a different PHY is
> > used?
> 
> Then the system wouldn't be affected by this AR803x specific behavior.

I don't think it is AR803x specific behaviour. I think it is an
interesting stmmac behaviour, where it requires the clock from
the PHY in order to do even the most trivial things (like reset
itself.) That is a very interesting design decision.

how does stmmac hardware complete a power-on reset if it needs
the external clock from a PHY that itself might be in the process
of powering itself up and establishing its clocks...

There have been *hacks* to phylink requested over the years to
work around this peculiar behaviour by stmmac - and it seems that
it's not common behaviour.

This kind of thing might affect Cadence's macb driver as well, but
rather than it being a clock from the ethernet PHY, it seems to be
from the serdes PHY built in to the SoC - if I understand what's
reported in the proposed patch commit log (which I don't fully.)

In the case of stmmac, I don't think it's fair to blame the AR803x.
It's a hardware integration issue - the AR803x implementation which
works fine elsewhere has a problem with the stmmac implementation,
because design decisions made in both implementations end up being
incompatible with each other.

However, pair them with different implementations, and they're fine.

Given that stmmac requires a clock from the PHY, I'm of the opinion
that we need to have a way to tell phylib that "hey, this MAC must
always have a receive clock from the PHY, please arrange for that
to happen". AR803x needs to check that and arrange for the receive
clock to always be output. phylib can also use that to ensure that
when EEE mode is active in the PHY, clock-stop support is disabled...
and that's actually a key part to getting EEE properly implemented.

Clearly, the IEEE 802.3 folk catered for this issue when specifying
EEE, where some MACs must always be fed a receive clock, and so I
think phylib in Linux needs to recognise that this is A Thing that
it should allow MACs to specify.

-- 
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:[~2023-08-09 23:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 17:58 [PATCH] net: phy: at803x: Improve hibernation support on start up Marek Vasut
2023-08-08  8:44 ` Wei Fang
2023-08-08 18:37   ` Marek Vasut
2023-08-09  2:27     ` Wei Fang
2023-08-09  4:36       ` Oleksij Rempel
2023-08-09  5:37         ` Wei Fang
2023-08-09  6:08           ` Oleksij Rempel
2023-08-09  8:43             ` Russell King (Oracle)
2023-08-10 10:30               ` Russell King (Oracle)
2023-12-14  8:13                 ` Romain Gantois
2023-12-14 10:46                   ` Marek Vasut
2023-12-14 16:49                   ` Russell King (Oracle)
2023-12-15  8:22                     ` Romain Gantois
2023-08-10  3:28             ` Wei Fang
2023-08-10  9:08               ` Russell King (Oracle)
2023-08-09 13:40           ` Andrew Lunn
2023-08-09 21:34             ` Marek Vasut
2023-08-09 22:06               ` Andrew Lunn
2023-08-10  0:49                 ` Marek Vasut
2023-08-10  4:32                   ` Oleksij Rempel
2023-08-10 10:10                     ` Russell King (Oracle)
2023-08-10 10:01                   ` Russell King (Oracle)
2023-08-10 10:34                     ` Russell King (Oracle)
2023-08-10 12:51                       ` Oleksij Rempel
2023-08-10 13:16                         ` Russell King (Oracle)
2023-08-10 13:49                           ` Andrew Lunn
2023-08-10 13:54                             ` Russell King (Oracle)
2023-08-10 14:23                               ` Andrew Lunn
2023-08-10 14:36                                 ` Russell King (Oracle)
2023-08-09 23:15               ` Russell King (Oracle) [this message]
2023-08-10 10:34                 ` Russell King (Oracle)
2023-08-10  3:38             ` Wei Fang

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=ZNQeAl9KYme8iItv@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@rempel-privat.de \
    --cc=marex@denx.de \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=pabeni@redhat.com \
    --cc=wei.fang@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).