All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: phy: force phy suspend when calling phy_stop
@ 2019-08-28  1:34 Jian Shen
  2019-08-28  5:38 ` Heiner Kallweit
  2019-08-28 23:17 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Jian Shen @ 2019-08-28  1:34 UTC (permalink / raw)
  To: andrew, f.fainelli, hkallweit1, davem, sergei.shtylyov
  Cc: netdev, forest.zhouchang, linuxarm

Some ethernet drivers may call phy_start() and phy_stop() from
ndo_open() and ndo_close() respectively.

When network cable is unconnected, and operate like below:
step 1: ifconfig ethX up -> ndo_open -> phy_start ->start
autoneg, and phy is no link.
step 2: ifconfig ethX down -> ndo_close -> phy_stop -> just stop
phy state machine.

This patch forces phy suspend even phydev->link is off.

Signed-off-by: Jian Shen <shenjian15@huawei.com>
---
 drivers/net/phy/phy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index f3adea9..0acd5b4 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -911,8 +911,8 @@ void phy_state_machine(struct work_struct *work)
 		if (phydev->link) {
 			phydev->link = 0;
 			phy_link_down(phydev, true);
-			do_suspend = true;
 		}
+		do_suspend = true;
 		break;
 	}
 
-- 
2.8.1


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

* Re: [PATCH net-next] net: phy: force phy suspend when calling phy_stop
  2019-08-28  1:34 [PATCH net-next] net: phy: force phy suspend when calling phy_stop Jian Shen
@ 2019-08-28  5:38 ` Heiner Kallweit
  2019-08-28 23:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Heiner Kallweit @ 2019-08-28  5:38 UTC (permalink / raw)
  To: Jian Shen, andrew, f.fainelli, davem, sergei.shtylyov
  Cc: netdev, forest.zhouchang, linuxarm

On 28.08.2019 03:34, Jian Shen wrote:
> Some ethernet drivers may call phy_start() and phy_stop() from
> ndo_open() and ndo_close() respectively.
> 
> When network cable is unconnected, and operate like below:
> step 1: ifconfig ethX up -> ndo_open -> phy_start ->start
> autoneg, and phy is no link.
> step 2: ifconfig ethX down -> ndo_close -> phy_stop -> just stop
> phy state machine.
> 
> This patch forces phy suspend even phydev->link is off.
> 
> Signed-off-by: Jian Shen <shenjian15@huawei.com>
> ---
>  drivers/net/phy/phy.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
> index f3adea9..0acd5b4 100644
> --- a/drivers/net/phy/phy.c
> +++ b/drivers/net/phy/phy.c
> @@ -911,8 +911,8 @@ void phy_state_machine(struct work_struct *work)
>  		if (phydev->link) {
>  			phydev->link = 0;
>  			phy_link_down(phydev, true);
> -			do_suspend = true;
>  		}
> +		do_suspend = true;
>  		break;
>  	}
>  
> 
Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com>

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

* Re: [PATCH net-next] net: phy: force phy suspend when calling phy_stop
  2019-08-28  1:34 [PATCH net-next] net: phy: force phy suspend when calling phy_stop Jian Shen
  2019-08-28  5:38 ` Heiner Kallweit
@ 2019-08-28 23:17 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-08-28 23:17 UTC (permalink / raw)
  To: shenjian15
  Cc: andrew, f.fainelli, hkallweit1, sergei.shtylyov, netdev,
	forest.zhouchang, linuxarm

From: Jian Shen <shenjian15@huawei.com>
Date: Wed, 28 Aug 2019 09:34:47 +0800

> Some ethernet drivers may call phy_start() and phy_stop() from
> ndo_open() and ndo_close() respectively.
> 
> When network cable is unconnected, and operate like below:
> step 1: ifconfig ethX up -> ndo_open -> phy_start ->start
> autoneg, and phy is no link.
> step 2: ifconfig ethX down -> ndo_close -> phy_stop -> just stop
> phy state machine.
> 
> This patch forces phy suspend even phydev->link is off.
> 
> Signed-off-by: Jian Shen <shenjian15@huawei.com>

Applied.

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

end of thread, other threads:[~2019-08-28 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28  1:34 [PATCH net-next] net: phy: force phy suspend when calling phy_stop Jian Shen
2019-08-28  5:38 ` Heiner Kallweit
2019-08-28 23:17 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.