summaryrefslogtreecommitdiffstats
path: root/drivers/ata/libahci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r--drivers/ata/libahci.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index a0de7a38430c..7adcf3caabd0 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -665,6 +665,16 @@ int ahci_stop_engine(struct ata_port *ap)
665 if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0) 665 if ((tmp & (PORT_CMD_START | PORT_CMD_LIST_ON)) == 0)
666 return 0; 666 return 0;
667 667
668 /*
669 * Don't try to issue commands but return with ENODEV if the
670 * AHCI controller not available anymore (e.g. due to PCIe hot
671 * unplugging). Otherwise a 500ms delay for each port is added.
672 */
673 if (tmp == 0xffffffff) {
674 dev_err(ap->host->dev, "AHCI controller unavailable!\n");
675 return -ENODEV;
676 }
677
668 /* setting HBA to idle */ 678 /* setting HBA to idle */
669 tmp &= ~PORT_CMD_START; 679 tmp &= ~PORT_CMD_START;
670 writel(tmp, port_mmio + PORT_CMD); 680 writel(tmp, port_mmio + PORT_CMD);