1
0
Fork 0

net: phy: Do not warn in phy_stop() on PHY_DOWN

[ Upstream commit 5116a8ade3 ]

When phy_is_started() was added to catch incorrect PHY states,
phy_stop() would not be qualified against PHY_DOWN. It is possible to
reach that state when the PHY driver has been unbound and the network
device is then brought down.

Fixes: 2b3e88ea65 ("net: phy: improve phy state checking")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
5.4-rM2-2.2.x-imx-squashed
Florian Fainelli 2020-09-16 20:43:10 -07:00 committed by Greg Kroah-Hartman
parent 94f2dc7ad0
commit e78590497f
1 changed files with 1 additions and 1 deletions

View File

@ -834,7 +834,7 @@ EXPORT_SYMBOL(phy_free_interrupt);
*/
void phy_stop(struct phy_device *phydev)
{
if (!phy_is_started(phydev)) {
if (!phy_is_started(phydev) && phydev->state != PHY_DOWN) {
WARN(1, "called from state %s\n",
phy_state_to_str(phydev->state));
return;