Although I didn't even bother to compile-test it, here is the
recommended solution, as described multiple times...
Testers might wanna put msleep(500) in pata_pci_device_resume(), before
the port loop, to let the SATA phy settle...
Jeff
diff --git a/drivers/scsi/ata_piix.c b/drivers/scsi/ata_piix.c
index 6dc8814..949d496 100644
--- a/drivers/scsi/ata_piix.c
+++ b/drivers/scsi/ata_piix.c
@@ -201,7 +201,7 @@ static struct pci_driver piix_pci_driver
.probe = piix_init_one,
.remove = ata_pci_remove_one,
.suspend = ata_pci_device_suspend,
- .resume = ata_pci_device_resume,
+ .resume = pata_pci_device_resume,
};
static struct scsi_host_template piix_sht = {
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index fa476e7..95e0885 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -4852,6 +4852,30 @@ int ata_pci_device_resume(struct pci_dev
pci_set_master(pdev);
return 0;
}
+
+int pata_pci_device_resume(struct pci_dev *pdev)
+{
+ struct device *dev = pci_dev_to_dev(pdev);
+ struct ata_host_set *host_set = dev_get_drvdata(dev);
+ struct ata_port *ap;
+ int i, rc = 0;
+ u8 status;
+
+ ata_pci_device_resume(pdev);
+
+ for (i = 0; i < host_set->n_ports; i++) {
+ ap = host_set->ports[i];
+
+ status = ata_busy_wait(ap, ATA_BUSY, 200000);
+ if (status & ATA_BUSY) {
+ printk(KERN_ERR "ata%u: failed to resume\n", ap->id);
+ rc = -EIO;
+ }
+ }
+
+ return rc;
+}
+
#endif /* CONFIG_PCI */
@@ -4970,6 +4994,7 @@ EXPORT_SYMBOL_GPL(ata_pci_init_one);
EXPORT_SYMBOL_GPL(ata_pci_remove_one);
EXPORT_SYMBOL_GPL(ata_pci_device_suspend);
EXPORT_SYMBOL_GPL(ata_pci_device_resume);
+EXPORT_SYMBOL_GPL(pata_pci_device_resume);
EXPORT_SYMBOL_GPL(ata_pci_default_filter);
EXPORT_SYMBOL_GPL(ata_pci_clear_simplex);
#endif /* CONFIG_PCI */