[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1d549709-9bbb-a199-9430-bfc2012c1dcb@gmail.com>
Date: Wed, 28 Aug 2019 07:38:41 +0200
From: Heiner Kallweit <hkallweit1@...il.com>
To: Jian Shen <shenjian15@...wei.com>, andrew@...n.ch,
f.fainelli@...il.com, davem@...emloft.net,
sergei.shtylyov@...entembedded.com
Cc: netdev@...r.kernel.org, forest.zhouchang@...wei.com,
linuxarm@...wei.com
Subject: Re: [PATCH net-next] net: phy: force phy suspend when calling
phy_stop
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@...wei.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@...il.com>
Powered by blists - more mailing lists