loading/unloading of option driver does not work - breaks use of common usb modems

Bug #406312 reported by Christian Schürer-Waldheim on 2009-07-29
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
Leann Ogasawara
Nominated for Karmic by Christian Schürer-Waldheim
udev (Ubuntu)
Undecided
Unassigned
Nominated for Karmic by Christian Schürer-Waldheim

Bug Description

Binary package hint: linux-image-generic

Systeminformation: Karmic - all packages are up to date.

ii linux-firmware 1.15 Firmware for Linux kernel drivers
ii linux-generic 2.6.31.4.15 Complete Generic Linux kernel
ii linux-headers-2.6.31-4 2.6.31-4.23 Header files related to Linux kernel version
ii linux-headers-2.6.31-4-generic 2.6.31-4.23 Linux kernel headers for version 2.6.31 on x
ii linux-headers-generic 2.6.31.4.15 Generic Linux kernel headers
ii linux-image-2.6.31-4-generic 2.6.31-4.23 Linux kernel image for version 2.6.31 on x86
ii linux-image-generic 2.6.31.4.15 Generic Linux kernel image

When I plugin the usb broadband modem (HUWAEI E220) the kernel has problems loading the driver and gives the following error message (N.B.: the modem worked fine with kernels prior to 2.6.31):

[ 147.592101] usb 3-2: new full speed USB device using uhci_hcd and address 2
[ 147.745490] usb 3-2: configuration #1 chosen from 1 choice
[ 147.843488] Initializing USB Mass Storage driver...
[ 147.845428] usbcore: registered new interface driver usb-storage
[ 147.845571] USB Mass Storage support registered.
[ 148.184126] usb 3-2: USB disconnect, address 2
[ 148.424074] usb 3-2: new full speed USB device using uhci_hcd and address 3
[ 148.578952] usb 3-2: configuration #1 chosen from 1 choice
[ 148.623697] usbcore: registered new interface driver usbserial
[ 148.623712] USB Serial support registered for generic
[ 148.623760] usbcore: registered new interface driver usbserial_generic
[ 148.623762] usbserial: USB Serial Driver core
[ 148.635846] USB Serial support registered for GSM modem (1-port)
[ 148.635888] option 3-2:1.0: GSM modem (1-port) converter detected
[ 148.635976] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB0
[ 148.635988] option 3-2:1.1: GSM modem (1-port) converter detected
[ 148.636062] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB1
[ 148.636077] usbcore: registered new interface driver option
[ 148.636079] option: v0.7.2:USB Driver for GSM modems
[ 170.209836] ------------[ cut here ]------------
[ 170.209848] WARNING: at /build/buildd/linux-2.6.31/drivers/usb/serial/usb-serial.c:436 serial_ioctl+0xb5/0xc0 [usbserial]()
[ 170.209850] Hardware name: Latitude D620
[ 170.209852] Modules linked in: option usbserial usb_storage binfmt_misc ppdev vboxnetadp vboxnetflt vboxdrv coretemp lp parport snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_pcm_oss snd_mixer_oss arc4 snd_pcm ecb snd_seq_dummy snd_seq_oss iwl3945 snd_seq_midi snd_rawmidi pcmcia iwlcore snd_seq_midi_event snd_seq snd_timer snd_seq_device mac80211 yenta_socket snd rsrc_nonstatic joydev soundcore led_class pcmcia_core nvidia(P) snd_page_alloc cfg80211 dell_wmi dell_laptop psmouse serio_raw dcdbas sha256_generic aes_x86_64 aes_generic cbc usbhid tg3 dm_crypt fbcon tileblit font bitblit softcursor i915 drm i2c_algo_bit video output intel_agp
[ 170.209910] Pid: 3161, comm: NetworkManager Tainted: P 2.6.31-4-generic #23-Ubuntu
[ 170.209913] Call Trace:
[ 170.209921] [<ffffffff81058f08>] warn_slowpath_common+0x78/0xb0
[ 170.209925] [<ffffffff81058f4f>] warn_slowpath_null+0xf/0x20
[ 170.209931] [<ffffffffa0f146d5>] serial_ioctl+0xb5/0xc0 [usbserial]
[ 170.209936] [<ffffffff812ebbbd>] tty_ioctl+0x9d/0x6e0
[ 170.209940] [<ffffffff8112702d>] vfs_ioctl+0x1d/0xa0
[ 170.209945] [<ffffffff8126feca>] ? __up_read+0x9a/0xc0
[ 170.209948] [<ffffffff81127659>] do_vfs_ioctl+0x79/0x370
[ 170.209952] [<ffffffff81077159>] ? up_read+0x9/0x10
[ 170.209957] [<ffffffff8151fd64>] ? do_page_fault+0x194/0x370
[ 170.209960] [<ffffffff811279d1>] sys_ioctl+0x81/0xa0
[ 170.209965] [<ffffffff81011fc2>] system_call_fastpath+0x16/0x1b
[ 170.209967] ---[ end trace 1d69160cf4c46917 ]---
[ 170.209972] ------------[ cut here ]------------
[ 170.209977] WARNING: at /build/buildd/linux-2.6.31/drivers/usb/serial/usb-serial.c:452 serial_set_termios+0x88/0xc0 [usbserial]()
[ 170.209980] Hardware name: Latitude D620
[ 170.209981] Modules linked in: option usbserial usb_storage binfmt_misc ppdev vboxnetadp vboxnetflt vboxdrv coretemp lp parport snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_pcm_oss snd_mixer_oss arc4 snd_pcm ecb snd_seq_dummy snd_seq_oss iwl3945 snd_seq_midi snd_rawmidi pcmcia iwlcore snd_seq_midi_event snd_seq snd_timer snd_seq_device mac80211 yenta_socket snd rsrc_nonstatic joydev soundcore led_class pcmcia_core nvidia(P) snd_page_alloc cfg80211 dell_wmi dell_laptop psmouse serio_raw dcdbas sha256_generic aes_x86_64 aes_generic cbc usbhid tg3 dm_crypt fbcon tileblit font bitblit softcursor i915 drm i2c_algo_bit video output intel_agp
[ 170.210024] Pid: 3161, comm: NetworkManager Tainted: P W 2.6.31-4-generic #23-Ubuntu
[ 170.210027] Call Trace:
[ 170.210030] [<ffffffff81058f08>] warn_slowpath_common+0x78/0xb0
[ 170.210034] [<ffffffff81058f4f>] warn_slowpath_null+0xf/0x20
[ 170.210039] [<ffffffffa0f14b28>] serial_set_termios+0x88/0xc0 [usbserial]
[ 170.210042] [<ffffffff812f0843>] change_termios+0x163/0x2c0
[ 170.210045] [<ffffffff812f0d3a>] set_termios+0x12a/0x220
[ 170.210049] [<ffffffff812f110e>] tty_mode_ioctl+0x11e/0x580
[ 170.210054] [<ffffffffa0f146d5>] ? serial_ioctl+0xb5/0xc0 [usbserial]
[ 170.210059] [<ffffffff8151a94c>] ? printk+0x3c/0x40
[ 170.210062] [<ffffffff81015e50>] ? show_trace+0x10/0x20
[ 170.210067] [<ffffffff81032419>] ? default_spin_lock_flags+0x9/0x10
[ 170.210070] [<ffffffff812f15a5>] n_tty_ioctl_helper+0x35/0x1b0
[ 170.210073] [<ffffffff812f1dc3>] ? tty_ldisc_ref_wait+0x13/0xc0
[ 170.210076] [<ffffffff812edf5e>] n_tty_ioctl+0x1e/0xe0
[ 170.210079] [<ffffffff812ebbf6>] tty_ioctl+0xd6/0x6e0
[ 170.210082] [<ffffffff8112702d>] vfs_ioctl+0x1d/0xa0
[ 170.210085] [<ffffffff8126feca>] ? __up_read+0x9a/0xc0
[ 170.210088] [<ffffffff81127659>] do_vfs_ioctl+0x79/0x370
[ 170.210091] [<ffffffff81077159>] ? up_read+0x9/0x10
[ 170.210094] [<ffffffff8151fd64>] ? do_page_fault+0x194/0x370
[ 170.210097] [<ffffffff811279d1>] sys_ioctl+0x81/0xa0
[ 170.210101] [<ffffffff81011fc2>] system_call_fastpath+0x16/0x1b
[ 170.210103] ---[ end trace 1d69160cf4c46918 ]---
[ 170.210327] BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
[ 170.210333] IP: [<ffffffffa0f14339>] serial_tiocmset+0x39/0xc0 [usbserial]
[ 170.210340] PGD 7bc03067 PUD 7bc00067 PMD 0
[ 170.210344] Oops: 0000 [#1] SMP
[ 170.210348] last sysfs file: /sys/devices/pci0000:00/0000:00:1c.1/0000:0c:00.0/ieee80211/phy0/rfkill2/state
[ 170.210352] CPU 0
[ 170.210354] Modules linked in: option usbserial usb_storage binfmt_misc ppdev vboxnetadp vboxnetflt vboxdrv coretemp lp parport snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_pcm_oss snd_mixer_oss arc4 snd_pcm ecb snd_seq_dummy snd_seq_oss iwl3945 snd_seq_midi snd_rawmidi pcmcia iwlcore snd_seq_midi_event snd_seq snd_timer snd_seq_device mac80211 yenta_socket snd rsrc_nonstatic joydev soundcore led_class pcmcia_core nvidia(P) snd_page_alloc cfg80211 dell_wmi dell_laptop psmouse serio_raw dcdbas sha256_generic aes_x86_64 aes_generic cbc usbhid tg3 dm_crypt fbcon tileblit font bitblit softcursor i915 drm i2c_algo_bit video output intel_agp
[ 170.210401] Pid: 3955, comm: pppd Tainted: P W 2.6.31-4-generic #23-Ubuntu Latitude D620
[ 170.210404] RIP: 0010:[<ffffffffa0f14339>] [<ffffffffa0f14339>] serial_tiocmset+0x39/0xc0 [usbserial]
[ 170.210410] RSP: 0018:ffff880037cc9e08 EFLAGS: 00010246
[ 170.210413] RAX: ffffffffa0f18700 RBX: 0000000000000000 RCX: 0000000000000002
[ 170.210415] RDX: 0000000000000000 RSI: ffff88005c847240 RDI: ffff88005b9ea800
[ 170.210418] RBP: ffff880037cc9e38 R08: ffffffff81564be0 R09: 0000000000000000
[ 170.210420] R10: 0000000000000001 R11: 0000000000000206 R12: ffff88005b9ea800
[ 170.210422] R13: 0000000000000000 R14: 0000000000000002 R15: ffff88005c847240
[ 170.210425] FS: 00007f5693f8e6f0(0000) GS:ffff8800019c8000(0000) knlGS:0000000000000000
[ 170.210428] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 170.210430] CR2: 0000000000000020 CR3: 000000004e48d000 CR4: 00000000000006b0
[ 170.210433] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 170.210435] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 170.210438] Process pppd (pid: 3955, threadinfo ffff880037cc8000, task ffff88004e595ac0)
[ 170.210440] Stack:
[ 170.210441] ffff880037cc9e38 ffff88005b9ea800 0000000000000000 ffff88005c847240
[ 170.210445] <0> 0000000000005417 ffff88005b9ea800 ffff880037cc9e98 ffffffff812ebeaf
[ 170.210449] <0> 00000000000000bc ffff880037cc9f48 0000000000dff7e8 0000000000000000
[ 170.210454] Call Trace:
[ 170.210458] [<ffffffff812ebeaf>] tty_ioctl+0x38f/0x6e0
[ 170.210462] [<ffffffff8112702d>] vfs_ioctl+0x1d/0xa0
[ 170.210466] [<ffffffff8101b378>] ? restore_i387_xstate+0x148/0x1d0
[ 170.210469] [<ffffffff81127659>] do_vfs_ioctl+0x79/0x370
[ 170.210472] [<ffffffff811279d1>] sys_ioctl+0x81/0xa0
[ 170.210476] [<ffffffff81011fc2>] system_call_fastpath+0x16/0x1b
[ 170.210478] Code: d5 8b 15 73 9c 00 00 4c 89 65 e0 4c 89 75 f0 49 89 fc 4c 89 7d f8 48 89 5d d8 49 89 f7 85 d2 41 89 ce 48 8b 9f 00 02 00 00 75 43 <8b> 43 20 85 c0 74 61 48 8b 03 48 8b 40 08 48 8b 98 50 01 00 00
[ 170.210514] RIP [<ffffffffa0f14339>] serial_tiocmset+0x39/0xc0 [usbserial]
[ 170.210520] RSP <ffff880037cc9e08>
[ 170.210522] CR2: 0000000000000020
[ 170.210525] ---[ end trace 1d69160cf4c46919 ]---

