提交 e435d318 编写于 作者: J Jian Shen 提交者: Xie XiuQi

net: phy: force phy suspend when calling phy_stop

mainline inclusion
from mainline-v5.3
commit 95fb8bb3181bbe1ee87c95e91dff94f74f148c33
category: bugfix
bugzilla: NA
CVE: NA

-------------------------------------------------

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: NJian Shen <shenjian15@huawei.com>
Reviewed-by: NHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
Reviewed-by: NYunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 f993f8cc
......@@ -1060,8 +1060,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;
case PHY_RESUMING:
if (AUTONEG_ENABLE == phydev->autoneg) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册