]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/usb/serial/generic.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm
[linux-2.6-omap-h63xx.git] / drivers / usb / serial / generic.c
index 9eb4a65ee4d9943026f74de49c4e3013c8f3f65f..97fa3c4284350ab24a32cc9d46d69bc4e4fe39e2 100644 (file)
@@ -175,6 +175,14 @@ int usb_serial_generic_resume(struct usb_serial *serial)
        struct usb_serial_port *port;
        int i, c = 0, r;
 
+#ifdef CONFIG_PM
+       /*
+        * If this is an autoresume, don't submit URBs.
+        * They will be submitted in the open function instead.
+        */
+       if (serial->dev->auto_pm)
+               return 0;
+#endif
        for (i = 0; i < serial->num_ports; i++) {
                port = serial->port[i];
                if (port->open_count && port->read_urb) {
@@ -327,6 +335,7 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb)
        struct usb_serial_port *port = (struct usb_serial_port *)urb->context;
        unsigned char *data = urb->transfer_buffer;
        int status = urb->status;
+       unsigned long flags;
 
        dbg("%s - port %d", __FUNCTION__, port->number);
 
@@ -339,11 +348,11 @@ void usb_serial_generic_read_bulk_callback (struct urb *urb)
        usb_serial_debug_data(debug, &port->dev, __FUNCTION__, urb->actual_length, data);
 
        /* Throttle the device if requested by tty */
-       spin_lock(&port->lock);
+       spin_lock_irqsave(&port->lock, flags);
        if (!(port->throttled = port->throttle_req))
                /* Handle data and continue reading from device */
                flush_and_resubmit_read_urb(port);
-       spin_unlock(&port->lock);
+       spin_unlock_irqrestore(&port->lock, flags);
 }
 EXPORT_SYMBOL_GPL(usb_serial_generic_read_bulk_callback);