mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-07 14:24:18 +08:00
net: phy: force phy suspend when calling phy_stop
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> Reviewed-by: Heiner Kallweit <hkallweit1@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8e4a2adced
commit
95fb8bb318
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user