Thread (6 messages) 6 messages, 2 authors, 2025-09-05

Re: [PATCH] net: usbnet: skip info->stop() callback if suspend_count is not 0

From: Oliver Neukum <oneukum@suse.com>
Date: 2025-09-04 07:52:06
Also in: linux-usb


On 9/4/25 09:26, Xu Yang wrote:
quoted
quoted
   	/* allow minidriver to stop correctly (wireless devices to turn off
   	 * radio etc) */
-	if (info->stop) {
+	if (info->stop && !dev->suspend_count) {
... for !dev->suspend_count to be false
The suspend_count won't go to 0 because there is no chance to call
usbnet_resume() if the USB device is physically disconnected from the
USB port during system suspend.
Sorry for the delay.

While you are correct that a physical disconnect
will make the PM call fail, you cannot assume that
a physical disconnect is the only reason disconnect()
would be called.
It would also be called if

- the module is unloaded
- usbfs is used to disconnect the driver from the device

Hence it seems to me that using suspend_count is false.
You need to use the return of the PM operation.

	Regards
		Oliver

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help