From owner-svn-src-head@FreeBSD.ORG Wed Aug 20 22:58:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C62031D; Wed, 20 Aug 2014 22:58:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2CA3062; Wed, 20 Aug 2014 22:58:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7KMwDLg073410; Wed, 20 Aug 2014 22:58:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7KMwDh3073409; Wed, 20 Aug 2014 22:58:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201408202258.s7KMwDh3073409@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Aug 2014 22:58:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r270249 - head/sys/cam/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Aug 2014 22:58:13 -0000 Author: imp Date: Wed Aug 20 22:58:12 2014 New Revision: 270249 URL: http://svnweb.freebsd.org/changeset/base/270249 Log: Turns out that IDENTIFY DEVICE and IDENTIFY PACKET DEVICE return data that's only mostly similar. Specifically word 78 bits are defined for IDENTIFY DEVICE as 5 Supports Hardware Feature Control while a IDENTIFY PACKET DEVICE defines them as 5 Asynchronous notification supported Therefore, only pay attention to bit 5 when we're talking to ATAPI devices (we don't use the hardware feature control at this time). Ignore it for ATA devices. Remove kludge that papered over this issue for Samsung SATA SSDs, since Micron drives also have the bit set and the error was caused by this bad interpretation of the spec (which is quite easy to do, since bits aren't normally overlapping like this). Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Aug 20 22:39:26 2014 (r270248) +++ head/sys/cam/ata/ata_xpt.c Wed Aug 20 22:58:12 2014 (r270249) @@ -458,12 +458,18 @@ negotiate: 0, 0x02); break; case PROBE_SETAN: - /* Remember what transport thinks about AEN. */ - if (softc->caps & CTS_SATA_CAPS_H_AN) + /* + * Only ATAPI defines this bit to mean AEN, but remember + * what transport thinks about AEN. + */ + if ((softc->caps & CTS_SATA_CAPS_H_AN) && + periph->path->device->protocol == PROTO_ATAPI) path->device->inq_flags |= SID_AEN; else path->device->inq_flags &= ~SID_AEN; xpt_async(AC_GETDEV_CHANGED, path, NULL); + if (periph->path->device->protocol != PROTO_ATAPI) + break; cam_fill_ataio(ataio, 1, probedone, @@ -750,14 +756,6 @@ out: goto noerror; /* - * Some Samsung SSDs report supported Asynchronous Notification, - * but return ABORT on attempt to enable it. - */ - } else if (softc->action == PROBE_SETAN && - status == CAM_ATA_STATUS_ERROR) { - goto noerror; - - /* * SES and SAF-TE SEPs have different IDENTIFY commands, * but SATA specification doesn't tell how to identify them. * Until better way found, just try another if first fail.