net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume()
authorXiaolei Wang <xiaolei.wang@windriver.com>
Fri, 19 Aug 2022 08:24:51 +0000 (16:24 +0800)
committerJakub Kicinski <kuba@kernel.org>
Tue, 23 Aug 2022 01:14:10 +0000 (18:14 -0700)
commit6dbe852c379ff032a70a6b13a91914918c82cb07
treefa26b4a25507ff34867a8e35bc50f8225bd25ebd
parentb8d4380365c515d8e0351f2f46d371738dd19be1
net: phy: Don't WARN for PHY_READY state in mdio_bus_phy_resume()

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@windriver.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220819082451.1992102-1-xiaolei.wang@windriver.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/phy_device.c