Commit 3697d058 authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

net: phy: realtek: fix RTL8211F interrupt mode

After commit b94d22d9 "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.

Fixes: 3447cf2e ("net/phy: Add support for Realtek RTL8211F")
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Tested-by: default avatarJerome Brunet <jbrunet@baylibre.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0522bab1
...@@ -115,11 +115,13 @@ static int rtl8211f_config_intr(struct phy_device *phydev) ...@@ -115,11 +115,13 @@ static int rtl8211f_config_intr(struct phy_device *phydev)
{ {
int err; int err;
phy_write(phydev, RTL821x_PAGE_SELECT, 0xa42);
if (phydev->interrupts == PHY_INTERRUPT_ENABLED) if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
err = phy_write(phydev, RTL821x_INER, err = phy_write(phydev, RTL821x_INER,
RTL8211F_INER_LINK_STATUS); RTL8211F_INER_LINK_STATUS);
else else
err = phy_write(phydev, RTL821x_INER, 0); err = phy_write(phydev, RTL821x_INER, 0);
phy_write(phydev, RTL821x_PAGE_SELECT, 0);
return err; return err;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment