Kernel in Natty disconnects Huawei E160G, ModemManager can't use it

Bug #772577 reported by Aleksander Morgado
76
This bug affects 13 people
Affects Status Importance Assigned to Milestone
NULL Project
Invalid
Undecided
Unassigned
linux (Ubuntu)
Expired
Medium
Unassigned

Bug Description

Upgraded to Natty yesterday and since then my Huawei E160G is no longer detected properly by ModemManager. It seems the kernel closes the USB port during ModemManager's Huawei plugin probe, so it never gets fully connected and probing loops forever (see attached syslog with ModemManager debug logs enabled).

Also, when kernel says "option: option_instat_callback: error -108", the whole PC gets frozen for exactly 10 seconds.

This issue happens with both Natty's default ModemManager (0.4+git.20110124t203624.00b6cce-2ubuntu1) and latest git master, so it really seems something kernel-related.

aleksander@ares:~$ uname -a
Linux ares 2.6.38-8-generic-pae #42-Ubuntu SMP Mon Apr 11 05:17:09 UTC 2011 i686 i686 i386 GNU/Linux

This issue is not reproducible neither in Maverick nor in Fedora15 (kernel 2.6.38-3-18.fc15.i686)

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :
Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

Humm... I now also have this issue in F15, not sure if because I upgraded the kernel to 2.6.38.5-22.fc15.i686 or because the HW is really broken. Will retry in Ubuntu Maverick soon to see if it's really the HW.

Revision history for this message
hector (mailbox-deandreis) wrote :

I have the same problem with huawei e156g modem.
On different notebooks , when i've upgraded to (K/L)ubuntu 11.04, the modem is non more detected (but present with lsusb)
Test on 2 notebooks, one with Lubuntu 11.04, and another with Kubuntu 11.04 AMD 64
No problems on same machines with 10.10 vers.

Please help us soon !

Revision history for this message
hector (mailbox-deandreis) wrote :

P.S. re testd with Lubuntu 10.10 live version, it's work, but NOT on the same netbook with 11.04.

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

@hector: are you able to get modem-manager debug logs while trying to reproduce the issue, and post them here? just to confirm it's the same issue.

You can get the debug logs with these steps:

$> sudo -s
$> /etc/init.d/network-manager stop
$> killall modem-manager
$> modem-manager --debug

And in another terminal:
$> sudo /etc/init.d/network-manager start

Then try to reproduce the issue; and once done attach whole /var/log/syslog file to the bugreport (should include the debug logs). And you can then Ctrl+C in the first terminal to get modem-manager restarted without debug logs automatically.

description: updated
Revision history for this message
Luca Cireddu (sardylan) wrote :

I've the same problem with a 64bit version of Ubuntu Natty (11.04), and a Huawei E165G USB HDSPA modem.
I think that the problem is in the kernel module, because of this message:
"kernel: [ 287.000190] option: option_instat_callback: error -108"
The USB device is reseted every 15-20 secs, with 5 or 10 secs of freeze.

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

@sardylan, are you able to get modem-manager debug logs as per comment #5?

anyway, your description is very similar to mine, so probably same issue

Revision history for this message
Luca Cireddu (sardylan) wrote :

I'm waiting the owner of that PC right now with his USB device.
Just wait half an hour... :)

Revision history for this message
Luca Cireddu (sardylan) wrote :

In file "kern.log", the issue starts from row 627.
In file "syslog" starts form row 875.

After these logs, I'm sure that the problem is in the "option" kernel module. I've also tried to update kernel packages, to reinstall udev, usb_modeswitch and so on, but with no result.

I'm considering to return back to Ubuntu 10.10. No problems with that version...

Revision history for this message
Luca Cireddu (sardylan) wrote :

The other file...

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :
Download full text (4.6 KiB)

@sardylan, seems we're having the same issue here, yes.

From your logs, these are the steps:
 1) modem-manager gets the notifications about new ttyUSB0 and ttyUSB1;
 2) then defers the probing of port ttyUSB1 (because udev reports ttyUSB1 with interface id 1)
 3) starts probing ttyUSB0 (the one with interface id 0);
 4) probing port ttyUSB0 succeeds;
 5) and starts probing ttyUSB1 (at 20:13:13)
 6) kernel hangs for 10s, and meanwhile dumps the "option_instat_callback: error -108" error and closes ttyUSB0
 7) modem-manager gets the error about not being able to open ttyUSB1
 8) modem-manager marks the modem as invalid because we lost ttyUSB0

The relevant chunk in the logs:

May 17 20:13:12 picci modem-manager[9893]: <debug> [1305655992.268449] [mm-manager.c:239] check_export_modem(): (tty/ttyUSB1): outstanding support task prevents export of /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5
May 17 20:13:13 picci modem-manager[9893]: <debug> [1305655993.023318] [mm-manager.c:450] supports_defer_timeout(): (ttyUSB1): re-checking support...
May 17 20:13:13 picci modem-manager[9893]: <info> [1305655993.024451] [mm-serial-port.c:702] mm_serial_port_open(): (ttyUSB1) opening serial port...
May 17 20:13:17 picci kernel: [ 2572.020224] option: option_instat_callback: error -108
May 17 20:13:17 picci kernel: [ 2572.020426] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
May 17 20:13:17 picci kernel: [ 2572.020477] option 1-5:1.0: device disconnected
May 17 20:13:23 picci modem-manager[9893]: <warn> [1305656003.016966] [mm-plugin-huawei.c:247] supports_port(): (Huawei) ttyUSB1: couldn't open serial port: (0) Could not lock serial device ttyUSB1: Input/output error
May 17 20:13:23 picci modem-manager[9893]: <debug> [1305656003.017161] [mm-manager.c:617] supports_callback(): (tty/ttyUSB1): ignoring port unsupported by physical modem's plugin
May 17 20:13:23 picci modem-manager[9893]: <debug> [1305656003.017416] [mm-manager.c:261] check_export_modem(): Exported modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5 as /org/freedesktop/ModemManager/Modems/0
May 17 20:13:23 picci modem-manager[9893]: <debug> [1305656003.017598] [mm-manager.c:274] check_export_modem(): (/org/freedesktop/ModemManager/Modems/0): VID 0x12D1 PID 0x1003 (usb)
May 17 20:13:23 picci modem-manager[9893]: <debug> [1305656003.017636] [mm-manager.c:275] check_export_modem(): (/org/freedesktop/ModemManager/Modems/0): data port is ttyUSB0
May 17 20:13:23 picci modem-manager[9893]: <info> [1305656003.019629] [mm-manager.c:855] device_removed(): (tty/ttyUSB0): released by modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5
May 17 20:13:23 picci modem-manager[9893]: <debug> [1305656003.019769] [mm-modem-base.c:185] mm_modem_base_remove_port(): (ttyUSB0) type primary removed from /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5
May 17 20:13:23 picci modem-manager[9893]: <debug> [1305656003.019899] [mm-manager.c:200] remove_modem(): Removed modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-5

