* [PATCH] libata: restore acpi disable functionality
@ 2012-11-26 5:55 Aaron Lu
2012-12-02 14:18 ` Tejun Heo
2012-12-03 9:58 ` Jeff Garzik
0 siblings, 2 replies; 4+ messages in thread
From: Aaron Lu @ 2012-11-26 5:55 UTC (permalink / raw)
To: Jeff Garzik, Dimitris Damigos
Cc: Tejun Heo, Matthew Garrett, Holger Macht, Alan Cox, linux-ide,
ACPI Devel Mailing List, Aaron Lu
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>
---
drivers/ata/libata-acpi.c | 4 ++++
include/linux/libata.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 5b0ba3f..ef01ac0 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)
acpi_integer adr;
struct ata_port *ap = dev->link->ap;
+ if (dev->flags & ATA_DFLAG_ACPI_DISABLED)
+ return NULL;
+
if (ap->flags & ATA_FLAG_ACPI_SATA) {
if (!sata_pmp_attached(ap))
adr = SATA_ADR(ap->port_no, NO_PORT_MULT);
@@ -945,6 +948,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
return rc;
}
+ dev->flags |= ATA_DFLAG_ACPI_DISABLED;
ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
/* We can safely continue if no _GTF command has been executed
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 77eeeda..e931c9a 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -163,6 +163,7 @@ enum {
ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
+ ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
ATA_DEV_UNKNOWN = 0, /* unknown device */
ATA_DEV_ATA = 1, /* ATA device */
--
1.7.12.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] libata: restore acpi disable functionality
2012-11-26 5:55 [PATCH] libata: restore acpi disable functionality Aaron Lu
@ 2012-12-02 14:18 ` Tejun Heo
2012-12-03 9:58 ` Jeff Garzik
1 sibling, 0 replies; 4+ messages in thread
From: Tejun Heo @ 2012-12-02 14:18 UTC (permalink / raw)
To: Aaron Lu
Cc: Jeff Garzik, Dimitris Damigos, Matthew Garrett, Holger Macht,
Alan Cox, linux-ide, ACPI Devel Mailing List, Aaron Lu
On Mon, Nov 26, 2012 at 01:55:25PM +0800, Aaron Lu wrote:
>
> 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>
Acked-by: Tejun Heo <tj@kernel.org>
Jeff?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] libata: restore acpi disable functionality
2012-11-26 5:55 [PATCH] libata: restore acpi disable functionality Aaron Lu
2012-12-02 14:18 ` Tejun Heo
@ 2012-12-03 9:58 ` Jeff Garzik
2012-12-04 14:05 ` Dimitris Damigos
1 sibling, 1 reply; 4+ messages in thread
From: Jeff Garzik @ 2012-12-03 9:58 UTC (permalink / raw)
To: Aaron Lu
Cc: Dimitris Damigos, Tejun Heo, Matthew Garrett, Holger Macht,
Alan Cox, linux-ide, ACPI Devel Mailing List, Aaron Lu
On 11/26/2012 12:55 AM, Aaron Lu wrote:
>
> 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>
> ---
> drivers/ata/libata-acpi.c | 4 ++++
> include/linux/libata.h | 1 +
> 2 files changed, 5 insertions(+)
applied
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-04 14:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-26 5:55 [PATCH] libata: restore acpi disable functionality Aaron Lu
2012-12-02 14:18 ` Tejun Heo
2012-12-03 9:58 ` Jeff Garzik
2012-12-04 14:05 ` Dimitris Damigos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).