Thread (5 messages) 5 messages, 1 author, 2012-08-30
DORMANTno replies

[PATCH 4/4] libata: acpi: respect may_power_off flag

From: Aaron Lu <hidden>
Date: 2012-08-30 06:42:03
Also in: linux-acpi
Subsystem: libata subsystem (serial and parallel ata drivers), the rest · Maintainers: Damien Le Moal, Niklas Cassel, Linus Torvalds

If user does not want the device being powered off when runtime
suspended by setting may_power_off flag to 0, we will not choose D3 cold
ACPI D-State for it in sata_acpi_set_state.

Signed-off-by: Aaron Lu <redacted>
---
 drivers/ata/libata-acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index 67a696f..90c42a0 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -848,7 +848,9 @@ static void sata_acpi_set_state(struct ata_port *ap, pm_message_t state)
 
 		if (state.event == PM_EVENT_AUTO_SUSPEND) {
 			acpi_state = acpi_pm_device_sleep_state(
-				&dev->sdev->sdev_gendev, NULL, ACPI_STATE_D3);
+				&dev->sdev->sdev_gendev, NULL,
+				dev->sdev->may_power_off ?
+				ACPI_STATE_D3_COLD : ACPI_STATE_D3_HOT);
 			if (acpi_state > 0)
 				acpi_bus_set_power(handle, acpi_state);
 			acpi_pm_device_run_wake(&dev->sdev->sdev_gendev, true);
-- 
1.7.11.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help