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

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

 



Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> writes:
> On Mon, 20 Aug 2012, Bjørn Mork wrote:
>
>> I just noticed that /dev/ttyUSBx devices are not destroyed and released
>> on USB device disconnect if some process keeps the file open, and
>> reading from the file does not return an error - it successfully reads 0
>> bytes instead.
>
> I could be wrong about this, but isn't reading from a hung-up tty
> supposed to be much like reaching end-of-file?  That doesn't return an
> error either, but applications manage to deal with it somehow.

Yes, you are both right.  This works as expected and as it always has
done.  End-of-file as implemented by the TTY layer is correct.

I don't know where I got the idea that this used to work differently.  I
just verified that gpsd will keep the device file open forever after
it's gone with previous kernels as well. As expected based on the age of
the code involved. Tested on 3.5 and 3.2.  Don't know it it should be
considered a bug in gpsd, but it can easily be worked around using a
udev rule to signal gpsd that the device disappeared.

Just to be clear: This both works as expected and as before.  No bug.
No change.

Sorry for any confusion and thanks for your answer.  



Bjørn
--
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