I've solved with this patch, thanks to motaboy:
===== drivers/usb/storage/scsiglue.c 1.84 vs edited ===== --- 1.84/drivers/usb/storage/scsiglue.c 2004-09-13 08:11:34 -04:00 +++ edited/drivers/usb/storage/scsiglue.c 2004-09-30 16:07:33 -04:00 @@ -175,7 +175,7 @@ US_DEBUGP("%s called\n", __FUNCTION__); srb->host_scribble = (unsigned char *)us;
- /* enqueue the command */ + /* check for state-transition errors */ if (us->sm_state != US_STATE_IDLE || us->srb != NULL) { printk(KERN_ERR USB_STORAGE "Error in %s: " "state = %d, us->srb = %p\n", @@ -183,10 +183,17 @@ return SCSI_MLQUEUE_HOST_BUSY; }
+ /* fail the command if we are disconnecting */ + if (test_bit(US_FLIDX_DISCONNECTING, &us->flags)) { + US_DEBUGP("Fail command during disconnect\n"); + srb->result = DID_NO_CONNECT << 16; + done(srb); + return 0; + } + + /* enqueue the command and wake up the control thread */ srb->scsi_done = done; us->srb = srb; - - /* wake up the process task */ up(&(us->sema));
return 0;
It works great with 2.6.9-bk4, I have not tested it with 2.6.9-final but maybe it works, even if in -bk4 there are several usb patches.
Waiting for 2.6.10 !
Fabio Erculiani wrote:
Since I use 2.6.8.1 I have a lot of problems (and most people have) with usb subsystem. Usb keys, usb hd and usb dvd recorders don't work or cause kernel errors in scsi subsystem. I'm terribly disappointed because from 2.6.7, things get worst and worst. Is it so hard to create a stable scsi subsystem??
With 2.6.9-bk4, problems are bit less huge. When I unplug my usb dvd writer, that's isn't mounted at all, scsi subsystem and usb subsystem crash. That's the dmesg output:
Device sr0 not ready.
usb 3-6: USB disconnect, address 4
scsi: Device offlined - not ready after error recovery: host 0 channel 0 id 0 l$sr 0:0:0:0: Illegal state transition cancel->offline
Badness in scsi_device_set_state at drivers/scsi/scsi_lib.c:1713
[<c0324af6>] scsi_device_set_state+0xc6/0x130
[<c0322674>] scsi_eh_offline_sdevs+0x64/0x80
[<c0322b03>] scsi_unjam_host+0xc3/0xd0
[<c0322bb2>] scsi_error_handler+0xa2/0xd0
[<c0322b10>] scsi_error_handler+0x0/0xd0
[<c01042b1>] kernel_thread_helper+0x5/0x14
And then, when I plug in something, kernel doesn't respond. With 2.6.9-final, the problem is much more big:
Oct 20 18:53:52 mars usb 3-6: USB disconnect, address 4
Oct 20 18:53:57 mars scsi: Device offlined - not ready after error recovery: host 0 channel 0 id 0 lun 0
Oct 20 18:53:57 mars sr 0:0:0:0: Illegal state transition cancel->offline
Oct 20 18:53:57 mars Badness in scsi_device_set_state at drivers/scsi/scsi_lib.c:1688
Oct 20 18:53:57 mars [<c030e346>] scsi_device_set_state+0xc6/0x120
Oct 20 18:53:57 mars [<c030c1f4>] scsi_eh_offline_sdevs+0x64/0x80
Oct 20 18:53:57 mars [<c030c677>] scsi_unjam_host+0xb7/0xc0
Oct 20 18:53:57 mars [<c030c722>] scsi_error_handler+0xa2/0xd0
Oct 20 18:53:57 mars [<c030c680>] scsi_error_handler+0x0/0xd0
Oct 20 18:53:57 mars [<c0104291>] kernel_thread_helper+0x5/0x14
Oct 20 18:53:57 mars Badness in kref_get at lib/kref.c:32
Oct 20 18:53:57 mars [<c0269c14>] kref_get+0x44/0x50
Oct 20 18:53:57 mars [<c02697ba>] kobject_get+0x1a/0x30
Oct 20 18:53:57 mars [<c02d1fa8>] get_device+0x18/0x30
Oct 20 18:53:57 mars [<c030dab5>] scsi_request_fn+0x25/0x310
Oct 20 18:53:57 mars [<c02d8c5c>] blk_insert_request+0xac/0xd0
Oct 20 18:53:57 mars [<c030ca35>] scsi_queue_insert+0x75/0xb0
Oct 20 18:53:57 mars [<c030c5b5>] scsi_eh_flush_done_q+0x85/0x90
Oct 20 18:53:57 mars [<c030c63f>] scsi_unjam_host+0x7f/0xc0
Oct 20 18:53:57 mars [<c030c722>] scsi_error_handler+0xa2/0xd0
Oct 20 18:53:57 mars [<c030c680>] scsi_error_handler+0x0/0xd0
Oct 20 18:53:57 mars [<c0104291>] kernel_thread_helper+0x5/0x14
Oct 20 18:53:57 mars Unable to handle kernel paging request at virtual address 00100104
Oct 20 18:53:57 mars printing eip:
Oct 20 18:53:57 mars c030fe66
Oct 20 18:53:57 mars *pde = 00000000
Oct 20 18:53:57 mars Oops: 0002 [#1]
Oct 20 18:53:57 mars Modules linked in: bttv ipt_limit ipt_REJECT ipt_state iptable_filter snd_bt87x tuner tvaudio video_buf firmware_class i2c_algo_bit v4l2_common btcx_risc videodev joydev asb100 eeprom it87 i2c_sensor i2c_nforce2 i2c_dev i2c_isa i2c_core ipt_MASQUERADE ip_nat_ftp iptable_nat ip_conntrack_ftp ip_conntrack ip_tables nvidia ehci_hcd ohci_hcd forcedeth
Oct 20 18:53:57 mars CPU: 0
Oct 20 18:53:57 mars EIP: 0060:[<c030fe66>] Tainted: P VLI
Oct 20 18:53:57 mars EFLAGS: 00010082 (2.6.9-ck1)
Oct 20 18:53:57 mars EIP is at scsi_device_dev_release+0x26/0xf0
Oct 20 18:53:57 mars eax: f7afa184 ebx: f7afa008 ecx: 00200200 edx: 00100100
Oct 20 18:53:57 mars esi: f7afa000 edi: 00000282 ebp: c190a6b4 esp: f744eea4
Oct 20 18:53:57 mars ds: 007b es: 007b ss: 0068
Oct 20 18:53:57 mars Process scsi_eh_0 (pid: 7196, threadinfo=f744e000 task=f7a3caa0)
Oct 20 18:53:57 mars Stack: 00000046 f7afa1a8 c04bc528 c04bc540 c190a6d8 c02d1c98 f7afa184 f7afa1a8
Oct 20 18:53:57 mars c04bc528 c04bc540 c0269868 f7afa1a8 f7afa1c0 c0269870 c190a600 f7cf4088
Oct 20 18:53:57 mars c0269c59 f7afa1a8 c190a600 f7cf4088 f7afa184 c19082b0 f7afa000 c026989e
Oct 20 18:53:57 mars Call Trace:
Oct 20 18:53:57 mars [<c02d1c98>] device_release+0x58/0x60
Oct 20 18:53:57 mars [<c0269868>] kobject_cleanup+0x98/0xa0
Oct 20 18:53:57 mars [<c0269870>] kobject_release+0x0/0x10
Oct 20 18:53:57 mars [<c0269c59>] kref_put+0x39/0xa0
Oct 20 18:53:57 mars [<c026989e>] kobject_put+0x1e/0x30
Oct 20 18:53:57 mars [<c0269870>] kobject_release+0x0/0x10
Oct 20 18:53:57 mars [<c030dc4f>] scsi_request_fn+0x1bf/0x310
Oct 20 18:53:57 mars [<c02d8c5c>] blk_insert_request+0xac/0xd0
Oct 20 18:53:57 mars [<c030ca35>] scsi_queue_insert+0x75/0xb0
Oct 20 18:53:57 mars [<c030c5b5>] scsi_eh_flush_done_q+0x85/0x90
Oct 20 18:53:57 mars [<c030c63f>] scsi_unjam_host+0x7f/0xc0
Oct 20 18:53:57 mars [<c030c722>] scsi_error_handler+0xa2/0xd0
Oct 20 18:53:57 mars [<c030c680>] scsi_error_handler+0x0/0xd0
Oct 20 18:53:57 mars [<c0104291>] kernel_thread_helper+0x5/0x14
Oct 20 18:53:57 mars Code: fc ff 8d 76 00 55 57 56 53 83 ec 04 8b 44 24 18 8b 68 20 8d b0 7c fe ff ff 9c 5f fa 8d 98 84 fe ff ff 8b 90 84 fe ff ff 8b 4b 04 <89> 4a 04 89 11 c7 43 04 00 02 20 00 8d 98 8c fe ff ff 8b 90 8c
Oct 20 18:53:57 mars Badness in kref_get at lib/kref.c:32
Oct 20 18:53:57 mars [<c0269c14>] kref_get+0x44/0x50
Oct 20 18:53:57 mars [<c02697ba>] kobject_get+0x1a/0x30
Oct 20 18:53:57 mars [<c02d1fa8>] get_device+0x18/0x30
Oct 20 18:53:57 mars [<c030dab5>] scsi_request_fn+0x25/0x310
Oct 20 18:53:57 mars [<c02d8320>] blk_unplug_work+0x0/0x20
Oct 20 18:53:57 mars [<c02d6506>] elv_next_request+0x16/0x110
Oct 20 18:53:57 mars [<c02d8320>] blk_unplug_work+0x0/0x20
Oct 20 18:53:57 mars [<c02d82ce>] __generic_unplug_device+0x3e/0x40
Oct 20 18:53:57 mars [<c02d82e0>] generic_unplug_device+0x10/0x20
Oct 20 18:53:57 mars [<c02d8330>] blk_unplug_work+0x10/0x20
Oct 20 18:53:57 mars [<c0128dae>] worker_thread+0x19e/0x240
Oct 20 18:53:57 mars [<c0117580>] default_wake_function+0x0/0x20
Oct 20 18:53:57 mars [<c03fe3e5>] schedule+0x225/0x3c0
Oct 20 18:53:57 mars [<c0117580>] default_wake_function+0x0/0x20
Oct 20 18:53:57 mars [<c0128c10>] worker_thread+0x0/0x240
Oct 20 18:53:57 mars [<c012c7e5>] kthread+0xa5/0xb0
Oct 20 18:53:57 mars [<c012c740>] kthread+0x0/0xb0
Oct 20 18:53:57 mars [<c0104291>] kernel_thread_helper+0x5/0x14
Oct 20 18:53:57 mars Unable to handle kernel paging request at virtual address 00100104
Oct 20 18:53:57 mars printing eip:
Oct 20 18:53:57 mars c030fe66
Oct 20 18:53:57 mars *pde = 00000000
Oct 20 18:53:57 mars Oops: 0002 [#2]
Oct 20 18:53:57 mars Modules linked in: bttv ipt_limit ipt_REJECT ipt_state iptable_filter snd_bt87x tuner tvaudio video_buf firmware_class i2c_algo_bit v4l2_common btcx_risc videodev joydev asb100 eeprom it87 i2c_sensor i2c_nforce2 i2c_dev i2c_isa i2c_core ipt_MASQUERADE ip_nat_ftp iptable_nat ip_conntrack_ftp ip_conntrack ip_tables nvidia ehci_hcd ohci_hcd forcedeth
Oct 20 18:53:57 mars CPU: 0
I'm not subscribed to this mailing list but I hope that someone will answear to me and to a lot of other users that have the SAME problem.
Fabio Erculiani lxnay Gentoo Rescue Reiser4 LiveCD creator
------------------------------------------------------- This SF.net email is sponsored by: IT Product Guide on ITManagersJournal Use IT products in your business? Tell us what you think of them. Give us Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more http://productguide.itmanagersjournal.com/guidepromo.tmpl _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel