linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
@ 2016-03-08  8:51 Chunhao Lin
  2016-03-08 23:48 ` Francois Romieu
  2016-03-10 21:18 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Chunhao Lin @ 2016-03-08  8:51 UTC (permalink / raw)
  To: netdev; +Cc: nic_swsd, linux-kernel, Chunhao Lin

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

Signed-off-by: Chunhao Lin <hau@realtek.com>
---
 drivers/net/ethernet/realtek/r8169.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index dd2cf37..94f08f1 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -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:
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
  2016-03-08  8:51 [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped Chunhao Lin
@ 2016-03-08 23:48 ` Francois Romieu
  2016-03-09 16:48   ` Hau
  2016-03-10 21:18 ` David Miller
  1 sibling, 1 reply; 5+ messages in thread
From: Francois Romieu @ 2016-03-08 23:48 UTC (permalink / raw)
  To: Chunhao Lin; +Cc: netdev, nic_swsd, linux-kernel

Chunhao Lin <hau@realtek.com> :
> 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
> 
> Signed-off-by: Chunhao Lin <hau@realtek.com>
> ---
>  drivers/net/ethernet/realtek/r8169.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
> index dd2cf37..94f08f1 100644
> --- a/drivers/net/ethernet/realtek/r8169.c
> +++ b/drivers/net/ethernet/realtek/r8169.c
> @@ -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.

-- 
Ueimor

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
  2016-03-08 23:48 ` Francois Romieu
@ 2016-03-09 16:48   ` Hau
  2016-03-09 21:44     ` Francois Romieu
  0 siblings, 1 reply; 5+ messages in thread
From: Hau @ 2016-03-09 16:48 UTC (permalink / raw)
  To: Francois Romieu; +Cc: netdev, nic_swsd, linux-kernel

[...] 
> 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.

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
  2016-03-09 16:48   ` Hau
@ 2016-03-09 21:44     ` Francois Romieu
  0 siblings, 0 replies; 5+ messages in thread
From: Francois Romieu @ 2016-03-09 21:44 UTC (permalink / raw)
  To: Hau; +Cc: netdev, nic_swsd, linux-kernel

Hau <hau@realtek.com> :
[...] 
> 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.

-- 
Ueimor

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped.
  2016-03-08  8:51 [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped Chunhao Lin
  2016-03-08 23:48 ` Francois Romieu
@ 2016-03-10 21:18 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2016-03-10 21:18 UTC (permalink / raw)
  To: hau; +Cc: netdev, nic_swsd, linux-kernel

From: Chunhao Lin <hau@realtek.com>
Date: Tue, 8 Mar 2016 16:51:05 +0800

> 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"

> 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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-03-10 21:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-08  8:51 [PATCH net] r8169:Remove unnecessary phy reset for pcie nic when setting link spped Chunhao Lin
2016-03-08 23:48 ` Francois Romieu
2016-03-09 16:48   ` Hau
2016-03-09 21:44     ` Francois Romieu
2016-03-10 21:18 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).