As an additional note when I first analyzed the issue, note that after the first attempt, udev now reports ttyUSB1 as having interface Id 0, and ttyUSB0 as having interface id 1 (m...

Read more...

Revision history for this message
RobertW (n-robert) wrote :

I had the same problem in Ubuntu Natty 64bit.
I tried to activate the card, but linux didn't recognized it. (Same log file entries)
After reboot to Win and using the UMTS Card there, linux hadn't any problems to activate an use the huawei umts card.
Could it be, that linux wasn't able to reactivate the card from sleeping ?

Revision history for this message
hugonunes (hugonunes) wrote :

Same problem here with 11.04 (Linux t410 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:24 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux)

Attached the modem-manager --debug output during the tests.

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

@hugonunes:
I cannot see any similarity with the error in this bug in your logs.
Based on what do you say it's the same issue?

Revision history for this message
hugonunes (hugonunes) wrote :

@Aleksander Morgado:

This not a exact match of the problem, but some of the symptoms seems the same, special the "It seems the kernel closes the USB port during ModemManager's Huawei plugin probe, so it never gets fully connected and probing loops forever" part.

In my case the HSUPA USB Modem is a ZTE MF636DB.

Revision history for this message
Luc Bruninx (luc2005) wrote :

I have a similar problem with my Vodafone Huawei K3565 stick-rev2.

The modem is detected, then the system tries to mount the microSD included. This is when the modem stops responding.

Turning off auto mount does not solve the problem. It is impossible to connect using NetworkManager. The process starts, then fails after a few seconds.

Using the Vodafone-Mobile-Connect (Betavine) in debug mode, we find that the SIM card is set to BUSY when it should be in IDLE mode. That's why the program Vodafone-Mobile-Connect is frozen just after entering the PIN.

By closing the program and then restarting, the connection can be established with any luck (half the time). Unfortunately, the connection is rarely stable.

I think the stick does not support different access types simultaneously.

I did not have this problem on Ubuntu 10.10. He appeared with 11.04.

Perhaps packages ozerocdoff and usb-modeswitch are no longer compatible.

I'll try Betavine-Mobile-Connect (bcm) instead of VMC.

Revision history for this message
Luc Bruninx (luc2005) wrote :

Same problem with Betavine-Mobile-Connect.

Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

@Luc:

Don't think your problem is the same.
Would be good to open a new independent bug for it.

Revision history for this message
Brad Figg (brad-figg) wrote : Missing required logs.

This bug is missing log files that will aid in dianosing the problem. From a terminal window please run:

apport-collect 772577

and then change the status of the bug back to 'New'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

After a long bisect, first through old natty linux-image package, then through the 9001 git commits between 2.37-12.26 and 2.38-1.27, the regression intervened with commit 638428ece619495edc9579b1e21493eb00f9687c
Author: Tejun Heo <email address hidden>
Date: Thu Dec 9 11:18:42 2010 +0100

    scsi: fix TUR error handling in sr_media_change()

    sr_test_unit_ready() returns 0 iff TUR succeeded - IOW, when media is
    present and the device is actually ready, so the return value wouldn't
    be zero when TUR ends with sense data. sr_media_change() incorrectly
    tests (retval || (scsi_sense_valid(sshdr)...)) when it tries to test
    whether TUR failed without sense data or with sense data indicating
    media-not-present.

    Fix the test using scsi_status_is_good() and update comments.

    - Fixed a comment typo spotted by Eike.

This code has been vastly changed in the following weeks after this commit, but its logics remain...

It is possible (I did not check yet, but it seems possible) that that commit 79b9677d885d1a792bc103f2febb06f91f92de43 solves it.
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=79b9677d885d1a792bc103f2febb06f91f92de43

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
tags: added: kernel-bug natty needs-upstream-testing regression-release
Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

So obviously, a temporary workaround (with the security problems it implies) is to use the last build working:
https://launchpad.net/ubuntu/+source/linux/2.6.37-12.26

Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

 == Regression details ==
Discovered in version: 2.6.38-8.42
Last known good version: 2.6.37-12.26

Revision history for this message
Hugues Fournier (hugues-fournier) wrote :

I am sorry, there was a mistake in my bisect (there seems to be some race conditions between the scsi/usb storage behaviour and the usb serial behaviour that very rarely makes a "bad" kernel work or a "good" kernel not to work)

However the regression still intervenes with a change in the SCSI cdrom driver code (drivers/scsi/sr.c)

commit 93aae17af1172c40c6f74b7294e93a90c3cfaa5d
Author: Tejun Heo <email address hidden>
Date: Thu Dec 16 17:52:17 2010 +0100

    sr: implement sr_check_events()

    Replace sr_media_change() with sr_check_events(). It normally only
    uses GET_EVENT_STATUS_NOTIFICATION to check both media change and
    eject request. If @clearing includes DISK_EVENT_MEDIA_CHANGE, it
    issues TUR and compares whether media presence has changed. The SCSI
    specific media change uevent is kept for compatibility.

    sr_media_change() was doing both media change check and revalidation.
    The revalidation part is split into sr_block_revalidate_disk().

The difficulty is that it is possible that it is not something called from sr_check_events that causing the regression, but something triggered in drivers/cdrom/cdrom.c by the new presence of a ->check_events in the device operations structure.

From my tests, upstream is affected too, even in HEAD (so the recent 79b9677d885d1a792bc103f2febb06f91f92de43 commit evoked above does not solve it). I have not (yet) opened a bug report upstream.

Revision history for this message
Kristian Kißling (kkissling) wrote :

Are there any news about this bug? I encounter it too:

[ 837.946282] scsi 15:0:0:0: Direct-Access Vodafone Storage (Huawei) 2.31 PQ: 0 ANSI: 2
[ 837.946371] scsi 14:0:0:0: CD-ROM Vodafone CD ROM (Huawei) 2.31 PQ: 0 ANSI: 2
[ 837.952237] sr0: scsi-1 drive
[ 837.952532] sr 14:0:0:0: Attached scsi CD-ROM sr0
[ 837.952774] sr 14:0:0:0: Attached scsi generic sg1 type 5
[ 837.953255] sd 15:0:0:0: Attached scsi generic sg2 type 0
[ 837.956954] sd 15:0:0:0: [sdb] Attached SCSI removable disk
[ 891.699969] usb 1-5: USB disconnect, address 8
[ 891.700224] option: option_instat_callback: error -108
[ 891.700495] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 891.700520] option 1-5:1.0: device disconnected
[ 891.700613] cdc_ether 1-5:1.1: wwan0: unregister 'cdc_ether' usb-0000:00:1d.7-5, Mobile Broadband Network Device
[ 891.728514] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 891.728552] option 1-5:1.3: device disconnected
[ 891.728757] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[ 891.728789] option 1-5:1.4: device disconnected

