diff options
author | imp <imp@FreeBSD.org> | 2014-08-26 03:45:54 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2014-08-26 03:45:54 +0000 |
commit | d577d2038d3ded10c7cfb829d8ede49485b513b0 (patch) | |
tree | 6cd1dbba3ba16e1dca27df218d81965798c53b34 | |
parent | a0e779b258ac330373d2b9e53faf85498bd408d2 (diff) | |
download | FreeBSD-src-d577d2038d3ded10c7cfb829d8ede49485b513b0.zip FreeBSD-src-d577d2038d3ded10c7cfb829d8ede49485b513b0.tar.gz |
Merge SETAN changes from head:
r270327 | imp | 2014-08-22 07:15:59 -0600 (Fri, 22 Aug 2014) | 6 lines
We should never enter the PROBE_SETAN phase if we're not ATAPI, since
that's ATAPI specific. Instead, skip to PROBE_SET_MULTI instead for
non ATAPI protocols. The prior code incorrectly terminated the probe
with a break, rather than arranging for probedone to get called. This
caused panics or worse on some systems.
r270249 | imp | 2014-08-20 16:58:12 -0600 (Wed, 20 Aug 2014) | 13 lines
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).
Sponsored by: Netflix (the merge and the original work)
-rw-r--r-- | sys/cam/ata/ata_xpt.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 867b2fe..a442ec1 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -750,14 +750,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. @@ -1059,7 +1051,8 @@ noerror: } /* FALLTHROUGH */ case PROBE_SETDMAAA: - if ((ident_buf->satasupport & ATA_SUPPORT_ASYNCNOTIF) && + if (path->device->protocol != PROTO_ATA && + (ident_buf->satasupport & ATA_SUPPORT_ASYNCNOTIF) && (!(softc->caps & CTS_SATA_CAPS_H_AN)) != (!(ident_buf->sataenabled & ATA_SUPPORT_ASYNCNOTIF))) { PROBE_SET_ACTION(softc, PROBE_SETAN); @@ -1180,7 +1173,7 @@ notsata: else caps = 0; /* Remember what transport thinks about AEN. */ - if (caps & CTS_SATA_CAPS_H_AN) + if ((caps & CTS_SATA_CAPS_H_AN) && path->device->protocol != PROTO_ATA) path->device->inq_flags |= SID_AEN; else path->device->inq_flags &= ~SID_AEN; |