Comment 8 for bug 375419

Revision history for this message
ozstriker78 (ozstriker78) wrote :

It seems that there is some sort of race condition. I was able to get the
usb-storage driver to work, but it still seems to crash. I wrote a basic
script to rmmod all the related device drivers, then load them up in a specific
order, with a sleep statement.

Here is the script:

===== cut ========
rmmod usb_storage
rmmod option
rmmod usbserial
echo "sleeping for 2 seconds to let the drivers unload...." && sleep 2
modprobe option
echo "sleeping for 2 seconds to make usb_storage detect the storage device..."
&& sleep 2 && echo "done sleeping"
modprobe usb_storage
===== cut ========

If I set the sleep time to 10 seconds, the usb_storage device isn't detected.
If I take out the "sleep 2", then the usb_storage device isn't detected either.
 So it seems there needs to be a delay after the "option" module is loaded in
order for usb_storage to see the storage device. What doesn't make sense is
that if you wait more than 10 seconds after the "option" driver is loaded, then
usb_storage can't see the storage device.

Here is dmesg (something is still crashing):

root@rgarcia-desktop:/# dmesg
[ 5023.686339] usbcore: deregistering interface driver usb-storage
[ 5023.743112] usbcore: deregistering interface driver option
[ 5023.743346] option1 ttyUSB1: GSM modem (1-port) converter now disconnected
from ttyUSB1
[ 5023.743393] option 1-3:1.1: device disconnected
[ 5023.743622] option1 ttyUSB0: GSM modem (1-port) converter now disconnected
from ttyUSB0
[ 5023.743667] option 1-3:1.0: device disconnected
[ 5023.743703] USB Serial deregistering driver GSM modem (1-port)
[ 5023.751374] usbcore: deregistering interface driver usbserial_generic
[ 5023.751434] USB Serial deregistering driver generic
[ 5023.751474] usbcore: deregistering interface driver usbserial
[ 5025.783499] usbcore: registered new interface driver usbserial
[ 5025.783541] USB Serial support registered for generic
[ 5025.783643] usbcore: registered new interface driver usbserial_generic
[ 5025.783650] usbserial: USB Serial Driver core
[ 5025.794128] USB Serial support registered for GSM modem (1-port)
[ 5025.794228] option 1-3:1.0: GSM modem (1-port) converter detected
[ 5025.794466] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB0
[ 5025.794494] option 1-3:1.1: GSM modem (1-port) converter detected
[ 5025.794620] usb 1-3: GSM modem (1-port) converter now attached to ttyUSB1
[ 5025.794674] usbcore: registered new interface driver option
[ 5025.794680] option: v0.7.2:USB Driver for GSM modems
[ 5027.847140] Initializing USB Mass Storage driver...
[ 5027.856108] ------------[ cut here ]------------
[ 5027.856117] WARNING: at
/home/kernel-ppa/mainline/build/fs/proc/generic.c:547
proc_register+0xa0/0x130()
[ 5027.856126] Hardware name: 23736YU
[ 5027.856131] proc_dir_entry 'scsi/usb-storage' already registered
[ 5027.856137] Modules linked in: usb_storage(+) option usbserial nls_cp437
isofs ppp_deflate zlib_deflate bsd_comp ppp_async xt_conntrack binfmt_misc
radeon drm ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 nf_defrag_ipv4
xt_state nf_conntrack ipt_REJECT xt_tcpudp iptable_filter ip_tables x_tables
bridge stp lp pcmcia joydev snd_intel8x0 snd_ac97_codec ac97_bus snd_pcm_oss
snd_mixer_oss snd_pcm snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi
snd_seq_midi_event snd_seq snd_timer snd_seq_device thinkpad_acpi iTCO_wdt
iTCO_vendor_support nsc_ircc ipw2100 libipw led_class yenta_socket
rsrc_nonstatic pcmcia_core lib80211 intel_agp snd soundcore ppdev psmouse
serio_raw nvram irda pcspkr video agpgart snd_page_alloc shpchp parport_pc
parport crc_ccitt output reiserfs sha256_generic aes_i586 aes_generic cbc
usbhid e1000 dm_crypt [last unloaded: usbserial]
[ 5027.856315] Pid: 8795, comm: modprobe Tainted: G W
2.6.29-02062904-generic #02062904
[ 5027.856323] Call Trace:
[ 5027.856340] [<c013a636>] warn_slowpath+0x86/0xa0
[ 5027.856354] [<c02c1841>] ? sub_alloc+0x61/0x150
[ 5027.856367] [<c01220f8>] ? default_spin_lock_flags+0x8/0x10
[ 5027.856379] [<c04f7d42>] ? _spin_lock_irqsave+0x32/0x50
[ 5027.856390] [<c02c1b80>] ? ida_get_new_above+0x110/0x180
[ 5027.856401] [<c02c1b80>] ? ida_get_new_above+0x110/0x180
[ 5027.856412] [<c02c1ce0>] ? idr_pre_get+0x20/0x50
[ 5027.856422] [<c02c1bfc>] ? ida_get_new+0xc/0x10
[ 5027.856432] [<c01fffd7>] ? get_inode_number+0x47/0xa0
[ 5027.856442] [<c02000d0>] proc_register+0xa0/0x130
[ 5027.856452] [<c0200333>] proc_mkdir_mode+0x33/0x50
[ 5027.856472] [<c020035f>] proc_mkdir+0xf/0x20
[ 5027.856483] [<c036e5f6>] scsi_proc_hostdir_add+0x46/0x80
[ 5027.856494] [<c0362c80>] scsi_host_alloc+0x240/0x2b0
[ 5027.856504] [<c0366580>] ? scsi_error_handler+0x0/0x120
[ 5027.856542] [<f9b0aaae>] storage_probe+0x1e/0x1b0 [usb_storage]
[ 5027.856554] [<c03b7c89>] ? usb_autopm_do_device+0x79/0xf0
[ 5027.856564] [<c03b6cc7>] ? usb_match_one_id+0x27/0xa0
[ 5027.856587] [<c03b82db>] usb_probe_interface+0x9b/0x140
[ 5027.856598] [<c020d482>] ? sysfs_create_link+0x12/0x20
[ 5027.856615] [<c034d256>] really_probe+0x56/0x150
[ 5027.856624] [<c03b6d7b>] ? usb_match_id+0x3b/0x50
[ 5027.856643] [<c034d38b>] driver_probe_device+0x3b/0x50
[ 5027.856654] [<c034d421>] __driver_attach+0x81/0x90
[ 5027.856668] [<c034c909>] bus_for_each_dev+0x49/0x70
[ 5027.856682] [<c034d109>] driver_attach+0x19/0x20
[ 5027.856692] [<c034d3a0>] ? __driver_attach+0x0/0x90
[ 5027.856702] [<c034cf47>] bus_add_driver+0x107/0x1a0
[ 5027.856719] [<c034d702>] driver_register+0x42/0xc0
[ 5027.856732] [<c01baf6e>] ? percpu_free+0x1e/0x30
[ 5027.856746] [<c03b7575>] usb_register_driver+0x75/0xd0
[ 5027.856776] [<f9b21000>] ? usb_stor_init+0x0/0x41 [usb_storage]
[ 5027.856808] [<f9b21000>] ? usb_stor_init+0x0/0x41 [usb_storage]
[ 5027.856834] [<f9b21027>] usb_stor_init+0x27/0x41 [usb_storage]
[ 5027.856849] [<c010111b>] _stext+0x2b/0x160
[ 5027.856863] [<c0186bb8>] ? tracepoint_module_notify+0x28/0x30
[ 5027.856874] [<c04fa69d>] ? notifier_call_chain+0x2d/0x60
[ 5027.856891] [<c01538ad>] ? __blocking_notifier_call_chain+0x4d/0x60
[ 5027.856910] [<c01646c3>] sys_init_module+0x83/0x1b0
[ 5027.856921] [<c010346b>] sysenter_do_call+0x12/0x2f
[ 5027.856932] [<c04f0000>] ? get_model_name+0x10/0x100
[ 5027.856939] ---[ end trace 4470547f96b38b69 ]---
[ 5030.865579] usb-storage: probe of 1-3:1.2 failed with error -1
[ 5034.864310] scsi81 : SCSI emulation for USB Mass Storage devices
[ 5034.866598] usbcore: registered new interface driver usb-storage
[ 5034.866610] USB Mass Storage support registered.
[ 5034.869852] usb-storage: device found at 10
[ 5034.869860] usb-storage: waiting for device to settle before scanning
[ 5040.876527] usb-storage: device scan complete
[ 5040.878642] scsi 81:0:0:0: Direct-Access HUAWEI MMC Storage 2.31
PQ: 0 ANSI: 2
[ 5040.909212] sd 81:0:0:0: [sdb] 246016 512-byte hardware sectors: (125 MB/120
MiB)
[ 5040.936611] sd 81:0:0:0: [sdb] Write Protect is off
[ 5040.936623] sd 81:0:0:0: [sdb] Mode Sense: 0f 0e 00 00
[ 5040.936630] sd 81:0:0:0: [sdb] Assuming drive cache: write through
[ 5040.944956] sd 81:0:0:0: [sdb] 246016 512-byte hardware sectors: (125 MB/120
MiB)
[ 5040.947949] sd 81:0:0:0: [sdb] Write Protect is off
[ 5040.947959] sd 81:0:0:0: [sdb] Mode Sense: 0f 0e 00 00
[ 5040.947966] sd 81:0:0:0: [sdb] Assuming drive cache: write through
[ 5040.947978] sdb: sdb4
[ 5040.954044] sd 81:0:0:0: [sdb] Attached SCSI removable disk
[ 5040.954216] sd 81:0:0:0: Attached scsi generic sg2 type 0