From: Tejun Heo Date: Sun, 2 Apr 2006 16:58:06 +0000 (+0900) Subject: [PATCH] ahci: do not fail softreset if PHY reports no device X-Git-Tag: v2.6.18-rc1~1079^2~130 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c2a6585296009379e0f4eff39cdcb108b457ebf2;p=karo-tx-linux.git [PATCH] 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 --- diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index 0c5f0c844d21..ff48066d4c4f 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c @@ -549,6 +549,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) {