Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-23 Thread Erwin Van de Velde
Hi all, Thanks a lot for all your advice, I can confirm that modemmanager 1.4.2 fixes the issue. You saved my week! :-) Kind regards, Erwin On Thu, Oct 22, 2015 at 9:13 PM, Bjørn Mork wrote: > Dan Williams writes: >> On Thu, 2015-10-22 at 10:39 +0200, Erwin Van de Velde wrote: >>> Hi all, >>>

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-22 Thread Bjørn Mork
Dan Williams writes: > On Thu, 2015-10-22 at 10:39 +0200, Erwin Van de Velde wrote: >> Hi all, >> >> Thank you for your helpful answers! I have investigated it further, >> stopping potential culprits in userspace and I have found the issue: >> it is modemmanager that seems to keep the devices ope

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-22 Thread Dan Williams
On Thu, 2015-10-22 at 10:39 +0200, Erwin Van de Velde wrote: > Hi all, > > Thank you for your helpful answers! I have investigated it further, > stopping potential culprits in userspace and I have found the issue: > it is modemmanager that seems to keep the devices open somewhere and > thus causes

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-22 Thread Erwin Van de Velde
Hi all, Thank you for your helpful answers! I have investigated it further, stopping potential culprits in userspace and I have found the issue: it is modemmanager that seems to keep the devices open somewhere and thus causes the ttyUSB numbers to go up. So now I will redirect the issue to their d

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-21 Thread Greg K-H
On Wed, Oct 21, 2015 at 11:39:04AM +0200, Erwin Van de Velde wrote: > Hi all, > > As advised, I retried with a more recent kernel (4.2.0), but I get a > similar result: > > I tested via 'echo 1 > /sys/bus/pci/ehci-pci/\:00\:1a.0/remove' > and 'echo 1 > /sys/bus/pci/rescan'. Why did you remov

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-21 Thread Alan Stern
On Wed, 21 Oct 2015, Erwin Van de Velde wrote: > Hi all, > > As advised, I retried with a more recent kernel (4.2.0), but I get a > similar result: > > I tested via 'echo 1 > /sys/bus/pci/ehci-pci/\:00\:1a.0/remove' > and 'echo 1 > /sys/bus/pci/rescan'. There are two possible results: no > e

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-21 Thread Erwin Van de Velde
Hi all, As advised, I retried with a more recent kernel (4.2.0), but I get a similar result: I tested via 'echo 1 > /sys/bus/pci/ehci-pci/\:00\:1a.0/remove' and 'echo 1 > /sys/bus/pci/rescan'. There are two possible results: no errors when removing the device and then the devices are reinsert

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Peter Stuge
Krzysztof Opasiak wrote: >> There's still a bit of a race condition here, isn't there? >> >> Is there any good way to deal with that? >> >> Yes, there is a race condition. If the program closes the device node >> before the device is plugged in again, the ttyUSB number won't change; >>

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Krzysztof Opasiak
On 10/20/2015 07:35 PM, Alan Stern wrote: On Tue, 20 Oct 2015, Bin Liu wrote: Hi, On Tue, Oct 20, 2015 at 11:57 AM, Peter Stuge wrote: Greg K-H wrote: Userspace still has the port open, so the number is not reused until userspace closes the device node. Fix your userspace programs to pro

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Alan Stern
On Tue, 20 Oct 2015, Bin Liu wrote: > Hi, > > On Tue, Oct 20, 2015 at 11:57 AM, Peter Stuge wrote: > > Greg K-H wrote: > >> >> Userspace still has the port open, so the number is not reused until > >> >> userspace closes the device node. Fix your userspace programs to > >> >> properly listen to

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Peter Stuge
Hello, Bin Liu wrote: > >> >There's still a bit of a race condition here, isn't there? > >> > > >> >Is there any good way to deal with that? > >> > >> What race condition are you seeing here? > > > > USB cable is unplugged > > Assuming /dev/ttyUSB0 is opened by process ATM. > > > Process is sen

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Bin Liu
Hi, On Tue, Oct 20, 2015 at 11:57 AM, Peter Stuge wrote: > Greg K-H wrote: >> >> Userspace still has the port open, so the number is not reused until >> >> userspace closes the device node. Fix your userspace programs to >> >> properly listen to the hangup signal to know to release the device >>

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Peter Stuge
Greg K-H wrote: > >> Userspace still has the port open, so the number is not reused until > >> userspace closes the device node. Fix your userspace programs to > >> properly listen to the hangup signal to know to release the device > >node > >> and you should be fine. > > > >There's still a bit of

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Greg K-H
On October 20, 2015 9:38:52 AM PDT, Peter Stuge wrote: >Greg KH wrote: >> Userspace still has the port open, so the number is not reused until >> userspace closes the device node. Fix your userspace programs to >> properly listen to the hangup signal to know to release the device >node >> and you

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Peter Stuge
Greg KH wrote: > Userspace still has the port open, so the number is not reused until > userspace closes the device node. Fix your userspace programs to > properly listen to the hangup signal to know to release the device node > and you should be fine. There's still a bit of a race condition here

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Greg KH
On Tue, Oct 20, 2015 at 05:20:23PM +0200, Erwin Van de Velde wrote: > Hi all, > > Due to some hardware issues, I have to reset USB modems and a USB to > serial converter on some of my servers. What I noticed is that > /dev/ttyUSBXX devices are never reused: ttyUSB1 becomes ttyUSB3 e.g. > and so on

Re: Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Johan Hovold
On Tue, Oct 20, 2015 at 05:20:23PM +0200, Erwin Van de Velde wrote: > Hi all, > > Due to some hardware issues, I have to reset USB modems and a USB to > serial converter on some of my servers. What I noticed is that > /dev/ttyUSBXX devices are never reused: ttyUSB1 becomes ttyUSB3 e.g. > and so on

Resetting USB modems and USB to serial converters increases ttyUSBXX counter

2015-10-20 Thread Erwin Van de Velde
Hi all, Due to some hardware issues, I have to reset USB modems and a USB to serial converter on some of my servers. What I noticed is that /dev/ttyUSBXX devices are never reused: ttyUSB1 becomes ttyUSB3 e.g. and so on. This looks fine, but we have to do it rather often, so after a while we reach