Re: Autosuspending devices that seem to need reset_resume

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am Samstag, 18. Juli 2009 15:37:33 schrieb Matthew Garrett:
> > No, this looks like a big fat logic bug, not a race. The resume handler
> > has to resubmit the reading URBs if the device is resumed while opened.
> > But the open() method bumps the counter before it resumes a device.
> > The fix is to increment the counter only after the resumption or if no
> > resumption is attempted. Does this patch fix the problem?
>
> Yes, that seems much better.

Hi Matthew,

the fix had to be dropped due to Alan Cox' cleanup of the usb serial
layer. It now requires an alternate fix. Could you test this patch?

	Regards
		Oliver

--

commit f4f5840653a0f91f97910e4bd1779eb813b38a4e
Author: Oliver Neukum <oliver@xxxxxxxxxx>
Date:   Fri Jul 31 12:36:28 2009 +0200

    usb: adapted generic resume to Alan Cox' cleanup of open

diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c
index ce57f6a..6ec888f 100644
--- a/drivers/usb/serial/generic.c
+++ b/drivers/usb/serial/generic.c
@@ -17,6 +17,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/usb.h>
+#include <linux/serial.h>
 #include <linux/usb/serial.h>
 #include <linux/uaccess.h>
 
@@ -174,7 +175,9 @@ int usb_serial_generic_resume(struct usb_serial *serial)
 
 	for (i = 0; i < serial->num_ports; i++) {
 		port = serial->port[i];
-		if (port->port.count && port->read_urb) {
+		/* no locking, protected by the freezer */
+		if (test_bit(ASYNCB_INITIALIZED, &port->port.flags) 
+		    && port->read_urb) {
 			r = usb_submit_urb(port->read_urb, GFP_NOIO);
 			if (r < 0)
 				c++;

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux