Re: [PATCH net-next 3/3] net: usb: smsc95xx: suspend PHY during USB suspend
From: Oliver Neukum <oneukum@suse.com>
Date: 2026-03-30 17:39:45
Also in:
linux-usb
On 30.03.26 15:42, Parthiban Veerasooran wrote:
quoted hunk ↗ jump to hunk
The smsc95xx driver registers a PHY device but does not currently propagate suspend events to it when the USB interface is suspended. Call phy_suspend() from the driver's suspend callback so the attached PHY can properly enter low-power state during system or runtime suspend. This aligns smsc95xx suspend handling with other network drivers that manage an external or integrated PHY. Without this, the PHY may remain active and fail to execute its own suspend procedure, leading to unnecessary power consumption or incorrect resume behavior. This change is also required for the EVB-LAN8670-USB Rev.D0 device to support OATC10-compliant sleep and wake functionality. Signed-off-by: Parthiban Veerasooran <parthiban.veerasooran@microchip.com> --- drivers/net/usb/smsc95xx.c | 6 ++++++ 1 file changed, 6 insertions(+)diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index 42e4048b574b..3a6e03b7410a 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c@@ -1550,6 +1550,12 @@ static int smsc95xx_suspend(struct usb_interface *intf, pm_message_t message) pdata->pm_task = current; + if (pdata->phydev) { + ret = phy_suspend(pdata->phydev); + if (ret) + return ret; + }
At this point you have suspended the phy. Hence the device can no longer transmit
+ ret = usbnet_suspend(intf, message);
This wants to 1. drain the queue if you do runtime PM 2. can return -EBUSY
if (ret < 0) {
netdev_warn(dev->net, "usbnet_suspend error\n");And here it will return in the error case. With the phy already suspended. And, as a question of principle: Why do you suspend the phy in suspend(), but take no action in resume()? Regards Oliver