From: Christian Marangi <ansuelsmth@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Andrew Lunn <andrew@lunn.ch>, Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [net-next RFC PATCH v2 2/3] net: phy: Add support for Aeonsemi AS21xxx PHYs
Date: Wed, 26 Mar 2025 19:18:12 +0100 [thread overview]
Message-ID: <67e444e6.050a0220.81044.004e@mx.google.com> (raw)
In-Reply-To: <Z-RCiWzRWbv7RlHJ@shell.armlinux.org.uk>
On Wed, Mar 26, 2025 at 06:08:09PM +0000, Russell King (Oracle) wrote:
> On Wed, Mar 26, 2025 at 03:56:15PM +0100, Andrew Lunn wrote:
> > After the firmware download, the phylib core will still have the wrong
> > ID values. So you cannot use PHY_ID_MATCH_EXACT(PHY_ID_AS21011JB1).
> > But what you can do is have a .match_phy_device function. It will get
> > called, and it can read the real ID from the device, and perform a
> > match. If it does not match return -ENODEV, and the core will try the
> > next entry.
>
> Before it returns -ENODEV, it could re-read the ID values and fill
> them into struct phy_device. This would allow phylib's matching to
> work.
>
Is it ok for PHY driver to change values in phy_device ""externally"" to
phy_device.c ? Maybe you still have to read the other response but a
bool with needs_rescan to handle this internally?
> > You either need N match_phy_device functions, one per ID value, or you
> > can make use of the .driver_data in phy_driver, and place the matching
> > data there.
>
> An alternative would be to change the match_phy_device() method to
> pass the phy_driver, which would allow a single match_phy_device
> function to match the new hardware ID values against the PHY IDs in
> the phy_driver without needing to modify the IDs in phy_device.
>
I also considered extending the function with additional stuff but then
I considered that would mean rework each PHY driver and destroy PHY
driver downstream, not something we should care but still quite a big
task. If the -ENODEV path is not OK, I feel an additional OP is better
than tweaking match_phy_device.
--
Ansuel
next prev parent reply other threads:[~2025-03-26 18:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 0:23 [net-next RFC PATCH v2 0/3] net: phy: Add support for new Aeonsemi PHYs Christian Marangi
2025-03-26 0:23 ` [net-next RFC PATCH v2 1/3] net: phy: permit PHYs to register a second time Christian Marangi
2025-03-26 0:23 ` [net-next RFC PATCH v2 2/3] net: phy: Add support for Aeonsemi AS21xxx PHYs Christian Marangi
2025-03-26 13:53 ` Russell King (Oracle)
2025-03-26 13:57 ` Andrew Lunn
2025-03-26 14:47 ` Christian Marangi
2025-03-26 14:43 ` Christian Marangi
2025-03-26 18:02 ` Russell King (Oracle)
2025-03-26 14:00 ` Simon Horman
2025-03-26 14:05 ` Simon Horman
2025-03-26 14:56 ` Andrew Lunn
2025-03-26 15:09 ` Christian Marangi
2025-03-26 18:08 ` Russell King (Oracle)
2025-03-26 18:18 ` Christian Marangi [this message]
2025-03-26 18:32 ` Russell King (Oracle)
2025-03-26 0:23 ` [net-next RFC PATCH v2 3/3] dt-bindings: net: Document support for Aeonsemi PHYs Christian Marangi
2025-03-26 15:08 ` Andrew Lunn
2025-03-26 15:16 ` Christian Marangi
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=67e444e6.050a0220.81044.004e@mx.google.com \
--to=ansuelsmth@gmail.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
/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).