From b5617df55b52e1be5b9f07bf00ac345f304c2497 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Fri, 26 May 2017 17:44:47 +0000 Subject: [PATCH] Allow PROBE_SPINUP to fail in CAM ATA transport The motivation for this is two-fold. 1. Some old WD SATA disks may appear as if they need to be spun up when they are already spinning. Those disks would respond with an error to the spin-up request. 2. Even if we really fail to spin up the disk, we still can try to proceed to the subsequent phases. If we fail later on, then no difference. Otherwise we get a chance to communicate with the disk which is better than completely ignoring it, because a user can try to recover the disk. Reviewed by: mav MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D10896 --- sys/cam/ata/ata_xpt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sys/cam/ata/ata_xpt.c b/sys/cam/ata/ata_xpt.c index 4021298354d7..a86796f30715 100644 --- a/sys/cam/ata/ata_xpt.c +++ b/sys/cam/ata/ata_xpt.c @@ -799,6 +799,16 @@ probedone(struct cam_periph *periph, union ccb *done_ccb) status == CAM_ATA_STATUS_ERROR) { goto noerror; + /* + * Some old WD SATA disks have broken SPINUP handling. + * If we really fail to spin up the disk, then there will be + * some media access errors later on, but at least we will + * have a device to interact with for recovery attempts. + */ + } else if (softc->action == PROBE_SPINUP && + status == CAM_ATA_STATUS_ERROR) { + goto noerror; + /* * Some HP SATA disks report supported DMA Auto-Activation, * but return ABORT on attempt to enable it.