diff options
author | Tejun Heo <htejun@gmail.com> | 2007-05-14 14:28:16 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2007-07-09 12:17:31 -0400 |
commit | 6746544c3b143ca7071d144f1882ccbe1f47b08d (patch) | |
tree | 49106311ab2a748feda2fa91f977f700938d3d5c /drivers/ata/libata-eh.c | |
parent | 69b16a5f4c4f1dab70d4d555c487c318c6878b3e (diff) |
libata: reimplement ACPI invocation
This patch reimplements ACPI invocation such that, instead of
exporting ACPI details to the rest of libata, ACPI event handlers -
ata_acpi_on_resume() and ata_acpi_on_devcfg() - are used. These two
functions are responsible for determining whether specific ACPI method
is used and when.
On resume, _GTF is scheduled by setting ATA_DFLAG_ACPI_PENDING device
flag. This is done this way to avoid performing the action on wrong
device device (device swapping while suspended).
On every ata_dev_configure(), ata_acpi_on_devcfg() is called, which
performs _SDD and _GTF. _GTF is performed only after resuming and, if
SATA, hardreset as the ACPI spec specifies. As _GTF may contain
arbitrary commands, IDENTIFY page is re-read after _GTF taskfiles are
executed.
If one of ACPI methods fails, ata_acpi_on_devcfg() retries on the
first failure. If it fails again on the second try, ACPI is disabled
on the device. Note that successful configuration clears ACPI failed
status.
With all feature checks moved to the above two functions,
do_drive_set_taskfiles() is trivial and thus collapsed into
ata_acpi_exec_tfs(), which is now static and converted to return the
number of executed taskfiles to be used by ata_acpi_on_resume(). As
failures are handled properly, ata_acpi_push_id() now returns -errno
on errors instead of unconditional zero.
Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/ata/libata-eh.c')
-rw-r--r-- | drivers/ata/libata-eh.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index f7582c9c320e..fed217db82d2 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2207,6 +2207,9 @@ static void ata_eh_handle_port_resume(struct ata_port *ap) | |||
2207 | if (ap->ops->port_resume) | 2207 | if (ap->ops->port_resume) |
2208 | rc = ap->ops->port_resume(ap); | 2208 | rc = ap->ops->port_resume(ap); |
2209 | 2209 | ||
2210 | /* tell ACPI that we're resuming */ | ||
2211 | ata_acpi_on_resume(ap); | ||
2212 | |||
2210 | /* report result */ | 2213 | /* report result */ |
2211 | spin_lock_irqsave(ap->lock, flags); | 2214 | spin_lock_irqsave(ap->lock, flags); |
2212 | ap->pflags &= ~(ATA_PFLAG_PM_PENDING | ATA_PFLAG_SUSPENDED); | 2215 | ap->pflags &= ~(ATA_PFLAG_PM_PENDING | ATA_PFLAG_SUSPENDED); |