* [PATCH] ACPI: don't check power state after _ON/_OFF
@ 2009-05-21 23:28 Bjorn Helgaas
2009-05-21 23:32 ` Matthew Garrett
2009-05-28 1:47 ` Len Brown
0 siblings, 2 replies; 3+ messages in thread
From: Bjorn Helgaas @ 2009-05-21 23:28 UTC (permalink / raw)
Cc: Rafael J. Wysocki, Witold Szczeponik, Matthew Garrett, Yakui Zhao,
linux-acpi, Alexey Starikovskiy, Len Brown
We used to evaluate _STA to check the power state of a device after
running _ON or _OFF. But as far as I can tell, there's no benefit
to evaluating _STA, and sometimes we trip over bugs when BIOSes don't
implement _STA correctly.
Yakui says Windows XP doesn't evaluate _STA during power transition.
So let's skip it in Linux, too. It's conceivable that we'll need to
check _STA in the future for some reason, but until we do, I don't
see a reason to clutter this code path.
References:
http://bugzilla.kernel.org/show_bug.cgi?id=13243
http://marc.info/?l=linux-acpi&m=124166053803753&w=2
http://marc.info/?l=linux-acpi&m=124175761408256&w=2
http://marc.info/?l=linux-acpi&m=124210593114061&w=2
Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
CC: Yakui Zhao <yakui.zhao@intel.com>
CC: Matthew Garrett <mjg59@srcf.ucam.org>
CC: "Rafael J. Wysocki" <rjw@sisk.pl>
CC: Witold Szczeponik <Witold.Szczeponik@gmx.net>
CC: Alexey Starikovskiy <astarikovskiy@suse.de>
CC: Len Brown <lenb@kernel.org>
---
drivers/acpi/power.c | 28 ++--------------------------
1 files changed, 2 insertions(+), 26 deletions(-)
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 56665a6..d74365d 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -194,7 +194,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
{
- int result = 0, state;
+ int result = 0;
int found = 0;
acpi_status status = AE_OK;
struct acpi_power_resource *resource = NULL;
@@ -236,18 +236,6 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
if (ACPI_FAILURE(status))
return -ENODEV;
- if (!acpi_power_nocheck) {
- /*
- * If acpi_power_nocheck is set, it is unnecessary to check
- * the power state after power transition.
- */
- result = acpi_power_get_state(resource->device->handle,
- &state);
- if (result)
- return result;
- if (state != ACPI_POWER_RESOURCE_STATE_ON)
- return -ENOEXEC;
- }
/* Update the power resource's _device_ power state */
resource->device->power.state = ACPI_STATE_D0;
@@ -258,7 +246,7 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
{
- int result = 0, state;
+ int result = 0;
acpi_status status = AE_OK;
struct acpi_power_resource *resource = NULL;
struct list_head *node, *next;
@@ -293,18 +281,6 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
if (ACPI_FAILURE(status))
return -ENODEV;
- if (!acpi_power_nocheck) {
- /*
- * If acpi_power_nocheck is set, it is unnecessary to check
- * the power state after power transition.
- */
- result = acpi_power_get_state(handle, &state);
- if (result)
- return result;
- if (state != ACPI_POWER_RESOURCE_STATE_OFF)
- return -ENOEXEC;
- }
-
/* Update the power resource's _device_ power state */
resource->device->power.state = ACPI_STATE_D3;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: don't check power state after _ON/_OFF
2009-05-21 23:28 [PATCH] ACPI: don't check power state after _ON/_OFF Bjorn Helgaas
@ 2009-05-21 23:32 ` Matthew Garrett
2009-05-28 1:47 ` Len Brown
1 sibling, 0 replies; 3+ messages in thread
From: Matthew Garrett @ 2009-05-21 23:32 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J. Wysocki, Witold Szczeponik, Yakui Zhao, linux-acpi,
Alexey Starikovskiy, Len Brown
On Thu, May 21, 2009 at 05:28:53PM -0600, Bjorn Helgaas wrote:
> We used to evaluate _STA to check the power state of a device after
> running _ON or _OFF. But as far as I can tell, there's no benefit
> to evaluating _STA, and sometimes we trip over bugs when BIOSes don't
> implement _STA correctly.
>
> Yakui says Windows XP doesn't evaluate _STA during power transition.
> So let's skip it in Linux, too. It's conceivable that we'll need to
> check _STA in the future for some reason, but until we do, I don't
> see a reason to clutter this code path.
>
> References:
> http://bugzilla.kernel.org/show_bug.cgi?id=13243
> http://marc.info/?l=linux-acpi&m=124166053803753&w=2
> http://marc.info/?l=linux-acpi&m=124175761408256&w=2
> http://marc.info/?l=linux-acpi&m=124210593114061&w=2
>
> Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
> CC: Yakui Zhao <yakui.zhao@intel.com>
> CC: Matthew Garrett <mjg59@srcf.ucam.org>
> CC: "Rafael J. Wysocki" <rjw@sisk.pl>
> CC: Witold Szczeponik <Witold.Szczeponik@gmx.net>
> CC: Alexey Starikovskiy <astarikovskiy@suse.de>
> CC: Len Brown <lenb@kernel.org>
Acked-by: Matthew Garrett <mjg@redhat.com>
> drivers/acpi/power.c | 28 ++--------------------------
> 1 files changed, 2 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
> index 56665a6..d74365d 100644
> --- a/drivers/acpi/power.c
> +++ b/drivers/acpi/power.c
> @@ -194,7 +194,7 @@ static int acpi_power_get_list_state(struct acpi_handle_list *list, int *state)
>
> static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
> {
> - int result = 0, state;
> + int result = 0;
> int found = 0;
> acpi_status status = AE_OK;
> struct acpi_power_resource *resource = NULL;
> @@ -236,18 +236,6 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
> if (ACPI_FAILURE(status))
> return -ENODEV;
>
> - if (!acpi_power_nocheck) {
> - /*
> - * If acpi_power_nocheck is set, it is unnecessary to check
> - * the power state after power transition.
> - */
> - result = acpi_power_get_state(resource->device->handle,
> - &state);
> - if (result)
> - return result;
> - if (state != ACPI_POWER_RESOURCE_STATE_ON)
> - return -ENOEXEC;
> - }
> /* Update the power resource's _device_ power state */
> resource->device->power.state = ACPI_STATE_D0;
>
> @@ -258,7 +246,7 @@ static int acpi_power_on(acpi_handle handle, struct acpi_device *dev)
>
> static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
> {
> - int result = 0, state;
> + int result = 0;
> acpi_status status = AE_OK;
> struct acpi_power_resource *resource = NULL;
> struct list_head *node, *next;
> @@ -293,18 +281,6 @@ static int acpi_power_off_device(acpi_handle handle, struct acpi_device *dev)
> if (ACPI_FAILURE(status))
> return -ENODEV;
>
> - if (!acpi_power_nocheck) {
> - /*
> - * If acpi_power_nocheck is set, it is unnecessary to check
> - * the power state after power transition.
> - */
> - result = acpi_power_get_state(handle, &state);
> - if (result)
> - return result;
> - if (state != ACPI_POWER_RESOURCE_STATE_OFF)
> - return -ENOEXEC;
> - }
> -
> /* Update the power resource's _device_ power state */
> resource->device->power.state = ACPI_STATE_D3;
>
>
>
--
Matthew Garrett | mjg59@srcf.ucam.org
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ACPI: don't check power state after _ON/_OFF
2009-05-21 23:28 [PATCH] ACPI: don't check power state after _ON/_OFF Bjorn Helgaas
2009-05-21 23:32 ` Matthew Garrett
@ 2009-05-28 1:47 ` Len Brown
1 sibling, 0 replies; 3+ messages in thread
From: Len Brown @ 2009-05-28 1:47 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: Rafael J. Wysocki, Witold Szczeponik, Matthew Garrett, Yakui Zhao,
linux-acpi, Alexey Starikovskiy
applied
thanks,
Len Brown, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-05-28 1:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21 23:28 [PATCH] ACPI: don't check power state after _ON/_OFF Bjorn Helgaas
2009-05-21 23:32 ` Matthew Garrett
2009-05-28 1:47 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox