Thread (3 messages) 3 messages, 3 authors, 2009-07-23

drivers/usb/class/cdc-acm.c patch kernel 2.6.31.-rc1

flat view

From: Weng, Wending <hidden>
Date: 2009-07-22 21:22:31
Subsystem: the rest, usb acm driver, usb subsystem · Maintainers: Linus Torvalds, Oliver Neukum, Greg Kroah-Hartman

From 39e8558a114297ee9192f406d63f423aded05288 Mon Sep 17 00:00:00 2001
From: root <root@SBC_PC_3.localdomain>
Date: Tue, 21 Jul 2009 10:48:15 -0400
vers/usb/class/cdc-acm.cSubject: [PATCH] When the usb-serial cable is unpluged, the usb host controller driver returns all scheduled URBs to usb-serial driver(cdc-acm.c), and the usb-serial driver(cdc-acm.c) doesn't detect this exception, continues to schedule the URBs, it causes a dead loop.
This change fixes this problem.

Signed-off-by: Wending Weng <redacted>
---
 drivers/usb/class/cdc-acm.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 38bfdb0..3cc3e18 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -372,8 +372,15 @@ static void acm_read_bulk(struct urb *urb)
                list_add_tail(&rcv->list, &acm->spare_read_urbs);
                list_add(&buf->list, &acm->spare_read_bufs);
                spin_unlock(&acm->read_lock);
-               /* nevertheless the tasklet must be kicked unconditionally
-               so the queue cannot dry up */
+
+               /* Normally, the tasklet must be kicked unconditionally
+               so the queue cannot dry up, however, if the cable is disconnected,
+               or whatever fatal error, it must not reschedule any URB */
+
+                // Stop rescheduling any URB in case the connection is shutdown
+                if ((urb->status == -ESHUTDOWN) || (urb->status == -EPROTO))
+                        return;
+
        }
        if (likely(!acm->susp_count))
                tasklet_schedule(&acm->urb_task);
--
1.5.2.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help