r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
PATCH 1/1 r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
For pcie nic, after setting link speed and thers is no link driver does not need to do phy reset untill link up.
For some pcie nics, to do this will also reset phy speed down counter and prevent phy from auto speed down.
This patch fix the issue reported in following link.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1547151
--- drivers/net/ethernet/realtek/r8169.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169.c +2 -1
@@ -1999,7 +1999,8 @@ static int rtl8169_set_speed(struct net_device *dev, goto out;if (netif_running (dev) && (autoneg ==AUTONEG_ENABLE ) && - (advertising & ADVERTISED_1000baseT_Full)) { + (advertising & ADVERTISED_1000baseT_Full) && + !pci_is_pcie (tp->pci_dev)) {mod_timer (&tp->timer, jiffies +RTL8169_PHY_TIMEOUT ); } out:
Signature · 1 line
1.9.1
Chunhao Lin <[email protected]> :
Quoted 19 lines
For pcie nic, after setting link speed and thers is no link driver does not need to do phy reset untill link up.
For some pcie nics, to do this will also reset phy speed down counter and prevent phy from auto speed down.
This patch fix the issue reported in following link.
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1547151Signed-off-by Chunhao Lin <[email protected]>--- drivers/net/ethernet/realtek/r8169.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/net/ethernet/realtek/r8169.c +0
-0
drivers/net/ethernet/realtek/r8169.c static int rtl8169_set_speed(struct net_device *dev, · line 2006
Quoted 9 lines
drivers/net/ethernet/realtek/r8169.c +2
-1@@ -1999,7 +1999,8 @@ static int rtl8169_set_speed(struct net_device *dev, goto out;if (netif_running (dev) && (autoneg ==AUTONEG_ENABLE ) && - (advertising & ADVERTISED_1000baseT_Full)) { + (advertising & ADVERTISED_1000baseT_Full) && + !pci_is_pcie (tp->pci_dev)) {mod_timer (&tp->timer, jiffies +RTL8169_PHY_TIMEOUT ); } out:
Can you clarify:
- actually this patch does not care about the link at all. So when there's link no phy reset is needed either, right ?
- does "this" in "to do this" means that
1. phy reset prevents phy from auto speed down
2. avoiding phy reset prevents phy from auto speed down
I would expect 1. from the rtl_wol_pll_power_down + rtl_speed_down + rtl8169_set_speed combo (i.e. we want the driver to allow auto speed down) but it's a bit ambiguous.
Signature · 1 line
Ueimor
[...]
Quoted 10 lines
Can you clarify:
- actually this patch does not care about the link at all. So when there's link no phy reset is needed either, right ?
- does "this" in "to do this" means that
1. phy reset prevents phy from auto speed down
2. avoiding phy reset prevents phy from auto speed down
I would expect 1. from thertl_wol_pll_power_down+rtl_speed_down+rtl8169_set_speedcombo (i.e. we want the driver to allow auto speed
down)
but it's a bit ambiguous.
Unless pcie nic has bug, pcie nic does not need to reset phy to let phy link on.
There is a counter for phy speed down. If phy is in link down state, this counter will start to count down. When it count to 0, phy will speed down. Reset phy will reset this counter and prevent phy from speed down.
------Please consider the environment before printing this e-mail.
Hau <[email protected]> :
[...]
Quoted 5 lines
Unless pcie nic has bug, pcie nic does not need to reset phy to let phy link on.
There is a counter for phy speed down. If phy is in link down state, this counter will start to count down. When it count to 0, phy will speed down. Reset phy will reset this counter and prevent phy from speed down.
Thanks for the clarification.
Signature · 1 line
Ueimor
David Miller
maintainerFrom: Chunhao Lin <[email protected]>
Date: Tue, 8 Mar 2016 16:51:05 +0800
Quoted 2 lines
For pcie nic, after setting link speed and thers is no link driver does not need to do phy reset untill link up.
"there's", "until"
Quoted 2 lines
For some pcie nics, to do this will also reset phy speed down counter and prevent phy from auto speed down.
Please fix these typos and resubmit, thanks.