Patch "net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-phy-don-t-warn-for-phy_ready-state-in-mdio_bus_p.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9cf64e37ca942aff05e008867830125f6ef13105
Author: Xiaolei Wang <xiaolei.wang@xxxxxxxxxxxxx>
Date:   Fri Aug 19 16:24:51 2022 +0800

    net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume()
    
    [ Upstream commit 6dbe852c379ff032a70a6b13a91914918c82cb07 ]
    
    For some MAC drivers, they set the mac_managed_pm to true in its
    ->ndo_open() callback. So before the mac_managed_pm is set to true,
    we still want to leverage the mdio_bus_phy_suspend()/resume() for
    the phy device suspend and resume. In this case, the phy device is
    in PHY_READY, and we shouldn't warn about this. It also seems that
    the check of mac_managed_pm in WARN_ON is redundant since we already
    check this in the entry of mdio_bus_phy_resume(), so drop it.
    
    Fixes: 744d23c71af3 ("net: phy: Warn about incorrect mdio_bus_phy_resume() state")
    Signed-off-by: Xiaolei Wang <xiaolei.wang@xxxxxxxxxxxxx>
    Acked-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Link: https://lore.kernel.org/r/20220819082451.1992102-1-xiaolei.wang@xxxxxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index 834a68d758327..b616f55ea222a 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -315,11 +315,11 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev)
 
 	phydev->suspended_by_mdio_bus = 0;
 
-	/* If we managed to get here with the PHY state machine in a state other
-	 * than PHY_HALTED this is an indication that something went wrong and
-	 * we should most likely be using MAC managed PM and we are not.
+	/* If we manged to get here with the PHY state machine in a state neither
+	 * PHY_HALTED nor PHY_READY this is an indication that something went wrong
+	 * and we should most likely be using MAC managed PM and we are not.
 	 */
-	WARN_ON(phydev->state != PHY_HALTED && !phydev->mac_managed_pm);
+	WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY);
 
 	ret = phy_init_hw(phydev);
 	if (ret < 0)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux