Skip to contentSkip to conversation

r8152: Wake up the system if the we need a reset

PATCH Applied Douglas Anderson 2 participants 2 messages May 30, 2024 – Jun 3, 2024 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 20240530164304.REPOST net-next.1.Ibeda5c0772812ce18953150da5a0888d2d875150@changeid

#1 lore raw

PATCH 2/2 r8152: Wake up the system if the we need a reset

If we get to the end of the r8152's suspend() routine and we find that the USB device is INACCESSIBLE then it means that some of our preparation for suspend didn't take place. We need a USB reset to get ourselves back in a consistent state so we can try again and that can't happen during system suspend. Call pm_wakeup_event() to wake the system up in this case.

---

 drivers/net/usb/r8152.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/usb/r8152.c +7 -0
index 6a3f4b2114ee..09fe70bc45d4 100644
@@ -8647,6 +8647,13 @@ static int rtl8152_system_suspend(struct r8152 *tp)
 		tasklet_enable(&tp->tx_tl);
 	}
 
+	/* If we're inaccessible here then some of the work that we did to
+	 * get the adapter ready for suspend didn't work. Queue up a wakeup
+	 * event so we can try again.
+	 */
+	if (test_bit(RTL8152_INACCESSIBLE, &tp->flags))
+		pm_wakeup_event(&tp->udev->dev, 0);
+
 	return 0;
 }
 
Signature · 1 line
2.45.1.288.g0e0cd299f1-goog
Acked-by on v1 2/2
#2 lore raw

Douglas Anderson <[email protected]>

Quoted 1 line

Sent: Friday, May 31, 2024 7:43 AM

[...]

Quoted 8 lines

If we get to the end of the r8152's suspend() routine and we find that the USB device is INACCESSIBLE then it means that some of our preparation for suspend didn't take place. We need a USB reset to get ourselves back in a consistent state so we can try again and that can't happen during system suspend. Call pm_wakeup_event() to wake the system up in this case.

Best Regards,
Hayes