mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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 <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
parent
88fb61e4ba
commit
ad3399c378
@ -386,12 +386,21 @@ int acpi_pm_device_sleep_state(struct device *dev, int wake, int *d_min_p)
|
|||||||
if (acpi_target_sleep_state == ACPI_STATE_S0 ||
|
if (acpi_target_sleep_state == ACPI_STATE_S0 ||
|
||||||
(wake && adev->wakeup.state.enabled &&
|
(wake && adev->wakeup.state.enabled &&
|
||||||
adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
|
adev->wakeup.sleep_state <= acpi_target_sleep_state)) {
|
||||||
|
acpi_status status;
|
||||||
|
|
||||||
acpi_method[3] = 'W';
|
acpi_method[3] = 'W';
|
||||||
acpi_evaluate_integer(handle, acpi_method, NULL, &d_max);
|
status = acpi_evaluate_integer(handle, acpi_method, NULL,
|
||||||
/* Sanity check */
|
&d_max);
|
||||||
if (d_max < d_min)
|
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;
|
d_min = d_max;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (d_min_p)
|
if (d_min_p)
|
||||||
*d_min_p = d_min;
|
*d_min_p = d_min;
|
||||||
|
Loading…
Reference in New Issue
Block a user