Bug 92596 - ttyUSB device nodes are not freed after AT reset
Summary: ttyUSB device nodes are not freed after AT reset
Status: RESOLVED FIXED
Alias: None
Product: ModemManager
Classification: Unclassified
Component: general (show other bugs)
Version: 1.4
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: ModemManager bug user
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-22 13:52 UTC by jan.haegeman
Modified: 2015-10-23 09:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
modemmanager debug log (462.73 KB, text/plain)
2015-10-22 13:52 UTC, jan.haegeman
Details
dmesg logs (9.18 KB, text/plain)
2015-10-22 13:52 UTC, jan.haegeman
Details
commands logs (3.13 KB, text/plain)
2015-10-22 13:53 UTC, jan.haegeman
Details

Description jan.haegeman 2015-10-22 13:52:21 UTC
Created attachment 119068 [details]
modemmanager debug log

This issue appears on a Debian 8 64-bit system (Linux 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt11-1 (2015-05-24)).

This issue concerns a Sierra Wireless MC7304 modem.

At boot, the Sierra Wireless modem uses three ttyUSB ports, namely:

/dev/ttyUSB0
/dev/ttyUSB1
/dev/ttyUSB2

When disconnecting this modem directly through the USB bus or performing a reset via an AT command (mmcli -m 0 --command='AT!GRESET') I have noticed that we get errors of this kind:

[   74.170025] option1 ttyUSB0: usb_wwan_indat_callback: resubmit read urb failed. (-2)
[   74.170150] option1 ttyUSB0: usb_wwan_indat_callback: resubmit read urb failed. (-2)
[   74.170271] option1 ttyUSB0: usb_wwan_indat_callback: resubmit read urb failed. (-2)

When this happens, the ttyUSB device node is blocked by the ModemManager process indefinitely and not freed up until ModemManager is restarted. When the modem connects again through the USB bus, it is using different ttyUSB ports:

[   82.983375] option 1-4:1.0: GSM modem (1-port) converter detected
[   82.983791] usb 1-4: GSM modem (1-port) converter now attached to ttyUSB1
[   82.984219] option 1-4:1.2: GSM modem (1-port) converter detected
[   82.984733] usb 1-4: GSM modem (1-port) converter now attached to ttyUSB4
[   82.985339] option 1-4:1.3: GSM modem (1-port) converter detected
[   82.987641] usb 1-4: GSM modem (1-port) converter now attached to ttyUSB5

This is not actually an issue, but we when we do many resets with many modems on the same system, we eventually hit the maximum of /dev/ttyUSB511 (kernel limit) and we lose the ability to issue AT commands, as no free ttyUSB ports are available anymore to bind to. Below, some commands to reproduce the issue:

root@jh:~# cd /sys/devices/pci0000:00/0000:00:14.0/usb1/1-4
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 0 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 1 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 0 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 1 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 0 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 1 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# systemctl restart ModemManager
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 0 > authorized 
root@jh:/sys/devices/pci0000:00/0000:00:14.0/usb1/1-4# echo 1 > authorized 

First, you will see that the /dev/ttyUSB number increases. When we do a ModemManager process restart and do again a reset of the modem, we see that the device nodes are freed and /dev/ttyUSB0, /dev/ttyUSB1 and /dev/ttyUSB2 are re-used.

ModemManager debug log, dmesg logs and commands issued attached to ticket.
Comment 1 jan.haegeman 2015-10-22 13:52:49 UTC
Created attachment 119069 [details]
dmesg logs
Comment 2 jan.haegeman 2015-10-22 13:53:28 UTC
Created attachment 119070 [details]
commands logs
Comment 3 Aleksander Morgado 2015-10-22 15:04:13 UTC
Are you using 1.4.0?  If so, this is very likely a bug fixed in 1.4.2, please retry with a newer version.

http://cgit.freedesktop.org/ModemManager/ModemManager/commit/?h=mm-1-4&id=009af02f6d06d5020e397455354b9ccc56557b02
Comment 4 jan.haegeman 2015-10-22 15:08:48 UTC
Ah, good to know. I will try with 1.4.2 tomorrow. Thanks for the quick reply.
Comment 5 jan.haegeman 2015-10-23 09:36:47 UTC
This is indeed fixed in 1.4.2. Thanks for the help!


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.