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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Aug 2022 15:16:39 +0000 (17:16 +0200)
commitc9dabd1f0410b56adf681951eb7493b5388505fb
tree1349e97b1c858dfe00229a5300f2e88cf05e790a
parentc4b38473b18eb2d0195089e832327069638f1200
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@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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/phy/phy_device.c