From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jian Shen <shenjian15@huawei.com>,
andrew@lunn.ch, f.fainelli@gmail.com, davem@davemloft.net,
sergei.shtylyov@cogentembedded.com
Cc: netdev@vger.kernel.org, forest.zhouchang@huawei.com, linuxarm@huawei.com
Subject: Re: [PATCH net-next] net: phy: force phy suspend when calling phy_stop
Date: Wed, 28 Aug 2019 07:38:41 +0200 [thread overview]
Message-ID: <1d549709-9bbb-a199-9430-bfc2012c1dcb@gmail.com> (raw)
In-Reply-To: <1566956087-37096-1-git-send-email-shenjian15@huawei.com>
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>
next prev parent reply other threads:[~2019-08-28 5:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2019-08-28 23:17 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1d549709-9bbb-a199-9430-bfc2012c1dcb@gmail.com \
--to=hkallweit1@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=forest.zhouchang@huawei.com \
--cc=linuxarm@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=sergei.shtylyov@cogentembedded.com \
--cc=shenjian15@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox