Skip to contentSkip to conversation

r8169: fix firmware not resetting tp->ocp_base

PATCH In review Heiner Kallweit 2 participants 2 messages Jun 18, 2020 – Jun 21, 2020

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 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 229c1e0dfd3d ("r8169: load firmware for RTL8168fp/RTL8117")
---
 drivers/net/ethernet/realtek/r8169_main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169_main.c +4 -1
index a3c4187d9..98391797b 100644
@@ -2116,8 +2116,11 @@ static void rtl_release_firmware(struct rtl8169_private *tp)
 void r8169_apply_firmware(struct rtl8169_private *tp)
 {
 	/* TODO: release firmware if rtl_fw_write_firmware signals failure. */
-	if (tp->rtl_fw)
+	if (tp->rtl_fw) {
 		rtl_fw_write_firmware(tp, tp->rtl_fw);
+		/* At least one firmware doesn't reset tp->ocp_base. */
+		tp->ocp_base = OCP_STD_PHY_BASE;
+	}
 }
 
 static void rtl8168_config_eee_mac(struct rtl8169_private *tp)
Signature · 1 line
2.27.0
maintainer
#1 lore raw

From: Heiner Kallweit <[email protected]>
Date: Thu, 18 Jun 2020 23:25:50 +0200

Quoted 9 lines

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 229c1e0dfd3d ("r8169: load firmware for RTL8168fp/RTL8117")

Applied and queued up for v5.5 -stable, thanks.