net: ethernet: ave: Fix MAC to be in charge of PHY PM
authorKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Mon, 24 Oct 2022 07:22:27 +0000 (16:22 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Nov 2022 14:59:18 +0000 (23:59 +0900)
commit77a754fcfec138e8d8a29c3ed9d4f54c022a6013
treea78ac8895b1af204535d205196cb276201e4feab
parentbc2518ec710ecb5a35124e2dc61778dbb973d584
net: ethernet: ave: Fix MAC to be in charge of PHY PM

[ Upstream commit e2badb4bd33abe13ddc35975bd7f7f8693955a4b ]

The phylib callback is called after MAC driver's own resume callback is
called. For AVE driver, after resuming immediately, PHY state machine is
in PHY_NOLINK because there is a time lag from link-down to link-up due to
autoneg. The result is WARN_ON() dump in mdio_bus_phy_resume().

Since ave_resume() itself calls phy_resume(), AVE driver should manage
PHY PM. To indicate that MAC driver manages PHY PM, set
phydev->mac_managed_pm to true to avoid the unnecessary phylib call and
add missing phy_init_hw() to ave_resume().

Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
Fixes: fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Link: https://lore.kernel.org/r/20221024072227.24769-1-hayashi.kunihiko@socionext.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/socionext/sni_ave.c