Skip to contentSkip to conversation

net: phy: add LAN8742 phy support

PATCH Applied Yuiko Oshino 4 participants 12 messages May 5, 2022 – May 9, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v4 cover net: phy: add LAN8742 phy support

add LAN8742 phy support
update LAN88xx phy ID and phy ID mask so that it can coexist with LAN8742

The current phy IDs on the available hardware.

    LAN8742 0x0007C130, 0x0007C131
    LAN88xx 0x0007C132

v3->v4:
- fixed the one tab missing issue in the smsc.c.

v2->v3:
-added comments about the 0xfffffff2 mask that is for the differentiation and the future revisions.

v1->v2:
-removed "REVIEW REQUEST3" from the PATCH 1/2.

Yuiko Oshino (2):
net: phy: microchip: update LAN88xx phy ID and phy ID mask.
net: phy: smsc: add LAN8742 phy support.

 drivers/net/phy/microchip.c |  6 +++---
 drivers/net/phy/smsc.c      | 27 +++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)
Signature · 1 line
2.25.1
#1 lore raw

PATCH v4 1/2 net: phy: microchip: update LAN88xx phy ID and phy ID mask.

update LAN88xx phy ID and phy ID mask because the existing code conflicts with the LAN8742 phy.

The current phy IDs on the available hardware.

        LAN8742 0x0007C130, 0x0007C131
        LAN88xx 0x0007C132
---
 drivers/net/phy/microchip.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/phy/microchip.c +3 -3
