- To: Jeff Garzik <jgarzik@xxxxxxxxx>, Aaron Lu <aaron.lu@xxxxxxx>, Holger Macht <holger@xxxxxxxx>, Matthew Garrett <mjg@xxxxxxxxxx>, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>, David Woodhouse <David.Woodhouse@xxxxxxxxx>, Dan Williams <dan.j.williams@xxxxxxxxx>
- Subject: [PATCH v6 04/11] libata-acpi: set acpi state for SATA port
- From: Lin Ming <ming.m.lin@xxxxxxxxx>
- Date: Mon, 25 Jun 2012 16:13:05 +0800
- Cc: linux-kernel@xxxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, linux-ide@xxxxxxxxxxxxxxx, linux-acpi@xxxxxxxxxxxxxxx
- In-reply-to: <1340611992-41457-1-git-send-email-ming.m.lin@intel.com>
Currently, ata_acpi_set_state() only sets acpi sate for IDE port.
Remove this limitation.
Acked-by: Aaron Lu <aaron.lu@xxxxxxx>
Signed-off-by: Lin Ming <ming.m.lin@xxxxxxxxx>
---
drivers/ata/libata-acpi.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index c6f0101..bb20fd5 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -852,23 +852,25 @@ void ata_acpi_on_resume(struct ata_port *ap)
void ata_acpi_set_state(struct ata_port *ap, pm_message_t state)
{
struct ata_device *dev;
-
- if (!ata_ap_acpi_handle(ap) || (ap->flags & ATA_FLAG_ACPI_SATA))
- return;
+ acpi_handle handle;
/* channel first and then drives for power on and vica versa
for power off */
- if (state.event == PM_EVENT_ON)
- acpi_bus_set_power(ata_ap_acpi_handle(ap), ACPI_STATE_D0);
+ handle = ata_ap_acpi_handle(ap);
+ if (handle && state.event == PM_EVENT_ON)
+ acpi_bus_set_power(handle, ACPI_STATE_D0);
ata_for_each_dev(dev, &ap->link, ENABLED) {
- if (ata_dev_acpi_handle(dev))
- acpi_bus_set_power(ata_dev_acpi_handle(dev),
+ handle = ata_dev_acpi_handle(dev);
+ if (handle)
+ acpi_bus_set_power(handle,
state.event == PM_EVENT_ON ?
ACPI_STATE_D0 : ACPI_STATE_D3);
}
- if (state.event != PM_EVENT_ON)
- acpi_bus_set_power(ata_ap_acpi_handle(ap), ACPI_STATE_D3);
+
+ handle = ata_ap_acpi_handle(ap);
+ if (handle && state.event != PM_EVENT_ON)
+ acpi_bus_set_power(handle, ACPI_STATE_D3);
}
/**
--
1.7.10
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[SCSI Target Devel]
[Linux SCSI Target Infrastructure]
[Kernel Newbies]
[Share Photos]
[IDE]
[Security]
[Git]
[Netfilter]
[Bugtraq]
[Photos]
[Yosemite]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Linux ATA RAID]
[Linux IIO]
[Samba]
[Video 4 Linux]
[Device Mapper]
[Linux Resources]