lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <1432840.s0A6LzWFfU@vostro.rjw.lan>
Date:	Sun, 03 Feb 2013 14:13:54 +0100
From:	"Rafael J. Wysocki" <rjw@...k.pl>
To:	ACPI Devel Maling List <linux-acpi@...r.kernel.org>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: [PATCH] ACPI / PM: Handle missing _PSC in acpi_bus_update_power()

From: Rafael J. Wysocki <rafael.j.wysocki@...el.com>

If _PS0 is defined for an ACPI device node, but _PSC isn't and
the device node doesn't use power resources for power management,
acpi_bus_update_power() will fail to update the power state of it,
because acpi_device_get_power() returns ACPI_STATE_UNKNOWN in that
case.

To handle that situation make acpi_bus_update_power() follow
acpi_bus_init_power() and try to force the given device node into
power state D0 if its actual power state cannot be determined.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
---

On top of linux-pm.git/bleeding-edge.

Thanks,
Rafael

---
 drivers/acpi/device_pm.c |    3 +++
 1 file changed, 3 insertions(+)

Index: linux-pm/drivers/acpi/device_pm.c
===================================================================
--- linux-pm.orig/drivers/acpi/device_pm.c
+++ linux-pm/drivers/acpi/device_pm.c
@@ -355,6 +355,9 @@ int acpi_bus_update_power(acpi_handle ha
 	if (result)
 		return result;
 
+	if (state == ACPI_STATE_UNKNOWN)
+		state = ACPI_STATE_D0;
+
 	result = acpi_device_set_power(device, state);
 	if (!result && state_p)
 		*state_p = state;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