From: Tejun Heo Date: Sun, 17 Sep 2006 04:05:55 +0000 (-0400) Subject: ahci: do not fail softreset if PHY reports no device X-Git-Tag: v2.6.17.14~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1358c6514ee69aede18947bb8152b464067e114e;p=thirdparty%2Fkernel%2Fstable.git ahci: do not fail softreset if PHY reports no device All softreset methods are responsible for detecting device presence and succeed softreset in such cases. AHCI didn't use to check for device presence before proceeding with softreset and this caused unnecessary reset retrials during probing. This patch adds presence detection to AHCI softreset. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik Cc: Daniel Drake Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index b4f8fb1d628b9..2dcfc1b8fc421 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c @@ -548,6 +548,12 @@ static int ahci_softreset(struct ata_port *ap, int verbose, unsigned int *class) DPRINTK("ENTER\n"); + if (!sata_dev_present(ap)) { + DPRINTK("PHY reports no device\n"); + *class = ATA_DEV_NONE; + return 0; + } + /* prepare for SRST (AHCI-1.1 10.4.1) */ rc = ahci_stop_engine(ap); if (rc) {