mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net] net: ethernet: ave: Remove duplicate suspend/resume calls for phy
@ 2022-10-21 17:45 Kunihiko Hayashi
  2022-10-21 20:55 ` Heiner Kallweit
  0 siblings, 1 reply; 3+ messages in thread
From: Kunihiko Hayashi @ 2022-10-21 17:45 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: netdev, linux-kernel, Kunihiko Hayashi

Since AVE has its own suspend/resume functions, there is no need to call
mdio_bus suspend/resume functions. Set phydev->mac_managed_pm to true
to avoid the calls.

In addition, ave_open() executes __phy_resume() via phy_start() in
ave_resume(), so no need to call phy_resume() explicitly. Remove it.

Suggested-by: Heiner Kallweit <hkallweit1@gmail.com>
Fixes: 0ba78b4a4989 ("net: ethernet: ave: Add suspend/resume support")
Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/net/ethernet/socionext/sni_ave.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index 14cdd2e8373c..b4e0c57af7c3 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -1271,6 +1271,8 @@ static int ave_init(struct net_device *ndev)
 
 	phy_support_asym_pause(phydev);
 
+	phydev->mac_managed_pm = true;
+
 	phy_attached_info(phydev);
 
 	return 0;
@@ -1806,12 +1808,6 @@ static int ave_resume(struct device *dev)
 	wol.wolopts = priv->wolopts;
 	__ave_ethtool_set_wol(ndev, &wol);
 
-	if (ndev->phydev) {
-		ret = phy_resume(ndev->phydev);
-		if (ret)
-			return ret;
-	}
-
 	if (netif_running(ndev)) {
 		ret = ave_open(ndev);
 		netif_device_attach(ndev);
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-22 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-21 17:45 [PATCH net] net: ethernet: ave: Remove duplicate suspend/resume calls for phy Kunihiko Hayashi
2022-10-21 20:55 ` Heiner Kallweit
2022-10-22 17:29   ` Kunihiko Hayashi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®