Netdev List
 help / color / mirror / Atom feed
* [PATCH] net: phy: realtek: Add dummy stubs for MMD register access for rtl8211b
@ 2018-03-19 12:05 Kevin Hao
  2018-03-19 12:39 ` Andrew Lunn
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Hao @ 2018-03-19 12:05 UTC (permalink / raw)
  To: netdev; +Cc: Andrew Lunn, Florian Fainelli, Claudiu Manoil

The Ethernet on mpc8315erdb is broken since commit b6b5e8a69118
("gianfar: Disable EEE autoneg by default"). The reason is that
even though the rtl8211b doesn't support the MMD extended registers
access, it does return some random values if we trying to access
the MMD register via indirect method. This makes it seem that the
EEE is supported by this phy device. And the subsequent writing to
the MMD registers does cause the phy malfunction. So add dummy stubs
for the MMD register access to fix this issue.

Fixes: b6b5e8a69118 ("gianfar: Disable EEE autoneg by default")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
 drivers/net/phy/realtek.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index ee3ca4a2f12b..0a7301ef4ac9 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -103,6 +103,17 @@ static int rtl8211b_config_intr(struct phy_device *phydev)
 	return err;
 }
 
+static int rtl8211b_read_mmd(struct phy_device *phdev, int devad, u16 regnum)
+{
+	return -EINVAL;
+}
+
+static int rtl8211b_write_mmd(struct phy_device *phdev, int devnum, u16 regnum,
+			      u16 val)
+{
+	return -EINVAL;
+}
+
 static int rtl8211e_config_intr(struct phy_device *phydev)
 {
 	int err;
@@ -172,6 +183,8 @@ static struct phy_driver realtek_drvs[] = {
 		.flags		= PHY_HAS_INTERRUPT,
 		.ack_interrupt	= &rtl821x_ack_interrupt,
 		.config_intr	= &rtl8211b_config_intr,
+		.read_mmd	= &rtl8211b_read_mmd,
+		.write_mmd	= &rtl8211b_write_mmd,
 	}, {
 		.phy_id		= 0x001cc914,
 		.name		= "RTL8211DN Gigabit Ethernet",
-- 
2.9.3

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

end of thread, other threads:[~2018-03-19 15:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-19 12:05 [PATCH] net: phy: realtek: Add dummy stubs for MMD register access for rtl8211b Kevin Hao
2018-03-19 12:39 ` Andrew Lunn
2018-03-19 12:51   ` Kevin Hao
2018-03-19 14:31   ` Claudiu Manoil
2018-03-19 15:37     ` Andrew Lunn

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