linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: phy: realtek: fix RTL8211F interrupt mode
@ 2017-11-12 15:16 Heiner Kallweit
  2017-11-12 18:25 ` Andrew Lunn
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Heiner Kallweit @ 2017-11-12 15:16 UTC (permalink / raw)
  To: linus-amlogic

After commit b94d22d94ad22 "ARM64: dts: meson-gx: add external PHY
interrupt on some platforms" ethernet stopped working on my Odroid-C2
which has a RTL8211F phy.

It turned out that no interrupts were triggered. Further analysis
showed the register INER can't be altered on page 0.
Because register INSR needs to be accessed via page 0xa43 I assumed
that register INER needs to be accessed via some page too.
Some brute force check resulted in page 0xa42 being the right one.

With this patch the phy is working properly in interrupt mode.

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/phy/realtek.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/phy/realtek.c b/drivers/net/phy/realtek.c
index d4670ecdb..eda0a6e86 100644
--- a/drivers/net/phy/realtek.c
+++ b/drivers/net/phy/realtek.c
@@ -115,11 +115,13 @@ static int rtl8211f_config_intr(struct phy_device *phydev)
 {
 	int err;
 
+	phy_write(phydev, RTL821x_PAGE_SELECT, 0xa42);
 	if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
 		err = phy_write(phydev, RTL821x_INER,
 				RTL8211F_INER_LINK_STATUS);
 	else
 		err = phy_write(phydev, RTL821x_INER, 0);
+	phy_write(phydev, RTL821x_PAGE_SELECT, 0);
 
 	return err;
 }
-- 
2.15.0

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

end of thread, other threads:[~2017-12-02 17:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-12 15:16 [PATCH] net: phy: realtek: fix RTL8211F interrupt mode Heiner Kallweit
2017-11-12 18:25 ` Andrew Lunn
2017-11-12 18:36   ` Jerome Brunet
2017-11-12 20:06     ` Andrew Lunn
2017-11-12 20:10       ` Jerome Brunet
2017-11-12 18:29 ` Florian Fainelli
2017-11-12 18:39   ` Jerome Brunet
2017-11-13 16:36 ` Jerome Brunet
2017-11-14 12:34 ` David Miller
2017-12-02 17:14 ` Martin Blumenstingl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).