Messages in this thread Patch in this message | | | Date | Wed, 27 Oct 1999 14:38:19 +0200 | From | Pavel Machek <> | Subject | Nasty error in acm |
| |
Hi!
There was nasty problem with acm: it returned 1 from acm_read_irq routine and uhci started to do stupid things as response. Here's the fix. It also fixes oops when disconnecting device while acm is open, plus it fixes detection. Please apply, Pavel
--- clean/drivers/usb/acm.c Sat Oct 16 10:24:25 1999 +++ linux/drivers/usb/acm.c Tue Oct 26 20:13:00 1999 @@ -194,7 +198,7 @@ info("ACM_READ_IRQ: state %d, %d bytes\n", state, count); if (state) { printk( "acm_read_irq: strange state received: %x\n", state ); - return 1; + return 0; } if (!ACM_READY) @@ -204,7 +208,7 @@ tty_insert_flip_char(tty,data[i],0); tty_flip_buffer_push(tty); - return 1; /* continue transfer */ + return 0; /* Never return 1 from this routine. It makes uhci do bad things. */ } static int acm_write_irq(int state, void *__buffer, int count, void *dev_id) @@ -425,7 +429,7 @@ interface->bNumEndpoints != 2) continue; - /* if ((endpoint->bEndpointAddress & 0x80) == 0x80) */ + endpoint = &interface->endpoint[0]; if ((endpoint->bEndpointAddress & 0x80) != 0x80) swapped = 1; @@ -486,8 +490,8 @@ if (!acm->present) return; - printk("disconnecting\n"); - + acm->active=0; + acm->present=0; if (acm->writing){ usb_terminate_bulk(acm->dev, acm->writetransfer); acm->writing=0; @@ -498,8 +502,6 @@ } usb_release_irq(acm->dev,acm->ctrltransfer, acm->ctrlpipe); //BUG: What to do if a device is open?? Notify process or not allow cleanup? - acm->active=0; - acm->present=0; kfree(acm->writebuffer); kfree(acm->readbuffer); -- I'm really pavel@ucw.cz. Look at http://195.113.31.123/~pavel. Pavel Hi! I'm a .signature virus! Copy me into your ~/.signature, please!
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |