Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad3399c378993152f12c23304ee56d7f9108e758
Commit:     ad3399c378993152f12c23304ee56d7f9108e758
Parent:     88fb61e4ba263685a0d5b82c7e9cd6f22a9e6a9d
Author:     Rafael J. Wysocki <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 11 00:10:38 2008 +0100
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Fri Jan 11 23:21:52 2008 -0500

    ACPI: Fix acpi_pm_device_sleep_state()
    
    Fix acpi_pm_device_sleep_state() to return the value returned
    by _SxD if the device is supposed to wake up the system from
    given sleep state and the evaluation of _SxW fails (e.g. _SxW
    is not present).
    
    Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
    Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/sleep/main.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/drivers/acpi/sleep/main.c b/drivers/acpi/sleep/main.c
index 2c0b663..99181c8 100644
--- a/drivers/acpi/sleep/main.c
+++ b/drivers/acpi/sleep/main.c
@@ -386,11 +386,20 @@ int acpi_pm_device_sleep_state(struct device *dev, int 
wake, int *d_min_p)
        if (acpi_target_sleep_state == ACPI_STATE_S0 ||
            (wake && adev->wakeup.state.enabled &&
             adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
+               acpi_status status;
+
                acpi_method[3] = 'W';
-               acpi_evaluate_integer(handle, acpi_method, NULL, &d_max);
-               /* Sanity check */
-               if (d_max < d_min)
+               status = acpi_evaluate_integer(handle, acpi_method, NULL,
+                                               &d_max);
+               if (ACPI_FAILURE(status)) {
+                       d_max = d_min;
+               } else if (d_max < d_min) {
+                       /* Warn the user of the broken DSDT */
+                       printk(KERN_WARNING "ACPI: Wrong value from %s\n",
+                               acpi_method);
+                       /* Sanitize it */
                        d_min = d_max;
+               }
        }
 
        if (d_min_p)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to