Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Aug 2014 22:58:13 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r270249 - head/sys/cam/ata
Message-ID:  <201408202258.s7KMwDh3073409@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201408202258.s7KMwDh3073409>