public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] net: phy: realtek: add support for RTL8366S Gigabit PHY
@ 2024-07-25 20:41 Mark Mentovai
  2024-07-26  7:26 ` Maxime Chevallier
  2024-07-26 13:30 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Mark Mentovai @ 2024-07-25 20:41 UTC (permalink / raw)
  To: netdev, Andrew Lunn, Heiner Kallweit, Russell King,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: linux-kernel, Oleksij Rempel, Jonas Gorski, Russell Senior,
	Lóránd Horváth, Mieczyslaw Nalewaj, Shiji Yang,
	Simon Horman

The PHY built in to the Realtek RTL8366S switch controller was
previously supported by genphy_driver. This PHY does not implement MMD
operations. Since commit 9b01c885be36 ("net: phy: c22: migrate to
genphy_c45_write_eee_adv()"), MMD register reads have been made during
phy_probe to determine EEE support. For genphy_driver, these reads are
transformed into 802.3 annex 22D clause 45-over-clause 22
mmd_phy_indirect operations that perform MII register writes to
MII_MMD_CTRL and MII_MMD_DATA. This overwrites those two MII registers,
which on this PHY are reserved and have another function, rendering the
PHY unusable while so configured.

Proper support for this PHY is restored by providing a phy_driver that
declares MMD operations as unsupported by using the helper functions
provided for that purpose, while remaining otherwise identical to
genphy_driver.

Fixes: 9b01c885be36 ("net: phy: c22: migrate to genphy_c45_write_eee_adv()")
Reported-by: Russell Senior <russell@personaltelco.net>
Closes: https://github.com/openwrt/openwrt/issues/15981
Link: https://github.com/openwrt/openwrt/issues/15739
Signed-off-by: Mark Mentovai <mark@mentovai.com>
---
 drivers/net/phy/realtek.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index bed839237fb5..87865918dab6 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -1465,6 +1465,13 @@ static struct phy_driver realtek_drvs[] = {
 		.handle_interrupt = genphy_handle_interrupt_no_ack,
 		.suspend	= genphy_suspend,
 		.resume		= genphy_resume,
+	}, {
+		PHY_ID_MATCH_EXACT(0x001cc960),
+		.name		= "RTL8366S Gigabit Ethernet",
+		.suspend	= genphy_suspend,
+		.resume		= genphy_resume,
+		.read_mmd	= genphy_read_mmd_unsupported,
+		.write_mmd	= genphy_write_mmd_unsupported,
 	},
 };
 
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] net: phy: realtek: add support for RTL8366S Gigabit PHY
  2024-07-25 20:41 [PATCH net v2] net: phy: realtek: add support for RTL8366S Gigabit PHY Mark Mentovai
@ 2024-07-26  7:26 ` Maxime Chevallier
  2024-07-26 13:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Chevallier @ 2024-07-26  7:26 UTC (permalink / raw)
  To: Mark Mentovai
  Cc: netdev, Andrew Lunn, Heiner Kallweit, Russell King,
	David S . Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	linux-kernel, Oleksij Rempel, Jonas Gorski, Russell Senior,
	Lóránd Horváth, Mieczyslaw Nalewaj, Shiji Yang,
	Simon Horman

Hello Mark,

On Thu, 25 Jul 2024 16:41:44 -0400
Mark Mentovai <mark@mentovai.com> wrote:

> The PHY built in to the Realtek RTL8366S switch controller was
> previously supported by genphy_driver. This PHY does not implement MMD
> operations. Since commit 9b01c885be36 ("net: phy: c22: migrate to
> genphy_c45_write_eee_adv()"), MMD register reads have been made during
> phy_probe to determine EEE support. For genphy_driver, these reads are
> transformed into 802.3 annex 22D clause 45-over-clause 22
> mmd_phy_indirect operations that perform MII register writes to
> MII_MMD_CTRL and MII_MMD_DATA. This overwrites those two MII registers,
> which on this PHY are reserved and have another function, rendering the
> PHY unusable while so configured.
> 
> Proper support for this PHY is restored by providing a phy_driver that
> declares MMD operations as unsupported by using the helper functions
> provided for that purpose, while remaining otherwise identical to
> genphy_driver.
> 
> Fixes: 9b01c885be36 ("net: phy: c22: migrate to genphy_c45_write_eee_adv()")
> Reported-by: Russell Senior <russell@personaltelco.net>
> Closes: https://github.com/openwrt/openwrt/issues/15981
> Link: https://github.com/openwrt/openwrt/issues/15739
> Signed-off-by: Mark Mentovai <mark@mentovai.com>

This looks correct to me.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Thanks,

Maxime

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] net: phy: realtek: add support for RTL8366S Gigabit PHY
  2024-07-25 20:41 [PATCH net v2] net: phy: realtek: add support for RTL8366S Gigabit PHY Mark Mentovai
  2024-07-26  7:26 ` Maxime Chevallier
@ 2024-07-26 13:30 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-07-26 13:30 UTC (permalink / raw)
  To: Mark Mentovai
  Cc: netdev, andrew, hkallweit1, linux, davem, edumazet, kuba, pabeni,
	linux-kernel, o.rempel, jonas.gorski, russell, lorand.horvath82,
	namiltd, yangshiji66, horms

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <davem@davemloft.net>:

On Thu, 25 Jul 2024 16:41:44 -0400 you wrote:
> The PHY built in to the Realtek RTL8366S switch controller was
> previously supported by genphy_driver. This PHY does not implement MMD
> operations. Since commit 9b01c885be36 ("net: phy: c22: migrate to
> genphy_c45_write_eee_adv()"), MMD register reads have been made during
> phy_probe to determine EEE support. For genphy_driver, these reads are
> transformed into 802.3 annex 22D clause 45-over-clause 22
> mmd_phy_indirect operations that perform MII register writes to
> MII_MMD_CTRL and MII_MMD_DATA. This overwrites those two MII registers,
> which on this PHY are reserved and have another function, rendering the
> PHY unusable while so configured.
> 
> [...]

Here is the summary with links:
  - [net,v2] net: phy: realtek: add support for RTL8366S Gigabit PHY
    https://git.kernel.org/netdev/net/c/225990c487c1

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-26 13:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-25 20:41 [PATCH net v2] net: phy: realtek: add support for RTL8366S Gigabit PHY Mark Mentovai
2024-07-26  7:26 ` Maxime Chevallier
2024-07-26 13:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox