From: Buday Csaba <buday.csaba@prolan.hu>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Philipp Zabel <p.zabel@pengutronix.de>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v5 0/4] net: mdio: implement optional PHY reset before MDIO access
Date: Wed, 29 Oct 2025 14:42:20 +0100 [thread overview]
Message-ID: <aQIZvDt5gooZSTcp@debianbuilder> (raw)
In-Reply-To: <23c1bed1-3f95-48b9-8ff0-71696bdcd62b@lunn.ch>
On Wed, Oct 29, 2025 at 01:43:32PM +0100, Andrew Lunn wrote:
> On Wed, Oct 29, 2025 at 11:23:40AM +0100, Buday Csaba wrote:
> > Some Ethernet PHY devices require a hard reset before any MDIO access can
> > be safely performed. This includes the auto-detection of the PHY ID, which
> > is necessary to bind the correct driver to the device.
>
> nitpicking a bit, but this last part is not strictly correct. You can
> also bind the correct driver to the PHY using a compatible. So it is
> not 'necessary'. It is maybe the preferred way to do it, although the
> DT Maintainers my disagree and say compatible is the preferred way.
>
I have also gotten the impression, that DT people generally prefer
hardcoding the ID. I can not argue with that. But that should be clearly
reflected in the documentation. Now the description in ethernet-phy.yaml
suggests that a correct ID only is a workaround for misbehaving PHYs:
"If the PHY reports an incorrect ID (or none at all) then the
compatible list may contain an entry with the correct PHY ID
in the above form."
> > The kernel currently does not provide a way to assert the reset before
> > reading the ID, making these devices usable only when the ID is hardcoded
> > in the Device Tree 'compatible' string.
>
> Which is what you say here.
>
> > (One notable exception is the FEC driver and its now deprecated
> > `phy-reset-gpios` property).
>
> > This patchset implements an optional reset before reading of the PHY ID
> > register, allowing such PHYs to be used with auto-detected ID. The reset
> > is only asserted when the current logic fails to detect the ID, ensuring
> > compatibility with existing systems.
>
> O.K, that is new.
>
> One of the arguments raised against making this more complex is that
> next somebody will want to add clock support. And should that be
> enabled before or after the reset? And then regulators, and what order
> should that be done in? The core cannot answer these questions, only
> the driver can. The compatible should be used to get the driver loaded
> and then it can enable these resources in the correct order.
>
Again, I can not argue with that. I can only tell that these patch fixed
our problem - I hope that others may also benefit from it.
> I will look at the patches anyway.
>
> Andrew
>
Really appreciate it, thanks!
Csaba
prev parent reply other threads:[~2025-10-29 13:42 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-29 10:23 [PATCH net-next v5 0/4] net: mdio: implement optional PHY reset before MDIO access Buday Csaba
2025-10-29 10:23 ` [PATCH net-next v5 1/4] net: mdio: common handling of phy reset properties Buday Csaba
2025-10-29 13:03 ` Andrew Lunn
2025-10-29 13:59 ` Buday Csaba
2025-10-29 10:23 ` [PATCH net-next v5 2/4] net: mdio: change property read from fwnode_property_read_u32() to device_property_read_u32() Buday Csaba
2025-10-29 13:09 ` Andrew Lunn
2025-10-29 10:23 ` [PATCH net-next v5 3/4] net: mdio: reset PHY before attempting to access registers in fwnode_mdiobus_register_phy Buday Csaba
2025-10-29 13:20 ` Andrew Lunn
2025-10-29 14:15 ` Buday Csaba
2025-10-29 15:15 ` Andrew Lunn
2025-10-30 6:33 ` Buday Csaba
2025-10-29 10:23 ` [PATCH net-next v5 4/4] net: mdio: add message when resetting a PHY before registration Buday Csaba
2025-10-29 13:21 ` Andrew Lunn
2025-10-29 12:43 ` [PATCH net-next v5 0/4] net: mdio: implement optional PHY reset before MDIO access Andrew Lunn
2025-10-29 13:42 ` Buday Csaba [this message]
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=aQIZvDt5gooZSTcp@debianbuilder \
--to=buday.csaba@prolan.hu \
--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=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.