[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250519.150929.1041324722416773408.fujita.tomonori@gmail.com>
Date: Mon, 19 May 2025 15:09:29 +0900 (JST)
From: FUJITA Tomonori <fujita.tomonori@...il.com>
To: ansuelsmth@...il.com
Cc: andrew+netdev@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, robh@...nel.org, krzk+dt@...nel.org,
conor+dt@...nel.org, hkallweit1@...il.com, linux@...linux.org.uk,
florian.fainelli@...adcom.com, bcm-kernel-feedback-list@...adcom.com,
kabel@...nel.org, andrei.botila@....nxp.com, fujita.tomonori@...il.com,
tmgross@...ch.edu, ojeda@...nel.org, alex.gaynor@...il.com,
boqun.feng@...il.com, gary@...yguo.net, bjorn3_gh@...tonmail.com,
benno.lossin@...ton.me, a.hindborg@...nel.org, aliceryhl@...gle.com,
dakr@...nel.org, sd@...asysnail.net, michael@...sekall.de,
daniel@...rotopia.org, netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, rust-for-linux@...r.kernel.org,
rmk+kernel@...linux.org.uk
Subject: Re: [net-next PATCH v12 1/6] net: phy: pass PHY driver to
.match_phy_device OP
On Sat, 17 May 2025 22:13:45 +0200
Christian Marangi <ansuelsmth@...il.com> wrote:
> Pass PHY driver pointer to .match_phy_device OP in addition to phydev.
> Having access to the PHY driver struct might be useful to check the
> PHY ID of the driver is being matched for in case the PHY ID scanned in
> the phydev is not consistent.
>
> A scenario for this is a PHY that change PHY ID after a firmware is
> loaded, in such case, the PHY ID stored in PHY device struct is not
> valid anymore and PHY will manually scan the ID in the match_phy_device
> function.
>
> Having the PHY driver info is also useful for those PHY driver that
> implement multiple simple .match_phy_device OP to match specific MMD PHY
> ID. With this extra info if the parsing logic is the same, the matching
> function can be generalized by using the phy_id in the PHY driver
> instead of hardcoding.
>
> Rust wrapper callback is updated to align to the new match_phy_device
> arguments.
>
> Suggested-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> Reviewed-by: Russell King (Oracle) <rmk+kernel@...linux.org.uk>
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
> ---
> drivers/net/phy/bcm87xx.c | 6 ++++--
> drivers/net/phy/icplus.c | 6 ++++--
> drivers/net/phy/marvell10g.c | 12 ++++++++----
> drivers/net/phy/micrel.c | 6 ++++--
> drivers/net/phy/nxp-c45-tja11xx.c | 12 ++++++++----
> drivers/net/phy/nxp-tja11xx.c | 6 ++++--
> drivers/net/phy/phy_device.c | 2 +-
> drivers/net/phy/realtek/realtek_main.c | 27 +++++++++++++++++---------
> drivers/net/phy/teranetics.c | 3 ++-
> include/linux/phy.h | 3 ++-
> rust/kernel/net/phy.rs | 1 +
> 11 files changed, 56 insertions(+), 28 deletions(-)
As for Rust PHY abstractions:
Reviewed-by: FUJITA Tomonori <fujita.tomonori@...il.com>
Powered by blists - more mailing lists