lsusb:
Bus 001 Device 015: ID 12d1:1464 Huawei Technologies Co., Ltd.

Revision history for this message
penalvch (penalvch) wrote :

Aleksander Morgado, thank you for reporting this and helping make Ubuntu better. This bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux <replace-with-bug-number>

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text. Please let us know your results.

Thanks in advance.

no longer affects: modemmanager (Ubuntu)
Changed in linux (Ubuntu):
status: Confirmed → Incomplete
affects: modemmanager → linux
Changed in linux (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Kimmo Satta (ksatta79) wrote :

I had this same problem with a Huawei E160E. I kept getting the error.. -108, input/output errors etc.

Looks like it works better now. I updated the firmware from my operator's site (Elisa Finland) (http://www.elisa.fi/asiakaspalvelu/499/lataa-tiedostoja/).

It worked ok in 10.x but it seems that in 11.x and up it very rarely worked. Kept on freezing for 10s etc.

Now it works like before, meaning that after booting I have to disconnect the modem a few times, throw it against the wall, curse out loud.. and then it suddenly connects :)

Revision history for this message
penalvch (penalvch) wrote :

Kimmo Satta, if your still having a problem, please to execute the following via the Terminal and feel free to subscribe me to it:
ubuntu-bug linux

Thanks!

Revision history for this message
Marek Kowalski (kowalski0123) wrote :

Kimmo Satta, the hint with reconnecting the modem a few times does the trick! Thanks a lot! Basing on this and Hugues Fournier suggestion that this is a race conditions I tried removing the usb_storage module before pluging the modem and it works every time!
I do this like this:
sudo modprobe -r usb_storage

Revision history for this message
penalvch (penalvch) wrote :

Marek Kowalski, if you are having a problem in Ubuntu, please file a new report by executing the following via the Terminal and feel free to subscribe me to it:
ubuntu-bug linux

Thanks!

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in network-manager (Ubuntu):
status: New → Confirmed
penalvch (penalvch)
no longer affects: network-manager (Ubuntu)
affects: linux → null
Changed in null:
status: New → Invalid
tags: removed: kernel-bug
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related questions

Bug attachments

Remote bug watches

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