From owner-freebsd-current@FreeBSD.ORG Sat Feb 5 19:33:01 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 44E14106564A; Sat, 5 Feb 2011 19:33:01 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 9E51B8FC08; Sat, 5 Feb 2011 19:33:00 +0000 (UTC) Received: by wyf19 with SMTP id 19so3452019wyf.13 for ; Sat, 05 Feb 2011 11:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:cc:content-type; bh=z3lwv1QL8y8FwYN0UjPhDKy83iz+hPeaQwLFSfQL2gY=; b=pWabPxA6cNNnIYVPB0gaxNHe3KXbV7nl1b+owM6/QTjd6r4NbZXCrlGyunccoxvdTQ efQ3VjMjTOAvsgEOlnKLkFC3iePB/JVMLLnM0d9HDSw8ywMK8PVopLhBPnVh1rOPYMtO Vfz4ayAax38THUBm1nVfisR4ToaaEAaeMo13k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:cc:content-type; b=vM1aiPB7xQteVi3VU+fawGYovKwKXCr4N7t6ZlbRMNwvKVWZBkipeaZwRRl5i54yke 2aPUsMryLA/YKQb5BXc8VMQFf9Ui9C+xPYXt9ebPHLm+CmUHcXZAd48sQyhDvyQcqToL KYwck8PEAe+gdDQx1rwAVlVtc87dW2uDAAD8Y= MIME-Version: 1.0 Received: by 10.216.154.8 with SMTP id g8mr731184wek.12.1296934379490; Sat, 05 Feb 2011 11:32:59 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.71.200 with HTTP; Sat, 5 Feb 2011 11:32:59 -0800 (PST) Date: Sat, 5 Feb 2011 11:32:59 -0800 X-Google-Sender-Auth: s5JKZvvbiKSJjac-pHloRH1zs98 Message-ID: From: Garrett Cooper To: Hans Petter Selasky Content-Type: text/plain; charset=ISO-8859-1 Cc: Alexander Motin , freebsd-current@freebsd.org Subject: Non-SCSI cam layer based device noise (was Re: Intermittent pauses copying from one usb drive to another) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 Feb 2011 19:33:01 -0000 On Sat, Feb 5, 2011 at 6:34 AM, Hans Petter Selasky 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: at usbus7 uhub8: on usbus7 uhub8: 2 ports with 1 removable, self powered ugen7.3: at usbus7 uhub9: on usbus7 uhub9: 4 ports with 3 removable, self powered ugen7.4: at usbus7 umass0: 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: 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: 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 at scbus1 target 0 lun 0 (cd0,pass0) at scbus2 target 0 lun 0 (pass1,ada0) at scbus7 target 0 lun 0 (pass2,da0) 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@bayonetta.local:/usr/obj/usr/src/sys/BAYONETTA amd64 Thanks! -Garrett