Non-SCSI cam layer based device noise (was Re: Intermittent pauses copying from one usb drive to another)

From: Garrett Cooper <gcooper_at_FreeBSD.org>
Date: Sat, 5 Feb 2011 11:32:59 -0800
On Sat, Feb 5, 2011 at 6:34 AM, Hans Petter Selasky <hselasky_at_c2i.net> wrote:
> On Saturday 05 February 2011 14:27:56 Donald Allen wrote:
>> I've discussed problems with FreeBSD and usb sata drives on this list
>> in the past (as recently as last September), and have given up on
>> FreeBSD as a result of the usb disk problems (I do my backups with usb
>> drives) and other usb-related issues. But I've now replaced the usb
>> enclosures I was using at that time and have acquired some Toshiba usb
>> drives, so with this new equipment, I thought I'd give FreeBSD another
>> try, since generally I prefer it to Linux. But I'm having problems
>> again.
>>
>> Plugging in the Toshiba drives produces entries like this in
>> /var/log/message:
>
> Hi,
>
> Errors happen because the USB firmware of your USB hardware does not support
> all the SCSI commands issued by the CAM/SCSI layer. This is a well known
> problem. Probably Linux is better at filtering the SCSI commands passed to the
> various devices.
>
> Proof: I have a custom USB test software suite actually running under FreeBSD
> which can stress test mass storage devices. So far very few USB mass storage
> devices I've seen pass all the tests and recover properly. Most disks/memory
> sticks simply die at the first non-supported SCSI command and/or error
> scenario even though the SCSI and USB mass storage wrapper for SCSI commands
> define error codes to be returned in case of failure. Contact me off-list if
> you are interested in this.
>
> Solution: USB mass storage devices needs to be crippled down to a few SCSI
> commands like READ_12 and WRITE_12. This is not a USB problem. It needs to be
> done in the CAM/SCSI layer.

I know I'm sidetracking a bit, but ATACAM is in a similar boat because
I still run into corner cases like leaving a blank DVD+R in my burner
and something is polling the drive and it's coming back as follows
multiple times a second (snippets from /var/log/messages):

Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): READ
TOC/PMA/ATIP. CDB: 43 0 0 0 0 0 0 0 4 0
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): CAM status:
SCSI Status Error
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): SCSI status:
Check Condition
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): SCSI sense:
ILLEGAL REQUEST asc:24,0 (Invalid field in CDB): Command byte 6 is
invalid
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): READ
TOC/PMA/ATIP. CDB: 43 0 0 0 0 0 0 0 4 0
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): CAM status:
SCSI Status Error
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): SCSI status:
Check Condition
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): SCSI sense:
ILLEGAL REQUEST asc:24,0 (Invalid field in CDB): Command byte 6 is
invalid
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): READ
TOC/PMA/ATIP. CDB: 43 0 0 0 0 0 0 0 4 0
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): CAM status:
SCSI Status Error
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): SCSI status:
Check Condition
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): SCSI sense:
ILLEGAL REQUEST asc:24,0 (Invalid field in CDB): Command byte 6 is
invalid
Feb  2 03:00:01 bayonetta kernel: (cd0:ahcich0:0:0:0): READ
TOC/PMA/ATIP. CDB: 43 0 0 0 0 0 0 0 4 0

On a more relevant topic it would also be nice if the following noise
(note the "Medium not present" errors) didn't end up in the syslog
every time I turned on my monitor (the monitor has built in card
readers and I rarely populate them with real flash devices), but I
don't know if that's doable because it might break some helpful output
in syslog when failures do occur with real SCSI enabled devices:

ugen7.2: <vendor 0x0424> at usbus7
uhub8: <vendor 0x0424 product 0x2502, class 9/0, rev 2.00/0.01, addr
2> on usbus7
uhub8: 2 ports with 1 removable, self powered
ugen7.3: <vendor 0x0424> at usbus7
uhub9: <vendor 0x0424 product 0x2602, class 9/0, rev 2.00/0.00, addr
3> on usbus7
uhub9: 4 ports with 3 removable, self powered
ugen7.4: <Generic> at usbus7
umass0: <Generic Flash Card Reader, class 0/0, rev 2.00/4.44, addr 4> on usbus7
(probe0:umass-sim0:0:0:0): TEST UNIT READY. CDB: 0 0 0 0 0 0
(probe0:umass-sim0:0:0:0): CAM status: SCSI Status Error
(probe0:umass-sim0:0:0:0): SCSI status: Check Condition
(probe0:umass-sim0:0:0:0): SCSI sense: NOT READY asc:3a,0 (Medium not present)
da0 at umass-sim0 bus 0 scbus7 target 0 lun 0
da0: <Generic Flash HS-CF 4.44> Removable Direct Access SCSI-0 device
da0: 40.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
(probe0:umass-sim0:0:0:1): TEST UNIT READY. CDB: 0 20 0 0 0 0
(probe0:umass-sim0:0:0:1): CAM status: SCSI Status Error
(probe0:umass-sim0:0:0:1): SCSI status: Check Condition
(probe0:umass-sim0:0:0:1): SCSI sense: NOT READY asc:3a,0 (Medium not present)
da1 at umass-sim0 bus 0 scbus7 target 0 lun 1
da1: <Generic Flash HS-COMBO 4.44> Removable Direct Access SCSI-0 device
da1: 40.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present

$ camcontrol devlist
<ATAPI iHAS124   Y BL0V>           at scbus1 target 0 lun 0 (cd0,pass0)
<Hitachi HDS721010CLA332 JP4OA39C>  at scbus2 target 0 lun 0 (pass1,ada0)
<Generic Flash HS-CF 4.44>         at scbus7 target 0 lun 0 (pass2,da0)
<Generic Flash HS-COMBO 4.44>      at scbus7 target 0 lun 1 (pass3,da1)

$ uname -a
FreeBSD bayonetta.local 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r218082M:
Sun Jan 30 00:20:08 PST 2011
gcooper_at_bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA  amd64

Thanks!
-Garrett
Received on Sat Feb 05 2011 - 18:33:01 UTC

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