net: phy: Warn about incorrect mdio_bus_phy_resume() state
commit 744d23c7 upstream. Calling mdio_bus_phy_resume() with neither the PHY state machine set to PHY_HALTED nor phydev->mac_managed_pm set to true is a good indication that we can produce a race condition looking like this: CPU0 CPU1 bcmgenet_resume -> phy_resume -> phy_init_hw -> phy_start -> phy_resume phy_start_aneg() mdio_bus_phy_resume -> phy_resume -> phy_write(..., BMCR_RESET) -> usleep() -> phy_read() with the phy_resume() function triggering a PHY behavior that might have to be worked around with (see bf8bfc43 ("net: phy: broadcom: Fix brcm_fet_config_init()") for instance) that ultimately leads to an error reading from the PHY. Fixes: fba863b8 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") Signed-off-by:Florian Fainelli <f.fainelli@gmail.com> Link: https://lore.kernel.org/r/20220801233403.258871-1-f.fainelli@gmail.com Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Loading
-
mentioned in commit 44580aa8
-
mentioned in commit 11877008
-
mentioned in commit 78d884d2
-
mentioned in commit 24727b50
-
mentioned in commit d2a6b942
-
mentioned in commit 5a0aa367
-
mentioned in commit fc9e48c2
-
mentioned in commit 12de6f56
-
mentioned in commit 00e99e93
-
mentioned in commit 881dc0b5
-
mentioned in commit 881dc0b5
-
mentioned in commit 20e38b2e
-
mentioned in commit e1411fa3
Please register or sign in to comment