problem with usb memory stick (with patch)

From: Michal Mertl <mime_at_traveller.cz>
Date: Fri, 25 Mar 2005 00:46:39 +0100
Hello all,

I've got a USB 2.0 memory stick which doesn't attach correctly.

On failed attach I get the following in the messages:

--------
Mar 24 23:44:13 genius2 kernel: umass0: M-SysT5 Dell Memory Key, rev
2.00/2.00, addr 2
Mar 24 23:44:13 genius2 kernel: umass0: SCSI over Bulk-Only; quirks =
0x0
Mar 24 23:44:13 genius2 kernel: umass0:0:0:-1: Attached to scbus0
Mar 24 23:44:14 genius2 kernel: pass0 at umass-sim0 bus 0 target 0 lun 0
Mar 24 23:44:14 genius2 kernel: pass0: <M-SysT5 Dell Memory Key 5.00>
Removable Direct Access SCSI-0 device 
Mar 24 23:44:14 genius2 kernel: pass0: Serial Number u
Mar 24 23:44:14 genius2 kernel: pass0: 40.000MB/s transfers
Mar 24 23:44:14 genius2 kernel: GEOM: new disk da0
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): Retrying Command
Mar 24 23:44:14 genius2 last message repeated 3 times
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): error 6
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): Unretryable
Error
Mar 24 23:44:14 genius2 kernel: da0 at umass-sim0 bus 0 target 0 lun 0
Mar 24 23:44:14 genius2 kernel: da0: <M-SysT5 Dell Memory Key 5.00>
Removable Direct Access SCSI-0 device 
Mar 24 23:44:14 genius2 kernel: da0: Serial Number u
Mar 24 23:44:14 genius2 kernel: da0: 40.000MB/s transfers
Mar 24 23:44:14 genius2 kernel: da0: Attempt to query device size
failed: UNIT ATTENTION, Medium not present
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): READ CAPACITY.
CDB: 25 0 0 0 0 0 0 0 0 0 
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): CAM Status: SCSI
Status Error
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): SCSI Status:
Check Condition
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): UNIT ATTENTION
asc:3a,0
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): Medium not
present
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0):
(da0:umass-sim0:0:0:0): READ CAPACITY. CDB: 25 0 0 0 0 0 0 0 0 0 
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): UNIT ATTENTION
asc:3a,0
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): Medium not
present
.
.
.
Mar 24 23:44:14 genius2 kernel: Retries Exhausted
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): error 6
Mar 24 23:44:14 genius2 kernel: (da0:umass-sim0:0:0:0): Unretryable
Error
Mar 24 23:44:14 genius2 kernel: Opened disk da0 -> 6
---------


Quite a long time ago I found out that the stick works when I delay the
attachment a bit - increasing USB_PORT_POWERUP_DELAY (in
src/sys/dev/usb/usb.h) from 300 to 1000 helps. I found another, probably
a bit more elegant, solution - I invented a new quirk and put it into
use in umass.c which delays the scsi attachment in umass_cam_attach.

There's a comment just above the callout (which firing after longer
delay is the main part of the "fix") which reads:

/* Notify CAM of the new device after a short delay. Any
 * failure is benign, as the user can still do it byhand
 * (camcontrol rescan <busno>). Only do this if we are not
 * booting, because CAM does a scan after booting has
 * completed, when interrupts have been enabled.
 */

The comment isn't probably correct - no 'eject', 'stop', 'rescan' or
'reset' will ever fix the stick for me.

I don't know if the problem is specific to my USB device. If it is than
the quirk might be appropriate solution but if other devices need the
pause too (and maybe even much longer) than fixing the code some other
way (to make the comment true?) might be better.

Michal Mertl


Received on Thu Mar 24 2005 - 22:46:45 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:30 UTC