aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Lu <aaron.lu@intel.com>2012-11-26 00:55:25 -0500
committerJeff Garzik <jgarzik@redhat.com>2012-12-03 04:57:15 -0500
commit0d0cdb028f9d9771e2b346038707734121f906e3 (patch)
tree0bae4e559e963bdc1b487806848b5df7021a3283
parenta52f514c911978dee418f19d1d0103e3bc25fa62 (diff)
libata: restore acpi disable functionality
Commit 66fa7f215 "libata-acpi: improve ACPI disabling" introdcued the behaviour of disabling ATA ACPI if ata_acpi_on_devcfg failed the 2nd time, but commit 30dcf76ac dropped this behaviour and this caused problem for Dimitris Damigos, where his laptop can not resume correctly. The bugzilla page for it is: https://bugzilla.kernel.org/show_bug.cgi?id=49331 The problem is, ata_dev_push_id will fail the 2nd time it is invoked, and due to disabling ACPI code is dropped, ata_acpi_on_devcfg which calls ata_dev_push_id will keep failing and eventually made the device disabled. This patch restores the original behaviour, if acpi failed the 2nd time, disable acpi functionality for the device(and we do not event need to add a debug message for this as it is still there ;-). Reported-by: Dimitris Damigos <damigos@freemail.gr> Signed-off-by: Aaron Lu <aaron.lu@intel.com> Cc: <stable@vger.kernel.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r--drivers/ata/libata-acpi.c4
-rw-r--r--include/linux/libata.h1
2 files changed, 5 insertions, 0 deletions
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 5b0ba3f20edc..ef01ac07502e 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -76,6 +76,9 @@ acpi_handle ata_dev_acpi_handle(struct ata_device *dev)
76 acpi_integer adr; 76 acpi_integer adr;
77 struct ata_port *ap = dev->link->ap; 77 struct ata_port *ap = dev->link->ap;
78 78
79 if (dev->flags & ATA_DFLAG_ACPI_DISABLED)
80 return NULL;
81
79 if (ap->flags & ATA_FLAG_ACPI_SATA) { 82 if (ap->flags & ATA_FLAG_ACPI_SATA) {
80 if (!sata_pmp_attached(ap)) 83 if (!sata_pmp_attached(ap))
81 adr = SATA_ADR(ap->port_no, NO_PORT_MULT); 84 adr = SATA_ADR(ap->port_no, NO_PORT_MULT);
@@ -945,6 +948,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
945 return rc; 948 return rc;
946 } 949 }
947 950
951 dev->flags |= ATA_DFLAG_ACPI_DISABLED;
948 ata_dev_warn(dev, "ACPI: failed the second time, disabled\n"); 952 ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
949 953
950 /* We can safely continue if no _GTF command has been executed 954 /* We can safely continue if no _GTF command has been executed
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 77eeeda2b6e2..e931c9ad1078 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -163,6 +163,7 @@ enum {
163 163
164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */ 164 ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
165 ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */ 165 ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
166 ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
166 167
167 ATA_DEV_UNKNOWN = 0, /* unknown device */ 168 ATA_DEV_UNKNOWN = 0, /* unknown device */
168 ATA_DEV_ATA = 1, /* ATA device */ 169 ATA_DEV_ATA = 1, /* ATA device */