Skip to contentSkip to conversation

Problem with external USB2.0 case and LG GSA 4040-B

linux-usb-devel Alan Stern 2 participants 3 messages Dec 15, 2003 – Dec 16, 2003 1 message not in the archive SCSI

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Alan Stern

author
#1 lore raw

Patrick:

Cornelius Claussen reported the following problem with error recovery in 2.6.0-test11. His device is one of those problem-prone Genesys Logic units, a USB DVD drive. The complete message and log can be found at

http://marc.theaimsgroup.com/?l=linux-usb-devel&m=107134787817252&w=2

Here's a condensed and annotated version of his log:

usb-storage: Command READ_10 (10 bytes)
usb-storage: 28 00 00 00 b6 91 00 00 2e 00
usb-storage: Status code -75; transferred 68096/94208
usb-storage: -- babble
usb-storage: -- transport indicates error, resetting
usb-storage: Soft reset done
usb-storage: scsi cmd done, result=0x70000

The device messed up; to recover we had to send it a soft reset command. The scmd->result code was DID_ERROR << 16. The SCSI layer retried the command:

usb-storage: Command READ_10 (10 bytes)
usb-storage: 28 00 00 00 b6 91 00 00 2e 00
usb-storage: -- transport indicates command failure
usb-storage: -- unexpectedly short transfer
usb-storage: Issuing auto-REQUEST_SENSE
usb-storage: -- code: 0x70, key: 0x6, ASC: 0x29, ASCQ: 0x0
usb-storage: Unit Attention: Power on, reset, or bus device reset occurred
usb-storage: scsi cmd done, result=0x2

The device reported the reset via Unit Attention. The scmd->result code was SAM_STAT_CHECK_CONDITION. Presumably another retry at this point would have worked. Instead he got...

end_request: I/O error, dev sr1, sector 186948 Buffer I/O error on device sr1, logical block 46737 Buffer I/O error on device sr1, logical block 46738 etc.

In fact, another READ command queued shortly afterward,

usb-storage: Command READ_10 (10 bytes)
usb-storage: 28 00 00 00 b6 bf 00 00 3c 00
usb-storage: Bulk Status S 0x53425355 T 0xec9 R 2048 Stat 0x0
usb-storage: scsi cmd done, result=0x0

succeeded, albeit with a residue of 2048. But by then it was too late, the original request had failed.

What's the right way to fix this?

Alan Stern

#2 lore raw
Quoted 3 lines · Alan Stern

Cornelius Claussen reported the following problem with error recovery in 2.6.0-test11. His device is one of those problem-prone Genesys Logic units, a USB DVD drive. The complete message and log can be found at

It looks like the driver sent a reset to the device on its own without reporting it to the mid-layer.

There's an expecting_cc_ua flag in the scsi_device. It gets set on error recovery actions, or if the device does something to detect or trigger a reset (that's the scsi_report_device_reset() and scsi_report_bus_reset() API's).

James

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

#3 lore raw
In reply to Alan Stern

I've been thinking some more about this. Although the driver is apparently at fault here by issuing a reset without telling the mid-layer, it might be useful to filter out other common ASC/ASCQ codes in scsi_io_completion() we retry on "in the process of becoming ready", then for any other UNIT_ATTENTION, we assume it was a disc change for removable (this is what causes the I/O error in this case) or a reset for non-removable.

Perhaps we should do a more dilligent check for the reset case? ASC 0x29 and ASCQ <= 4 seems to identify all the reset cases. Since the tape case doesn't come through here, there's no danger of doing an incorrect retry for it.

There is, however, one danger to the removable case: a power cycle could still be accompanied by a medium change, which would now be missed.

On the whole, I'm inclined to leave everything the way it is, but was wondering if there were any other comments?

James