Modem Manager Locks Dual FTDI Serial Ports

Bug #1094138 reported by Ash Charles on 2012-12-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ModemManager
Fix Released
Medium
modemmanager (Ubuntu)
Medium
Mathieu Trudel-Lapierre

Bug Description

As per Question #217761, I'm submitting a bug report in order to include a patch. Details from question follow:
"
I'm trying to connect serial console to an embedded device and but I'm not able to connect for the first 36 seconds after connection as modem-manager has locked the /dev/ttyUSB1 file (as shown by '$ sudo lsof /dev/ttyUSB1'). By blacklisting the USB ID (0403:6010) of the device in the '77-mm-usb-devices-blacklist.rhles' udev rule, I can immediately access the device.

Much like the commonly used single FTDI USB-serial converter chip (USD ID 0403:6001) that is blacklisted in this file "77-mm-usb-device-blacklist.rules", I think the dual version (USB ID 0403:6010) chould also be added as it is commonly used in JTAG debugged boards and embedded devices.
...
"

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: modemmanager 0.6.0.0.really-0ubuntu1 [modified: lib/udev/rules.d/77-mm-usb-device-blacklist.rules]
ProcVersionSignature: Ubuntu 3.5.0-21.32-generic 3.5.7.1
Uname: Linux 3.5.0-21-generic x86_64
ApportVersion: 2.6.1-0ubuntu9
Architecture: amd64
Date: Thu Dec 27 14:07:21 2012
InstallationDate: Installed on 2012-12-23 (3 days ago)
InstallationMedia: Ubuntu 12.10 "Quantal Quetzal" - Release amd64 (20121017.5)
MarkForUpload: True
SourcePackage: modemmanager
UpgradeStatus: No upgrade log present (probably fresh install)

Ash Charles (ashcharles) wrote :
tags: added: patch-unity running
removed: running-unity

The attachment "ft2232-blacklist.patch" of this bug report has been identified as being a patch. The ubuntu-reviewers team has been subscribed to the bug report so that they can review the patch. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-reviewers team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch

ModemManager 0.6.x supports RS232 modems connected to the host through a serial-usb adapter. This patch would make those modems stop working, so I don't think this should be applied to git master or any other distro.

ModemManager shouldn't grab those tty ports for that long. The problem here is that given that the connection is through a serial<->usb converter, udev gives us information about the converter, so we can only know that the modem is a serial modem by probing the ports. The fact that it takes so long in each port is because the probing in 0.6 tries to do a lot of things on ports which may not be AT ports. In MM 0.7+ this probing in each port should really take much much less.

As for the single FTDI USB-serial converter being completely blacklisted; I think it shouldn't be.

A wise change would be to fully skip probing these ports in MM unless the user asks for it through the Scan() method. That would require to remove all the usb<->serial converters from the blacklist, and only have them probed through manually launched Scan()s, not by the initial automatic port probing.

Ash Charles (ashcharles) wrote :

Are there any modems using a FT2232 chip without a custom USB device ID? I suggested the change on the basis that the chip is commonly used in embedded devices (e.g. http://www.tincantools.com/product.php?productid=16134 and https://www.gumstix.com/store/product_info.php?products_id=262) without the extra eeprom used to set a custom VID/PID but expected (perhaps naively) that modem designers would actually want a unique identifier for their particular device. I certainly understand dropping the patch if there are Modem out there that would be broken by this change.

This is good to hear that the probe will be shorter in future versions and avoiding automatic probing seems like a good change :).

Modems won't be using the FT2232 chip directly but serial adapters will. Imagine this setup:

PC[USB] <---> USB to RS232 adapter <---> [RS232]Modem

The only way for ModemManager to know that there is a modem behind the adapter is to probe the port.

Oh, it seems that the single FTDI USB<->serial converter is blacklisted only in IUbuntu:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/raring/modemmanager/raring/view/head:/debian/patches/arduino-blacklist.patch

I'll let Ubuntu packagers to comment then :)

Ash Charles (ashcharles) wrote :

Ahh---that makes sense about the USB to Serial adapter--thanks for explaining Alekasander.

As a USB-to-serial adapter is a generic device that may or may not be connected to a modem, a manually-launched scan makes sense. In the interim though, it makes sense that distros adjust the blacklist to fit their user base.

Ack.

We already blacklist specific devices, and it seems as though this particular one is indeed used for things other than modems. It remains that it's easy enough to remove/comment out the blacklist entry, and I still live in my fantasy world where RS232 modem users are becoming more rare.

We'll revisit and drop these blacklist patches as soon as we can land MM 0.7.

Assigning to me because I'll need to include the patch at some point; but it's waiting until I can finish up an update for NM in Raring.

Changed in modemmanager (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)

I opened a new bug upstream to track the root issue:
https://bugzilla.gnome.org/show_bug.cgi?id=691076

Changed in modemmanager:
importance: Unknown → Medium
status: Unknown → New
Ash Charles (ashcharles) wrote :

This also affects FTDI's newer FT230X series. VID:0403, PID:6015

Changed in modemmanager:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related questions

Remote bug watches

Bug watches keep track of this bug in other bug trackers.