Skip to content

Commit 89fbd26

Browse files
hkallweitdavem330
authored andcommitted
r8169: fix firmware not resetting tp->ocp_base
Typically the firmware takes care that tp->ocp_base is reset to its default value. That's not the case (at least) for RTL8117. As a result subsequent PHY access reads/writes the wrong page and the link is broken. Fix this be resetting tp->ocp_base explicitly. Fixes: 229c1e0 ("r8169: load firmware for RTL8168fp/RTL8117") Reported-by: Aaron Ma <[email protected]> Tested-by: Aaron Ma <[email protected]> Signed-off-by: Heiner Kallweit <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8b40eb7 commit 89fbd26

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/realtek/r8169_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2114,8 +2114,11 @@ static void rtl_release_firmware(struct rtl8169_private *tp)
21142114
void r8169_apply_firmware(struct rtl8169_private *tp)
21152115
{
21162116
/* TODO: release firmware if rtl_fw_write_firmware signals failure. */
2117-
if (tp->rtl_fw)
2117+
if (tp->rtl_fw) {
21182118
rtl_fw_write_firmware(tp, tp->rtl_fw);
2119+
/* At least one firmware doesn't reset tp->ocp_base. */
2120+
tp->ocp_base = OCP_STD_PHY_BASE;
2121+
}
21192122
}
21202123

21212124
static void rtl8168_config_eee_mac(struct rtl8169_private *tp)

0 commit comments

Comments
 (0)