From owner-freebsd-fs@FreeBSD.ORG Fri Feb 15 01:13:43 2013 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42963BE5 for ; Fri, 15 Feb 2013 01:13:43 +0000 (UTC) (envelope-from jdc@koitsu.org) Received: from qmta01.emeryville.ca.mail.comcast.net (qmta01.emeryville.ca.mail.comcast.net [IPv6:2001:558:fe2d:43:76:96:30:16]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8F48B0 for ; Fri, 15 Feb 2013 01:13:43 +0000 (UTC) Received: from omta05.emeryville.ca.mail.comcast.net ([76.96.30.43]) by qmta01.emeryville.ca.mail.comcast.net with comcast id 0NWJ1l00K0vp7WLA1RDij7; Fri, 15 Feb 2013 01:13:42 +0000 Received: from koitsu.strangled.net ([67.180.84.87]) by omta05.emeryville.ca.mail.comcast.net with comcast id 0RDh1l00T1t3BNj8RRDicS; Fri, 15 Feb 2013 01:13:42 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id A838973A1C; Thu, 14 Feb 2013 17:13:41 -0800 (PST) Date: Thu, 14 Feb 2013 17:13:41 -0800 From: Jeremy Chadwick To: fusionfoto@gmail.com Subject: Re: Is this an SSD problem or a controller problem? Message-ID: <20130215011341.GA96241@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20121106; t=1360890822; bh=ON6/bSWNq4u8XnJyOj6YSvku97vPlzIPb4iNBJpRQ1c=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=oIeiojVfFarfrZFNlqxCk77YpqFfv3V3CSeOxIzo5A/a+OV9FaLYfN4PM2e0EnB9R 2SDraGGtPH8vsz/RqPgNjHnQID+wZILht4ynfVsVIDnA0JOHpEJcIj9uRn+SCh8bAT YCn3ngtKBEFeIuvgEBqa308ctjM0AmOpvsup8Ghn11/d1VOCHG8RpYom9xFn0qXTWO mGUr4xtp1VZcdjyskidmyHdniJI9OGQBTwaeqd8FkYq7mAJUAdHQCUnNZFCAgAlvAO X6NJM568mLOF1ByMCNLkBl8pzeBgFiL4UBXeGVyBr5dn8GUaKGlAcOdpAMP8quzLQS nIjiG/NW7j4TQ== Cc: freebsd-fs@freebsd.org, mav@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Feb 2013 01:13:43 -0000 (Please keep me CC'd as I am not subscribed to this list) (Also CC'ing mav@ since he can shed some light on this too) Re: http://lists.freebsd.org/pipermail/freebsd-questions/2013-February/249183.html It is neither an SSD problem nor a controller problem. FreeBSD is issuing a specific ATA CDB command to the SSD, and the SSD rejects this request, returning ABRT status. This is perfectly normal per ATA specification; the "error" is harmless. You should open a PR on this matter, as FreeBSD should be adjusted in some manner to deal with this situation, either via appropriate workarounds or a drive quirk. mav@ would know what's best. You will need to provide output from the following commands in your PR: * dmesg * camcontrol identify ada15 * pciconf -lvcb * Same lines you did in your Email Further technical details, which you can put into the PR if you want: Looking at src/sys/cam/ata/ata_all.c we can see that the output of the ACB is in bytes, output per ata_cmd_string(). Thus: > ACB: ef 90 00 00 00 40 00 00 00 00 02 00 Decoding per T13/2015-D rev 3 (ATA8-ACS2) working draft spec: 0xef = command = SET FEATURES 0x90 = features = Disable use of SATA feature 0x00 0x00 0x00 = lba_* = n/a 0x40 = device = n/a 0x00 0x00 0x00 = lba_*_exp = n/a 0x00 = features_exp = n/a 0x02 = sector_count = Enable/Disable DMA Setup FIS Auto-Activate Optimisation 0x00 = sector_count_exp = n/a DMA Setup FIS is defined as: "7.50.16.3 Enable/Disable DMA Setup FIS Auto-Activate Optimization A Count field value of 02h is used to enable or disable DMA Setup FIS Auto-Activate optimization. See SATA 2.6 for more information. The enable/disable state for the auto-activate optimization shall be preserved across software reset. The enable/disable state for the auto-activate optimization shall be reset to its default state upon COMRESET." This feature has to do with NCQ capability for certain types of DMA transfers. src/sys/cam/ata/ata_xpt.c contains the responsible code. I could be wrong here (mav@ please correct me), but in probestart(), there is: 452 case PROBE_SETDMAAA: 453 cam_fill_ataio(ataio, 454 1, 455 probedone, 456 CAM_DIR_NONE, 457 0, 458 NULL, 459 0, 460 30*1000); 461 ata_28bit_cmd(ataio, ATA_SETFEATURES, 462 (softc->caps & CTS_SATA_CAPS_H_DMAAA) ? 0x10 : 0x90, 463 0, 0x02); 464 break; CTS_SATA_CAPS_H_DMAAA is defined per include/cam/cam_ccb.h as "Auto-activation", and its name implies DMA, so this would match the feature in question. This would explain why you see it when the machine boots (xpt(4) probe), as well as when smartctl is run or smartd starts (uses xpt(4)). However, I noticed this piece of code in probedone(): 739 /* 740 * Some HP SATA disks report supported DMA Auto-Activation, 741 * but return ABORT on attempt to enable it. 742 */ 743 } else if (softc->action == PROBE_SETDMAAA && 744 status == CAM_ATA_STATUS_ERROR) { 745 goto noerror; Which makes me scratch my head -- the comment and logic seems to imply there shouldn't be any error condition reported, but you do see one. This also implies that the drive advertises per SATA protocol DMA AA yet when xpt(4) tries to disable it the drive rejects that request with ABRT. I don't know why OCZ rejects disabling that feature, but whatever. Addendum note for mav@ -- we also need to add an ADA_Q_4K quirk entry to ata_da.c for Vertex 4 SSDs ("OCZ-VERTEX4"). -- | Jeremy Chadwick jdc@koitsu.org | | UNIX Systems Administrator http://jdc.koitsu.org/ | | Mountain View, CA, US | | Making life hard for others since 1977. PGP 4BD6C0CB |