USB stick probing
Grzegorz Bernacki
gjb at semihalf.com
Fri Dec 5 02:30:06 PST 2008
Hi,
We have a problem with discovering USB stick. We see following output after inserting the stick:
(da0:umass-sim0:0:0:0): Retrying Command
(da0:umass-sim0:0:0:0): Retrying Command
(da0:umass-sim0:0:0:0): Retrying Command
(da0:umass-sim0:0:0:0): Retrying Command
(da0:umass-sim0:0:0:0): error 6
(da0:umass-sim0:0:0:0): Unretryable Error
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <Generic USB Flash Disk 2.00> Removable Direct Access SCSI-2 device
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: UNIT ATTENTION, Not ready to ready change
I turned on some debugs to see which exact command fails and this is how sequence of commands looks like:
- INQUIRY
- INQUIRY
- TEST UNIT READY which fails with Not Ready
- READ CAPACITY which fails a few times and then we get error.
My knowlegde of CAM?XPT is very limited so I got some questions regarding probing devices by CAM/XPT:
1) Test unit ready is sent in PROBE_TUR_FOR_NEGOTIATION state. But we don't check for SCSI errors. So if TEST UNIT READY fails we just go on without retrying this command to the next state. Why we don't care if device is ready or not? Shouldn't we check the errors and retry the command? Are there any reason why we skip error checking?
2) After USB stick is inserted we start from PROBE_INQUIRY state. Is it expected behaviour? I thought we should start from PROBE_TUR.
I going to check the status of command in PROBE_TUR_FOR_NEGOTIATION and retry command if it fails. Is it good solution? Maybe it can be solved in other easier way.
Thanks in advance,
Grzesiek
More information about the freebsd-scsi
mailing list