3.6 regression? Serial port stays open after USB device disconnect

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

 



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
reading from the file does not return an error - it successfully reads 0
bytes instead.

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

I need help tracking down the cause of this.  I guess it could be
related to my usb_wwan changes, but I do not understand how...


Disconnecting the device:

Aug 20 11:10:36 nemi kernel: [116888.253611] PM: Removing info for usb:2-4:1.2
Aug 20 11:10:36 nemi kernel: [116888.253636] bus: 'usb': remove device 2-4:1.2
Aug 20 11:10:36 nemi kernel: [116888.253727] /usr/local/src/git/linux/drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: nonzero status: -108 on endpoint 02.
Aug 20 11:10:36 nemi kernel: [116888.253731] /usr/local/src/git/linux/drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: nonzero status: -108 on endpoint 02.
Aug 20 11:10:36 nemi kernel: [116888.253734] /usr/local/src/git/linux/drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: nonzero status: -108 on endpoint 02.
Aug 20 11:10:36 nemi kernel: [116888.253738] /usr/local/src/git/linux/drivers/usb/serial/usb_wwan.c: usb_wwan_indat_callback: nonzero status: -108 on endpoint 02.
Aug 20 11:10:36 nemi kernel: [116888.253769] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: usb_serial_disconnect
Aug 20 11:10:36 nemi kernel: [116888.253802] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: serial_hangup - port 2
Aug 20 11:10:36 nemi kernel: [116888.253810] PM: Removing info for usb-serial:ttyUSB2
Aug 20 11:10:36 nemi kernel: [116888.253830] bus: 'usb-serial': remove device ttyUSB2
Aug 20 11:10:36 nemi kernel: [116888.253851] device: 'ttyUSB2': device_unregister
Aug 20 11:10:36 nemi kernel: [116888.253854] PM: Removing info for No Bus:ttyUSB2
Aug 20 11:10:36 nemi kernel: [116888.253909] qcserial ttyUSB2: Qualcomm USB modem converter now disconnected from ttyUSB2
Aug 20 11:10:36 nemi kernel: [116888.253926] qcserial 2-4:1.2: device disconnected


Notice the "serial_hangup", which AFIACS should cause the TTY to start
reporting errors.  But it does not.  Reading from the file handle
continues to return 0 bytes and no error.  Only after the userspace
application closes the handle do we see this:


Aug 20 11:11:06 nemi kernel: [116918.265281] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: serial_close - port 2
Aug 20 11:11:06 nemi kernel: [116918.266455] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: serial_cleanup - port 2
Aug 20 11:11:06 nemi kernel: [116918.266462] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: destroy_serial - Qualcomm USB modem
Aug 20 11:11:06 nemi kernel: [116918.266466] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: return_serial
Aug 20 11:11:06 nemi kernel: [116918.266474] /usr/local/src/git/linux/drivers/usb/serial/usb-serial.c: port_release - ttyUSB2
Aug 20 11:11:06 nemi kernel: [116918.266505] device: 'ttyUSB2': device_create_release



The effect for me is that the serial port names change on system
suspend/resume, because some application hangs on to the old
port. That's annoying and not like I believe this should work.

I'd appreciate any hints on where to start looking for the problem. I do
not understand much of the TTY layer interaction, but I did expect
serial_hangup to be enough here.



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