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).
This commit is contained in:
Warner Losh 2014-08-20 22:58:12 +00:00
parent 7c1db36b28
commit 15f48aaad6

View File

@ -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,
@ -749,14 +755,6 @@ out:
status == CAM_ATA_STATUS_ERROR) {
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.