Author: imp
Date: Fri Aug 22 13:15:59 2014
New Revision: 270327
URL: http://svnweb.freebsd.org/changeset/base/270327

Log:
  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.

Modified:
  head/sys/cam/ata/ata_xpt.c

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c  Fri Aug 22 13:01:22 2014        (r270326)
+++ head/sys/cam/ata/ata_xpt.c  Fri Aug 22 13:15:59 2014        (r270327)
@@ -458,18 +458,12 @@ negotiate:
                    0, 0x02);
                break;
        case PROBE_SETAN:
-               /* 
-                * 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)
+               /* Remember what transport thinks about AEN. */
+               if (softc->caps & CTS_SATA_CAPS_H_AN)
                        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,
@@ -1057,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);
@@ -1178,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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to