Re: 3.6 regression? Serial port stays open after USB device disconnect

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

 



On Monday 20 August 2012 11:32:48 Bjørn Mork wrote:
> Hello,
> 
> I just noticed that /dev/ttyUSBx devices are not destroyed and released
> on USB device disconnect if some process keeps the file open, and

Well, we have to return some error code. So the device cannot just go away.

> reading from the file does not return an error - it successfully reads 0
> bytes instead.

And indeed the hangup redirects the read method:
static ssize_t hung_up_tty_read(struct file *file, char __user *buf,
                                size_t count, loff_t *ppos)
{
        return 0;
}

If you got -EIO in older kernels, this point to the ordinary tty_read

static ssize_t tty_read(struct file *file, char __user *buf, size_t count,
                        loff_t *ppos)
{
        int i;
        struct inode *inode = file->f_path.dentry->d_inode;
        struct tty_struct *tty = file_tty(file);
        struct tty_ldisc *ld;

        if (tty_paranoia_check(tty, inode, "tty_read"))
                return -EIO;
        if (!tty || (test_bit(TTY_IO_ERROR, &tty->flags)))
                return -EIO;

 
> This affects my gpsd usage, so I believe it must be a recent regression
> or I would have noticed before.

It would probably be best to bisect this.

	Regards
		Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux