lkml.org 
[lkml]   [2004]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Re: cdc-acm problems

> I have problems with cdc-acm killing ohci. I tried to narrow down the problem,
> but didn't get far.
> Basically `killall -HUP pppd` gives (in dmesg):
>
> drivers/usb/class/cdc-acm.c: acm_ctrl_irq - urb shutting down with status: -2
> ohci_hcd 0001:01:1b.1: OHCI Unrecoverable Error, disabled
> ohci_hcd 0001:01:1b.1: HC died; cleaning up
> usb 4-1: USB disconnect, address 2
> bus usb: remove device 4-1:1.0
> bus usb: remove device 4-1:1.1
> bus usb: remove device 4-1

After having looked some more hours, it looks like acm_tty_close() unlinks
urbs too soon or something like that... The attached patch fixes it for me
(I don't think it's really clean, but it may help ?)

--
Colin
Index: drivers/usb/class/cdc-acm.c
===================================================================
RCS file: /home/cvsroot/linuxppc/drivers/usb/class/cdc-acm.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 cdc-acm.c
--- drivers/usb/class/cdc-acm.c 8 Jan 2004 11:25:51 -0000 1.1.1.1
+++ drivers/usb/class/cdc-acm.c 13 Jan 2004 20:40:39 -0000
@@ -157,6 +157,7 @@
unsigned int minor; /* acm minor number */
unsigned char throttle; /* throttled by tty layer */
unsigned char clocal; /* termios CLOCAL */
+ unsigned int finish_remove; /* finish removing */
};

static struct usb_driver acm_driver;
@@ -214,8 +215,16 @@
goto exit;
}

- if (!ACM_READY(acm))
+ if (!ACM_READY(acm)) {
+ if (acm->finish_remove) {
+ dbg("unlinking urbs");
+ usb_unlink_urb(acm->ctrlurb);
+ usb_unlink_urb(acm->writeurb);
+ usb_unlink_urb(acm->readurb);
+ return;
+ }
goto exit;
+ }

switch (dr->bRequest) {

@@ -382,9 +391,7 @@
if (!--acm->used) {
if (acm->dev) {
acm_set_control(acm, acm->ctrlout = 0);
- usb_unlink_urb(acm->ctrlurb);
- usb_unlink_urb(acm->writeurb);
- usb_unlink_urb(acm->readurb);
+ acm->finish_remove = 1;
} else {
tty_unregister_device(acm_tty_driver, acm->minor);
acm_table[acm->minor] = NULL;
\
 
 \ /
  Last update: 2005-03-22 14:00    [from the cache]
©2003-2011 Jasper Spaans