Skip to contentSkip to conversation

r8169: remove not needed PHY soft reset in rtl8168e_2_hw_phy_config

PATCH In review Heiner Kallweit 2 participants 4 messages Feb 20, 2018 – Feb 21, 2018

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 r8169: remove not needed PHY soft reset in rtl8168e_2_hw_phy_config

rtl8169_init_phy() resets the PHY anyway after applying the chip-specific PHY configuration. So we don't need to soft-reset the PHY as part of the chip-specific configuration.

---
 drivers/net/ethernet/realtek/r8169.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/realtek/r8169.c +0 -2
index 0bf7d1759..92b50b688 100644
@@ -3805,8 +3805,6 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0005);
 	rtl_w0w1_phy(tp, 0x01, 0x0100, 0x0000);
 	rtl_writephy(tp, 0x1f, 0x0000);
-	/* soft-reset phy */
-	rtl_writephy(tp, MII_BMCR, BMCR_RESET | BMCR_ANENABLE | BMCR_ANRESTART);
 
 	/* Broken BIOS workaround: feed GigaMAC registers with MAC address. */
 	rtl_rar_exgmac_set(tp, tp->dev->dev_addr);
Signature · 1 line
2.16.1
maintainer
#1 lore raw

From: Heiner Kallweit <[email protected]>
Date: Tue, 20 Feb 2018 07:30:16 +0100

Quoted 5 lines

rtl8169_init_phy() resets the PHY anyway after applying the chip-specific PHY configuration. So we don't need to soft-reset the PHY as part of the chip-specific configuration.

I'm not so comfortable with this.

There are so many r8169 chip variants out there.

And who knows, maybe one of them needs this second PHY reset or due to some way the driver is coded it is necessary.

Unless you can test this change on every r8169 chip type, I'm very reluctant to apply this patch.

Sorry.

author maintainer
#2 lore raw

Am 21.02.2018 um 05:27 schrieb David Miller:

Quoted 11 lines

From: Heiner Kallweit <[email protected]>
Date: Tue, 20 Feb 2018 07:30:16 +0100

Quoted 5 lines

rtl8169_init_phy() resets the PHY anyway after applying the chip-specific PHY configuration. So we don't need to soft-reset the PHY as part of the chip-specific configuration.

I'm not so comfortable with this.

Quoted 8 lines

There are so many r8169 chip variants out there.

And who knows, maybe one of them needs this second PHY reset or due to some way the driver is coded it is necessary.

Unless you can test this change on every r8169 chip type, I'm very reluctant to apply this patch.

I understand the concern, the change however is in rtl8168e_2_hw_phy_config() which is specific to chip version 34 (RTL8168evl).
On my system with this chip version the change didn't change system behavior.

Quoted 2 lines

Sorry.

maintainer
#3 lore raw

From: Heiner Kallweit <[email protected]>
Date: Wed, 21 Feb 2018 07:29:24 +0100

Quoted 17 lines

Am 21.02.2018 um 05:27 schrieb David Miller:

Quoted 16 lines

From: Heiner Kallweit <[email protected]>
Date: Tue, 20 Feb 2018 07:30:16 +0100

Quoted 5 lines

rtl8169_init_phy() resets the PHY anyway after applying the chip-specific PHY configuration. So we don't need to soft-reset the PHY as part of the chip-specific configuration.

I'm not so comfortable with this.

There are so many r8169 chip variants out there.

And who knows, maybe one of them needs this second PHY reset or due to some way the driver is coded it is necessary.

Quoted 6 lines
Quoted 3 lines

Unless you can test this change on every r8169 chip type, I'm very reluctant to apply this patch.

I understand the concern, the change however is in rtl8168e_2_hw_phy_config() which is specific to chip version 34 (RTL8168evl).
On my system with this chip version the change didn't change system behavior.

Ok, that does alleviate my concerns.

Patch applied, thank you.