Mark Lord wrote:
On Saturday 27 May 2006 00:00, Jeff Garzik wrote:
Although I didn't even bother to compile-test it, here is the
recommended solution, as described multiple times...
..
That patch has ZERO (positive) effect on my machine.
It still crashes miserably with a zillion "read errors" on resume
(drive not accessible).
Output please? Did you get any failed-to-resume messages?
The original "bad layering" patch still works perfectly in it's place.
Repeated below for Linus's benefit.
Actually, unfortunately I don't see that here. On my ICH7 in x86-64
ata_piix combined mode, it hard locks. In x86 mode, it appears to work
(or at least not break anything, since resume works without the patch
too on this box) both in combined mode and native mode.
Since this is claimed to be a regression, what was the last upstream
kernel version that worked for you? 2.6.16.x?
Finally, if you could test the updated patch I posted, and/or the one
that is attached, that would be preferred.
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..5b7ab7b 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;
+ u8 status;
+ int i;
+
+ ata_pci_device_resume(pdev);
+
+ mdelay(400);
+
+ 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);
+ }
+
+ return 0;
+}
+
#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 */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b80d2e7..cad531a 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -516,6 +516,7 @@ extern int ata_pci_init_one (struct pci_
extern void ata_pci_remove_one (struct pci_dev *pdev);
extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state);
extern int ata_pci_device_resume(struct pci_dev *pdev);
+extern int pata_pci_device_resume(struct pci_dev *pdev);
extern int ata_pci_clear_simplex(struct pci_dev *pdev);
#endif /* CONFIG_PCI */
extern int ata_device_add(const struct ata_probe_ent *ent);