mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v1 1/1] net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups
@ 2025-09-08 11:26 Oleksij Rempel
  2025-09-08 17:00 ` Hubert Wiśniewski
                   ` (4 more replies)
  0 siblings, 5 replies; 21+ messages in thread
From: Oleksij Rempel @ 2025-09-08 11:26 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Oleksij Rempel, Hubert Wiśniewski, stable, kernel,
	linux-kernel, netdev, Lukas Wunner, Russell King, Xu Yang,
	linux-usb

Drop phylink_{suspend,resume}() from ax88772 PM callbacks.

MDIO bus accesses have their own runtime-PM handling and will try to
wake the device if it is suspended. Such wake attempts must not happen
from PM callbacks while the device PM lock is held. Since phylink
{sus|re}sume may trigger MDIO, it must not be called in PM context.

No extra phylink PM handling is required for this driver:
- .ndo_open/.ndo_stop control the phylink start/stop lifecycle.
- ethtool/phylib entry points run in process context, not PM.
- phylink MAC ops program the MAC on link changes after resume.

Fixes: e0bffe3e6894 ("net: asix: ax88772: migrate to phylink")
Reported-by: Hubert Wiśniewski <hubert.wisniewski.25632@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
---
 drivers/net/usb/asix_devices.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index 792ddda1ad49..1e8f7089f5e8 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -607,15 +607,8 @@ static const struct net_device_ops ax88772_netdev_ops = {

 static void ax88772_suspend(struct usbnet *dev)
 {
-	struct asix_common_private *priv = dev->driver_priv;
 	u16 medium;

-	if (netif_running(dev->net)) {
-		rtnl_lock();
-		phylink_suspend(priv->phylink, false);
-		rtnl_unlock();
-	}
-
 	/* Stop MAC operation */
 	medium = asix_read_medium_status(dev, 1);
 	medium &= ~AX_MEDIUM_RE;
@@ -644,12 +637,6 @@ static void ax88772_resume(struct usbnet *dev)
 	for (i = 0; i < 3; i++)
 		if (!priv->reset(dev, 1))
 			break;
-
-	if (netif_running(dev->net)) {
-		rtnl_lock();
-		phylink_resume(priv->phylink);
-		rtnl_unlock();
-	}
 }

 static int asix_resume(struct usb_interface *intf)
--
2.47.3


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

end of thread, other threads:[~2025-09-16 14:43 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-08 11:26 [PATCH net v1 1/1] net: usb: asix: ax88772: drop phylink use in PM to avoid MDIO runtime PM wakeups Oleksij Rempel
2025-09-08 17:00 ` Hubert Wiśniewski
2025-09-09  7:17   ` Oleksij Rempel
2025-09-09 23:56     ` Jakub Kicinski
2025-09-10  4:16       ` Oleksij Rempel
2025-09-09  2:05 ` Xu Yang
2025-09-09 23:58 ` Jakub Kicinski
2025-09-10  4:11   ` Oleksij Rempel
2025-09-11  0:50     ` Jakub Kicinski
2025-09-11  1:00 ` patchwork-bot+netdevbpf
     [not found] ` <CGME20250911135853eucas1p283b1afd37287b715403cd2cdbfa03a94@eucas1p2.samsung.com>
2025-09-11 13:58   ` Marek Szyprowski
2025-09-11 14:39     ` Russell King (Oracle)
2025-09-11 14:55       ` Jakub Kicinski
2025-09-11 20:46         ` Russell King (Oracle)
2025-09-12  2:30           ` Alan Stern
2025-09-12  8:33             ` Russell King (Oracle)
2025-09-12 14:29               ` Alan Stern
2025-09-12 14:37                 ` Russell King (Oracle)
2025-09-13  6:45                   ` Oleksij Rempel
2025-09-16  7:18                     ` Oleksij Rempel
2025-09-16 14:42                       ` Jakub Kicinski

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®