diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 65813c3..0824179 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -928,6 +928,17 @@ static int ahci_vt8251_hardreset(struct ahci_stop_engine(port_mmio); + /* vt8251 needs CLO even before hardreset */ + if (ahci_check_status(ap) & (ATA_BUSY | ATA_DRQ)) { + rc = ahci_clo(ap); + /* If CLO fails, whine but continue. Hardreset is our + * final line of defense anyway. + */ + if (rc) + ata_port_printk(ap, KERN_WARNING, "vt8251_hardreset: " + "CLO failed (%d)\n", rc); + } + rc = sata_port_hardreset(ap, sata_ehc_deb_timing(&ap->eh_context)); /* vt8251 needs SError cleared for the port to operate */