Skip to content

Commit 17c2c87

Browse files
Prashanth Kgregkh
authored andcommitted
usb: gadget: u_ether: Set is_suspend flag if remote wakeup fails
Currently while UDC suspends, u_ether attempts to remote wakeup the host if there are any pending transfers. However, if remote wakeup fails, the UDC remains suspended but the is_suspend flag is not set. And since is_suspend flag isn't set, the subsequent eth_start_xmit() would queue USB requests to suspended UDC. To fix this, bail out from gether_suspend() only if remote wakeup operation is successful. Cc: stable <stable@kernel.org> Fixes: 0a1af6d ("usb: gadget: f_ecm: Add suspend/resume and remote wakeup support") Signed-off-by: Prashanth K <prashanth.k@oss.qualcomm.com> Link: https://lore.kernel.org/r/20250212100840.3812153-1-prashanth.k@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c90aad3 commit 17c2c87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/gadget/function/u_ether.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,8 +1052,8 @@ void gether_suspend(struct gether *link)
10521052
* There is a transfer in progress. So we trigger a remote
10531053
* wakeup to inform the host.
10541054
*/
1055-
ether_wakeup_host(dev->port_usb);
1056-
return;
1055+
if (!ether_wakeup_host(dev->port_usb))
1056+
return;
10571057
}
10581058
spin_lock_irqsave(&dev->lock, flags);
10591059
link->is_suspend = true;

0 commit comments

Comments
 (0)