r8169: fix page read in r8168g_mdio_read
Heiner Kallweit
maintainerPATCH 1/1 r8169: fix page read in r8168g_mdio_read
Functions like phy_modify_paged() read the current page, on Realtek PHY's this means reading the value of register 0x1f. Add special handling for reading this register, similar to what we do already in r8168g_mdio_write(). Currently we read a random value that by chance seems to be 0 always.
--- drivers/net/ethernet/realtek/r8169_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +3 -0
@@ -910,6 +910,9 @@ static void r8168g_mdio_write(struct rtl8169_private *tp, int reg, int value)static int r8168g_mdio_read (struct rtl8169_private *tp,int reg) { +if (reg ==0x1f ) +return tp->ocp_base ==OCP_STD_PHY_BASE ?0 : tp->ocp_base >>4 ; +if (tp->ocp_base !=OCP_STD_PHY_BASE ) reg -=0x10 ;
Signature · 1 line
2.24.0
From: Heiner Kallweit <[email protected]>
Date: Wed, 6 Nov 2019 21:51:31 +0100
Quoted 8 lines
Functions like
phy_modify_paged()read the current page, on Realtek PHY's this means reading the value of register0x1f. Add special handling for reading this register, similar to what we do already inr8168g_mdio_write(). Currently we read a random value that by chance seems to be 0 always.Fixes a2928d28643e ("r8169: use paged versions of phylib MDIO access functions")Signed-off-by Heiner Kallweit <[email protected]>
Applied, thanks.
David Miller
maintainerFrom: David Miller <[email protected]>
Date: Wed, 06 Nov 2019 21:37:58 -0800 (PST)
Quoted 9 lines
From: Heiner Kallweit <[email protected]>
Date: Wed, 6 Nov 2019 21:51:31 +0100Quoted 6 lines
Functions like
phy_modify_paged()read the current page, on Realtek PHY's this means reading the value of register0x1f. Add special handling for reading this register, similar to what we do already inr8168g_mdio_write(). Currently we read a random value that by chance seems to be 0 always.
Quoted 4 lines
Quoted 2 lines
Fixes a2928d28643e ("r8169: use paged versions of phylib MDIO access functions")Signed-off-by Heiner Kallweit <[email protected]>Applied, thanks.
And also queued up for -stable :-)