index 9f1f2b6c97d4..131caf659ed2 100644
@@ -344,8 +344,8 @@ static int lan88xx_config_aneg(struct phy_device *phydev)
 
 static struct phy_driver microchip_phy_driver[] = {
 {
-	.phy_id		= 0x0007c130,
-	.phy_id_mask	= 0xfffffff0,
+	.phy_id		= 0x0007c132,
+	.phy_id_mask	= 0xfffffff2,
 	.name		= "Microchip LAN88xx",
 
 	/* PHY_GBIT_FEATURES */
@@ -369,7 +369,7 @@ static struct phy_driver microchip_phy_driver[] = {
 module_phy_driver(microchip_phy_driver);
 
 static struct mdio_device_id __maybe_unused microchip_tbl[] = {
-	{ 0x0007c130, 0xfffffff0 },
+	{ 0x0007c132, 0xfffffff2 },
 	{ }
 };
 
Signature · 1 line
2.25.1
#2 lore raw

PATCH v4 2/2 net: phy: smsc: add LAN8742 phy support.

In reply to Yuiko Oshino

The current phy IDs on the available hardware.

        LAN8742 0x0007C130, 0x0007C131
---
 drivers/net/phy/smsc.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
drivers/net/phy/smsc.c +27 -0
index d8cac02a79b9..44fa9e00cc50 100644
@@ -481,6 +481,32 @@ static struct phy_driver smsc_phy_driver[] = {
 	.get_strings	= smsc_get_strings,
 	.get_stats	= smsc_get_stats,
 
+	.suspend	= genphy_suspend,
+	.resume		= genphy_resume,
+}, {
+	.phy_id	= 0x0007c130,	/* 0x0007c130 and 0x0007c131 */
+	.phy_id_mask	= 0xfffffff2,
+	.name		= "Microchip LAN8742",
+
+	/* PHY_BASIC_FEATURES */
+	.flags		= PHY_RST_AFTER_CLK_EN,
+
+	.probe		= smsc_phy_probe,
+
+	/* basic functions */
+	.read_status	= lan87xx_read_status,
+	.config_init	= smsc_phy_config_init,
+	.soft_reset	= smsc_phy_reset,
+
+	/* IRQ related */
+	.config_intr	= smsc_phy_config_intr,
+	.handle_interrupt = smsc_phy_handle_interrupt,
+
+	/* Statistics */
+	.get_sset_count = smsc_get_sset_count,
+	.get_strings	= smsc_get_strings,
+	.get_stats	= smsc_get_stats,
+
 	.suspend	= genphy_suspend,
 	.resume		= genphy_resume,
 } };
@@ -498,6 +524,7 @@ static struct mdio_device_id __maybe_unused smsc_tbl[] = {
 	{ 0x0007c0d0, 0xfffffff0 },
 	{ 0x0007c0f0, 0xfffffff0 },
 	{ 0x0007c110, 0xfffffff0 },
+	{ 0x0007c130, 0xfffffff2 },
 	{ }
 };
 
Signature · 1 line
2.25.1
maintainer
#4 lore raw

Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

Quoted 7 lines · On Thu, 5 May 2022 21:29:13 +0200 Andrew Lunn wrote:
Quoted 4 lines · Yuiko Oshino

The current phy IDs on the available hardware.

        LAN8742 0x0007C130, 0x0007C131

The comments which I think were requested in the review of v2 and appeared in v3 are now gone, again. Is that okay?

maintainer
#5 lore raw

Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

Quoted 11 lines · Jakub Kicinski
Quoted 7 lines · On Thu, 5 May 2022 21:29:13 +0200 Andrew Lunn wrote:
Quoted 4 lines · Yuiko Oshino

The current phy IDs on the available hardware.

        LAN8742 0x0007C130, 0x0007C131

The comments which I think were requested in the review of v2 and appeared in v3 are now gone, again. Is that okay?

Ah, i had not noticed. Thanks for pointing it out.

Those comments are important, since these mask are odd, somebody is either going to ask about them, or try to 'fix' them. Some robot will fall over them, etc.

Andrew

#6 lore raw

RE: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

Quoted 26 lines

-----Original Message-----
From: Andrew Lunn <[email protected]>
Sent: Saturday, May 7, 2022 9:49 AM
To: Jakub Kicinski <[email protected]>
Cc: Yuiko Oshino - C18177 <[email protected]>; Woojung Huh - C21699 <[email protected]>; [email protected]; [email protected]; Ravi Hegde - C21689 <[email protected]>; UNGLinuxDriver <[email protected]>
Subject: Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 11 lines · Jakub Kicinski
Quoted 7 lines · On Thu, 5 May 2022 21:29:13 +0200 Andrew Lunn wrote:
Quoted 4 lines · Yuiko Oshino

The current phy IDs on the available hardware.

        LAN8742 0x0007C130, 0x0007C131

The comments which I think were requested in the review of v2 and appeared in v3 are now gone, again. Is that okay?

Quoted 6 lines

Ah, i had not noticed. Thanks for pointing it out.

Those comments are important, since these mask are odd, somebody is either going to ask about them, or try to 'fix' them. Some robot will fall over them, etc.

Andrew

Hi Andrew and Jakub,
I see that the patches are already applied to net-next?
So should I create a new series with the missing comments only rather than doing v5? Please let me know.
Thank you.
Yuiko

maintainer
#7 lore raw

Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

Quoted 2 lines

So should I create a new series with the missing comments only rather than doing v5?

Yes please.

Andrew

#8 lore raw

RE: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

Quoted 12 lines

-----Original Message-----
From: Andrew Lunn <[email protected]>
Sent: Monday, May 9, 2022 9:51 AM
To: Yuiko Oshino - C18177 <[email protected]>
Cc: [email protected]; Woojung Huh - C21699 <[email protected]>; [email protected]; [email protected]; Ravi Hegde - C21689 <[email protected]>; UNGLinuxDriver <[email protected]>
Subject: Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 6 lines
Quoted 2 lines

So should I create a new series with the missing comments only rather than doing v5?

Yes please.

Andrew

May I also fix this missing one tab after the phy_id in smsc.c in the same patch?

+ .phy_id = 0x0007c130, /* 0x0007c130 and 0x0007c131 */
+ .phy_id_mask = 0xfffffff2,
+

maintainer
#9 lore raw

Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

Review

Quoted 5 lines · On Mon, 9 May 2022 14:24:44 +0000 [email protected] wrote:

May I also fix this missing one tab after the phy_id in smsc.c in the same patch?

(quoted diff) +3 -0
+	.phy_id	= 0x0007c130,	/* 0x0007c130 and 0x0007c131 */
+	.phy_id_mask	= 0xfffffff2,
+

Seems like an okay change to make in addition in adding the comments. Both are non-functional changes, anyway.

#10 lore raw

RE: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

In reply to Jakub Kicinski
Quoted 18 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Friday, May 6, 2022 6:45 PM
To: Andrew Lunn <[email protected]>
Cc: Yuiko Oshino - C18177 <[email protected]>; Woojung Huh - C21699 <[email protected]>; [email protected]; [email protected]; Ravi Hegde - C21689 <[email protected]>; UNGLinuxDriver <[email protected]>
Subject: Re: [PATCH v4 net-next 2/2] net: phy: smsc: add LAN8742 phy support.

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 4 lines · On Thu, 5 May 2022 21:29:13 +0200 Andrew Lunn wrote:
Quoted 3 lines · Yuiko Oshino

The current phy IDs on the available hardware.

        LAN8742 0x0007C130, 0x0007C131
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

The comments which I think were requested in the review of v2 and appeared in v3 are now gone, again. Is that okay?

Thank you for the review.
Sorry, I will fix it (add the comments) and re-submit. Yuiko

#11 lore raw
In reply to Yuiko Oshino
This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Hello:

This series was applied to netdev/net-next.git (master) by David S. Miller <[email protected]>:

Quoted 8 lines · On Thu, 5 May 2022 11:12:50 -0700 you wrote:

add LAN8742 phy support
update LAN88xx phy ID and phy ID mask so that it can coexist with LAN8742

The current phy IDs on the available hardware.

    LAN8742 0x0007C130, 0x0007C131
    LAN88xx 0x0007C132

[...]

Here is the summary with links:
- [v4,net-next,1/2] net: phy: microchip: update LAN88xx phy ID and phy ID mask.

    https://git.kernel.org/netdev/net-next/c/e078286a1375
  - [v4,net-next,2/2] net: phy: smsc: add LAN8742 phy support.
    https://git.kernel.org/netdev/net-next/c/53ad22868289

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html