diff mbox series

[net-next,v2,1/3] phy: mscc: Use PHY_ID_MATCH_VENDOR to minimize PHY ID table

Message ID 20230426104313.28950-2-harini.katakam@amd.com (mailing list archive)
State Changes Requested
Delegated to: Netdev Maintainers
Headers show
Series Add support for VSC8531_02 PHY and DT RGMII tuning | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 8 this patch: 8
netdev/cc_maintainers warning 1 maintainers not CCed: mkl@pengutronix.de
netdev/build_clang success Errors and warnings before: 8 this patch: 8
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 8 this patch: 8
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 20 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Katakam, Harini April 26, 2023, 10:43 a.m. UTC
All the PHY devices variants specified have the same mask and
hence can be simplified to one vendor look up for 0xfffffff0.
Any individual config can be identified by PHY_ID_MATCH_EXACT
in the respective structure.

Signed-off-by: Harini Katakam <harini.katakam@amd.com>
---
v2:
New patch

 drivers/net/phy/mscc/mscc_main.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

Comments

Andrew Lunn April 26, 2023, 1:39 p.m. UTC | #1
On Wed, Apr 26, 2023 at 04:13:11PM +0530, Harini Katakam wrote:
> All the PHY devices variants specified have the same mask and
> hence can be simplified to one vendor look up for 0xfffffff0.
> Any individual config can be identified by PHY_ID_MATCH_EXACT
> in the respective structure.
> 
> Signed-off-by: Harini Katakam <harini.katakam@amd.com>

net-next is closed at the moment, so you will need to report in two
weeks time.

> diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c
> index 62bf99e45af1..75d9582e5784 100644
> --- a/drivers/net/phy/mscc/mscc_main.c
> +++ b/drivers/net/phy/mscc/mscc_main.c
> @@ -2656,19 +2656,7 @@ static struct phy_driver vsc85xx_driver[] = {
>  module_phy_driver(vsc85xx_driver);
>  
>  static struct mdio_device_id __maybe_unused vsc85xx_tbl[] = {
> -	{ PHY_ID_VSC8504, 0xfffffff0, },
> -	{ PHY_ID_VSC8514, 0xfffffff0, },
> -	{ PHY_ID_VSC8530, 0xfffffff0, },
> -	{ PHY_ID_VSC8531, 0xfffffff0, },
> -	{ PHY_ID_VSC8540, 0xfffffff0, },
> -	{ PHY_ID_VSC8541, 0xfffffff0, },
> -	{ PHY_ID_VSC8552, 0xfffffff0, },
> -	{ PHY_ID_VSC856X, 0xfffffff0, },
> -	{ PHY_ID_VSC8572, 0xfffffff0, },
> -	{ PHY_ID_VSC8574, 0xfffffff0, },
> -	{ PHY_ID_VSC8575, 0xfffffff0, },
> -	{ PHY_ID_VSC8582, 0xfffffff0, },
> -	{ PHY_ID_VSC8584, 0xfffffff0, },
> +	{ PHY_ID_MATCH_VENDOR(0xfffffff0) },

The vendor ID is 0xfffffff0 ???

    Andrew
Katakam, Harini April 26, 2023, 5:27 p.m. UTC | #2
Hi Andrew,

> -----Original Message-----
> From: Andrew Lunn <andrew@lunn.ch>
> Sent: Wednesday, April 26, 2023 7:10 PM
> To: Katakam, Harini <harini.katakam@amd.com>
> Cc: robh+dt@kernel.org; hkallweit1@gmail.com; linux@armlinux.org.uk;
> davem@davemloft.net; kuba@kernel.org; edumazet@google.com;
> pabeni@redhat.com; vladimir.oltean@nxp.com; wsa+renesas@sang-
> engineering.com; krzysztof.kozlowski+dt@linaro.org;
> simon.horman@corigine.com; netdev@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org;
> harinikatakamlinux@gmail.com; Simek, Michal <michal.simek@amd.com>;
> Pandey, Radhey Shyam <radhey.shyam.pandey@amd.com>
> Subject: Re: [PATCH net-next v2 1/3] phy: mscc: Use
> PHY_ID_MATCH_VENDOR to minimize PHY ID table
> 
> On Wed, Apr 26, 2023 at 04:13:11PM +0530, Harini Katakam wrote:
> > All the PHY devices variants specified have the same mask and hence
> > can be simplified to one vendor look up for 0xfffffff0.
> > Any individual config can be identified by PHY_ID_MATCH_EXACT in the
> > respective structure.
> >
> > Signed-off-by: Harini Katakam <harini.katakam@amd.com>
> 
<snip>
> > +	{ PHY_ID_MATCH_VENDOR(0xfffffff0) },
> 
> The vendor ID is 0xfffffff0 ???

Sorry this is supposed to be 0x00070400 (Microsemi OUI).
Will fix in the next version.

Regards,
Harini
diff mbox series

Patch

diff --git a/drivers/net/phy/mscc/mscc_main.c b/drivers/net/phy/mscc/mscc_main.c
index 62bf99e45af1..75d9582e5784 100644
--- a/drivers/net/phy/mscc/mscc_main.c
+++ b/drivers/net/phy/mscc/mscc_main.c
@@ -2656,19 +2656,7 @@  static struct phy_driver vsc85xx_driver[] = {
 module_phy_driver(vsc85xx_driver);
 
 static struct mdio_device_id __maybe_unused vsc85xx_tbl[] = {
-	{ PHY_ID_VSC8504, 0xfffffff0, },
-	{ PHY_ID_VSC8514, 0xfffffff0, },
-	{ PHY_ID_VSC8530, 0xfffffff0, },
-	{ PHY_ID_VSC8531, 0xfffffff0, },
-	{ PHY_ID_VSC8540, 0xfffffff0, },
-	{ PHY_ID_VSC8541, 0xfffffff0, },
-	{ PHY_ID_VSC8552, 0xfffffff0, },
-	{ PHY_ID_VSC856X, 0xfffffff0, },
-	{ PHY_ID_VSC8572, 0xfffffff0, },
-	{ PHY_ID_VSC8574, 0xfffffff0, },
-	{ PHY_ID_VSC8575, 0xfffffff0, },
-	{ PHY_ID_VSC8582, 0xfffffff0, },
-	{ PHY_ID_VSC8584, 0xfffffff0, },
+	{ PHY_ID_MATCH_VENDOR(0xfffffff0) },
 	{ }
 };