lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D9ZBNJ6VL5XL.2TIH5QSOI8ABL@kernel.org>
Date: Sun, 18 May 2025 15:30:50 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Christian Marangi" <ansuelsmth@...il.com>, "Andrew Lunn"
 <andrew+netdev@...n.ch>, "David S. Miller" <davem@...emloft.net>, "Eric
 Dumazet" <edumazet@...gle.com>, "Jakub Kicinski" <kuba@...nel.org>, "Paolo
 Abeni" <pabeni@...hat.com>, "Rob Herring" <robh@...nel.org>, "Krzysztof
 Kozlowski" <krzk+dt@...nel.org>, "Conor Dooley" <conor+dt@...nel.org>,
 "Heiner Kallweit" <hkallweit1@...il.com>, "Russell King"
 <linux@...linux.org.uk>, "Florian Fainelli"
 <florian.fainelli@...adcom.com>, "Broadcom internal kernel review list"
 <bcm-kernel-feedback-list@...adcom.com>, Marek Behún
 <kabel@...nel.org>, "Andrei Botila" <andrei.botila@....nxp.com>, "FUJITA
 Tomonori" <fujita.tomonori@...il.com>, "Trevor Gross" <tmgross@...ch.edu>,
 "Miguel Ojeda" <ojeda@...nel.org>, "Alex Gaynor" <alex.gaynor@...il.com>,
 "Boqun Feng" <boqun.feng@...il.com>, "Gary Guo" <gary@...yguo.net>,
 Björn Roy Baron <bjorn3_gh@...tonmail.com>, "Benno Lossin"
 <benno.lossin@...ton.me>, "Andreas Hindborg" <a.hindborg@...nel.org>,
 "Alice Ryhl" <aliceryhl@...gle.com>, "Danilo Krummrich" <dakr@...nel.org>,
 "Sabrina Dubroca" <sd@...asysnail.net>, "Michael Klein"
 <michael@...sekall.de>, "Daniel Golle" <daniel@...rotopia.org>,
 <netdev@...r.kernel.org>, <devicetree@...r.kernel.org>,
 <linux-kernel@...r.kernel.org>, <rust-for-linux@...r.kernel.org>
Cc: "Russell King (Oracle)" <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 May 17, 2025 at 10:13 PM CEST, Christian Marangi 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(-)

I haven't really looked at the C code, just the part that interfaces
with Rust, so:

Reviewed-by: Benno Lossin <lossin@...nel.org> # for Rust

---
Cheers,
Benno

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