Re: System freeze on opening /dev/ttyACM0 in linux 2.6.31

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

 



Am Samstag, 12. September 2009 20:09:37 schrieb Joris van Rantwijk:
> Hello,
>
> I have a problem with the cdc-acm driver on Linux 2.6.31.
> As soon as I open /dev/ttyACM0, my system freezes completely.
>
> This never occurred with Linux 2.6.30.4.
> I diffed those versions of cdc-acm.c, then modified the 2.6.31
> version to comment out a suspicious looking line:
>    rv = tty_port_block_til_ready(&acm->port, tty, filp);
>
> With this line commented out, I can open /dev/ttyACM0 and it appears
> to work correctly.
> So something bad happens inside tty_port_block_til_ready().
> I will try to dig a bit deeper.

There's a known regression in that area.
Please try the attached patch.

	Regards
		Oliver

commit 66c6c17ff453f56053bca46d3c3706f93051d1a7
Author: Oliver Neukum <oliver@xxxxxxxxxx>
Date:   Tue Sep 8 23:44:11 2009 +0200

    usb:cdc-acm: fix incomplete adaption to new tty stuff
    
    cdc-acm needs to set a flag during open to tell the
    tty layer that the device is initialized

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 2bfc41e..b8134ad 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -59,6 +59,7 @@
 #include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/tty.h>
+#include <linux/serial.h>
 #include <linux/tty_driver.h>
 #include <linux/tty_flip.h>
 #include <linux/module.h>
@@ -609,6 +610,7 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp)
 	acm->throttle = 0;
 
 	tasklet_schedule(&acm->urb_task);
+	set_bit(ASYNCB_INITIALIZED, &acm->port.flags);
 	rv = tty_port_block_til_ready(&acm->port, tty, filp);
 done:
 	mutex_unlock(&acm->mutex);

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

  Powered by Linux