Author: mav
Date: Sat Jan 15 09:43:25 2011
New Revision: 217444
URL: http://svn.freebsd.org/changeset/base/217444

Log:
  Some old WD SATA disks report supported and enabled device-initiated
  interface power management, but return ABORT error on attempt to disable
  it. Make CAM SATA probe sequence ignore this error, as it is not fatal.

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

Modified: head/sys/cam/ata/ata_xpt.c
==============================================================================
--- head/sys/cam/ata/ata_xpt.c  Sat Jan 15 09:36:31 2011        (r217443)
+++ head/sys/cam/ata/ata_xpt.c  Sat Jan 15 09:43:25 2011        (r217444)
@@ -727,6 +727,7 @@ probedone(struct cam_periph *periph, uni
        struct ata_params *ident_buf;
        probe_softc *softc;
        struct cam_path *path;
+       cam_status status;
        u_int32_t  priority;
        u_int caps;
        int found = 1;
@@ -751,6 +752,7 @@ probedone(struct cam_periph *periph, uni
                        xpt_release_devq(done_ccb->ccb_h.path, /*count*/1,
                                         /*run_queue*/TRUE);
                }
+               status = done_ccb->ccb_h.status & CAM_STATUS_MASK;
                if (softc->restart) {
                        softc->faults++;
                        if ((done_ccb->ccb_h.status & CAM_STATUS_MASK) ==
@@ -760,12 +762,24 @@ probedone(struct cam_periph *periph, uni
                                goto done;
                        else
                                softc->restart = 0;
-               } else
+
                /* Old PIO2 devices may not support mode setting. */
-               if (softc->action == PROBE_SETMODE &&
+               } else if (softc->action == PROBE_SETMODE &&
+                   status == CAM_ATA_STATUS_ERROR &&
                    ata_max_pmode(ident_buf) <= ATA_PIO2 &&
-                   (ident_buf->capabilities1 & ATA_SUPPORT_IORDY) == 0)
+                   (ident_buf->capabilities1 & ATA_SUPPORT_IORDY) == 0) {
+                       goto noerror;
+
+               /*
+                * Some old WD SATA disks report supported and enabled
+                * device-initiated interface power management, but return
+                * ABORT on attempt to disable it.
+                */
+               } else if (softc->action == PROBE_SETPM &&
+                   status == CAM_ATA_STATUS_ERROR) {
                        goto noerror;
+               }
+
                /*
                 * If we get to this point, we got an error status back
                 * from the inquiry and the error status doesn't require
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to