diff options
author | mav <mav@FreeBSD.org> | 2011-01-15 09:43:25 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2011-01-15 09:43:25 +0000 |
commit | 210e4a9bb1b8bd9bcef3ec2597fe4de1a1ad3569 (patch) | |
tree | 3af7acd95f2afb6711658850ab028331664f35f4 /sys | |
parent | 076e0f39cdc15b085081b74eb110c647068522f2 (diff) | |
download | FreeBSD-src-210e4a9bb1b8bd9bcef3ec2597fe4de1a1ad3569.zip FreeBSD-src-210e4a9bb1b8bd9bcef3ec2597fe4de1a1ad3569.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/cam/ata/ata_xpt.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 95f29cf..e20159c 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -727,6 +727,7 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) 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, union ccb *done_ccb) 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, union ccb *done_ccb) 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 |