From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35BC6EEAA; Sun, 18 May 2025 13:31:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747575092; cv=none; b=hBFxTYDjK+mDryVURnXSSCh1uyi85j+8X2lxZyQEJ+bfd5PJc02mtD1OYBaEVXhzyhtC6YCKXXKh/edoTpQIj0TOcTmXrlnVlvDVKySkSLx8PpHkMWer5qcfORDGy72dEEbJOfXOZvkMY/KDpZSS31AbkmaKxXutIOyDlQ6g6YQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747575092; c=relaxed/simple; bh=dV15awbD247lj6+VR3yfY/UUy8Kzmk0rr5ZokrGdYmw=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:From:To:Cc: References:In-Reply-To; b=Nu7fwKvyCtvcfQUfFGpg8EEWmIGbKtp9KKH0BEJ1YXgzbcJMKwypo0T8Dvjo7AFpSJrR88an1xY/USrTZFsV5SpNiQpw3iR7TDU30rH+ZaDuk4aBFcdavN/nqXG/zJbaM9QxAOo+VNoG5UYrXfs70T5n2Oclg3lRwknb50EzJ9o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b2lFSyVF; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b2lFSyVF" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 15DAFC4CEE7; Sun, 18 May 2025 13:30:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747575091; bh=dV15awbD247lj6+VR3yfY/UUy8Kzmk0rr5ZokrGdYmw=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=b2lFSyVFm403R0QirlXfajgv0Yq+HhXqzpmEF6GdZJp9ASL5IujhZ8VevggSQ18FM uU67FccfDFcP+x5JrKcqy11TktdGYYrY6cAjICNUed0P6CHuZdLADBXTtgT04MhWLW b3hxdQYWzvQTryICqfzrAfR9nuAEyORmcwSc5NpyEqjKLYoQ+CzuPBfLWm4F7go+Wm 1FDKmucHxK0PKkOFa03WQebvw54C9Wze2p1Qg7ZIe9xFLAgRIUBbgX6h/8xsRfPMaR KMLWzUcveHW3Dy07olT3nU5TZUQV0fXwHjEIHqWnAQcDeBOCO4XKODQ6xeSNWI1/qT 5Z+RMrj5Iqt5Q== Precedence: bulk X-Mailing-List: rust-for-linux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 18 May 2025 15:30:50 +0200 Message-Id: Subject: Re: [net-next PATCH v12 1/6] net: phy: pass PHY driver to .match_phy_device OP From: "Benno Lossin" To: "Christian Marangi" , "Andrew Lunn" , "David S. Miller" , "Eric Dumazet" , "Jakub Kicinski" , "Paolo Abeni" , "Rob Herring" , "Krzysztof Kozlowski" , "Conor Dooley" , "Heiner Kallweit" , "Russell King" , "Florian Fainelli" , "Broadcom internal kernel review list" , =?utf-8?q?Marek_Beh=C3=BAn?= , "Andrei Botila" , "FUJITA Tomonori" , "Trevor Gross" , "Miguel Ojeda" , "Alex Gaynor" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Danilo Krummrich" , "Sabrina Dubroca" , "Michael Klein" , "Daniel Golle" , , , , Cc: "Russell King (Oracle)" X-Mailer: aerc 0.20.1 References: <20250517201353.5137-1-ansuelsmth@gmail.com> <20250517201353.5137-2-ansuelsmth@gmail.com> In-Reply-To: <20250517201353.5137-2-ansuelsmth@gmail.com> 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) > Reviewed-by: Russell King (Oracle) > Signed-off-by: Christian Marangi > --- > 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 # for Rust --- Cheers, Benno