tags: added: regression-potential

I've tried a daily built kernel from http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/

ii linux-headers-2.6.31-999 2.6.31-999.200907311240
ii linux-headers-2.6.31-999-generic 2.6.31-999.200907311240
ii linux-image-2.6.31-999-generic 2.6.31-999.200907311240

Loading the option module works now without crashing, but the driver is only loaded automatically on boot. When I plug in the device later the module is not loaded (lsusb shows the device, dmesg reports that a usb-device has been added).

Shouldn't udev load the drivers now? /var/log/udev doesn't list anything about the modem after I've plugged it in.

The modem works if it is connected at boot time or if I load the module manually.

Another problem: when I unplug the device then there is a crash in the kernel log shown again (see attached file). I cannot use the device again as long as I do not reboot, because the usbserial module cannot be unloaded (it's marked as being still in use, forcing an unload does not work).

So there are still two problems - one with the kernel (modules) and the other with udev not loading the module.

As this modem worked flawlessly with Ubuntu 9.04 it is a regression.

summary: - Kernel cannot load option driver for Huawei E220 modem
+ option driver crashes usbserial

I've split this bug report as it affects two different parts of the system. Please see bug #407739 for the udev related bug report.

Changed in udev (Ubuntu):
status: New → Invalid

Loading the option driver when the modem is plugged in works now with kernel 2.6.31-5.24 - but only once, as the seems to go something wrong when unplugging the device. The option module can be unloaded manually, but usbserial can't as it is marked as being still in use. I'll attach the kernel output.

summary: - option driver crashes usbserial
+ unloading option driver crashes
kylea (kylea) wrote :

Karmic 64bit with Kernel 2.6.31-020631rc5-generic cannot disconnect the Mobile Broadband connection

Using Huawei E220 modem

[This is an automated message. Apologies if it has reached you inappropriately.]

This bug was reported against the linux-meta package when it likely should have been reported against the linux package instead. We are automatically transitioning this to the linux kernel package so that the appropriate teams are notified and made aware of this issue.

If this bug really is a bug in the linux-meta package you can move it back to linux-meta and set the Status to Confirmed, or contact us on the #ubuntu-kernel channel on the FreeNode IRC server. Thanks.

affects: linux-meta (Ubuntu) → linux (Ubuntu)

Update: automatically loading the option driver works now with 2.6.31-6, although network-manager crashes then (but this is an other bug).

I'll test if plugging and unplugging works now as well.

Kernel module doesn't crash anymore when device is unplugged. So far this problem has been fixed. Thanks!

Changed in linux (Ubuntu):
status: New → Fix Released

Tested it again with current kernel (2.6.31-8) - attaching and detaching the modem still does not work flawlessly.

summary: - unloading option driver crashes
+ loading/unloading of option driver does not work - breaks use of common
+ usb modems
Changed in linux (Ubuntu):
status: Fix Released → Confirmed
Download full text (11.7 KiB)

When I attach the modem (HUAWEI E220) after a fresh boot, then it works as it used to be:

The new device is recognized and the relevant modules are loaded (usbserial + option). Network-Manager automatically starts to configure and establish a connection.

[ 1316.068074] usb 3-2: new full speed USB device using uhci_hcd and address 2
[ 1316.283294] usb 3-2: configuration #1 chosen from 1 choice
[ 1316.302574] Initializing USB Mass Storage driver...
[ 1316.315148] usbcore: registered new interface driver usb-storage
[ 1316.315152] USB Mass Storage support registered.
[ 1316.652096] usb 3-2: USB disconnect, address 2
[ 1316.892058] usb 3-2: new full speed USB device using uhci_hcd and address 3
[ 1317.048319] usb 3-2: configuration #1 chosen from 1 choice
[ 1317.066867] usbcore: registered new interface driver usbserial
[ 1317.067123] USB Serial support registered for generic
[ 1317.070319] usbcore: registered new interface driver usbserial_generic
[ 1317.070322] usbserial: USB Serial Driver core
[ 1317.071913] USB Serial support registered for GSM modem (1-port)
[ 1317.071952] option 3-2:1.0: GSM modem (1-port) converter detected
[ 1317.072081] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB0
[ 1317.072092] option 3-2:1.1: GSM modem (1-port) converter detected
[ 1317.072148] usb 3-2: GSM modem (1-port) converter now attached to ttyUSB1
[ 1317.072163] usbcore: registered new interface driver option
[ 1317.072165] option: v0.7.2:USB Driver for GSM modems
[ 1327.648347] PPP BSD Compression module registered
[ 1327.651263] PPP Deflate Compression module registered

But when I detach the modem, then there is a crash shown in the kernel logs:

[ 1403.088136] usb 3-2: USB disconnect, address 3
[ 1403.088668] option: option_instat_callback: error -108
[ 1403.089096] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[ 1403.089124] option 3-2:1.0: device disconnected
[ 1403.089356] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[ 1403.089391] option 3-2:1.1: device disconnected
[ 1404.140384] BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
[ 1404.140397] IP: [<ffffffffa0f120a2>] serial_do_free+0x42/0x90 [usbserial]
[ 1404.140415] PGD 40115067 PUD 401f6067 PMD 0
[ 1404.140424] Oops: 0000 [#1] SMP ...

tags: added: regression-release
removed: regression-potential
tags: added: regression-potential
removed: regression-release
Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Triaged
Changed in linux (Ubuntu):
assignee: nobody → Leann Ogasawara (leannogasawara)

Just for information: modem still does not work with Linux 2.6.31-10-generic #30-Ubuntu SMP Tue Sep 8 12:32:38 UTC 2009 x86_64 GNU/Linux

Still crashes with latest kernel (2.6.31-11-generic #36-Ubuntu).

Is there a fix on the way because as soon as Karmic will be released there will be a lot more people facing this problem. Specially with notebooks you don't want to restart your system only to get online again. This should have a higher priority, as it worked without any problems in Jaunty and before.

Update: since the latest update of the kernel (2.6.31-12-generic -39) the oops/crash when the device is unplugged is gone but it's still not possible to detach the device and reconnect it later again. The option driver is not unloaded upon unplugging the device. And if I manually remove the option driver, it is not loaded anymore when the device is plugged in again. Even when I then load the driver manually, network-manager does not recognize/see the device again, thus I cannot use the modem.

Andy Whitcroft (apw) wrote :

We would not expect the options driver to be unloaded on removal, drivers generally do not unload in that circustance. We would expect the device to reappear without action on reinsertion. If the device does appear each time then its likely a userspace issue. So can you confirm that if you do not take any manual action on the driver does it get loaded on first connection and do the /dev/USB* devices appear and dissappear in combination with the insertion and removal of the device? Please supply dmesg and udevadm --monitor output for the period.

Changed in linux (Ubuntu):
status: Triaged → Incomplete

Andy, thank you for your testing instructions. I tried it and the kernel things seem to work properly now. I'm marking this as fixed and will open a new bug for n-m.

Changed in linux (Ubuntu):
status: Incomplete → Fix Released

Fixed in 2.6.31-12-generic #40

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers