Skip to content

Commit be10f60

Browse files
committed
Merge branches 'acpi-scan', 'acpi-utils' and 'acpi-pm'
* acpi-scan: ACPI / scan: Change the level of _DEP-related messages to KERN_DEBUG * acpi-utils: ACPI / utils: Drop error messages from acpi_evaluate_reference() * acpi-pm: ACPI / PM: Do not disable wakeup GPEs that have not been enabled
4 parents ae5056e + 80167a2 + c48cf1b + 175f8e2 commit be10f60

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

drivers/acpi/device_pm.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -680,13 +680,21 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state,
680680
if (error)
681681
return error;
682682

683+
if (adev->wakeup.flags.enabled)
684+
return 0;
685+
683686
res = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number);
684-
if (ACPI_FAILURE(res)) {
687+
if (ACPI_SUCCESS(res)) {
688+
adev->wakeup.flags.enabled = 1;
689+
} else {
685690
acpi_disable_wakeup_device_power(adev);
686691
return -EIO;
687692
}
688693
} else {
689-
acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
694+
if (adev->wakeup.flags.enabled) {
695+
acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number);
696+
adev->wakeup.flags.enabled = 0;
697+
}
690698
acpi_disable_wakeup_device_power(adev);
691699
}
692700
return 0;

drivers/acpi/scan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
22142214
status = acpi_evaluate_reference(adev->handle, "_DEP", NULL,
22152215
&dep_devices);
22162216
if (ACPI_FAILURE(status)) {
2217-
dev_err(&adev->dev, "Failed to evaluate _DEP.\n");
2217+
dev_dbg(&adev->dev, "Failed to evaluate _DEP.\n");
22182218
return;
22192219
}
22202220

@@ -2224,7 +2224,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev)
22242224

22252225
status = acpi_get_object_info(dep_devices.handles[i], &info);
22262226
if (ACPI_FAILURE(status)) {
2227-
dev_err(&adev->dev, "Error reading device info\n");
2227+
dev_dbg(&adev->dev, "Error reading _DEP device info\n");
22282228
continue;
22292229
}
22302230

drivers/acpi/utils.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -346,22 +346,16 @@ acpi_evaluate_reference(acpi_handle handle,
346346
package = buffer.pointer;
347347

348348
if ((buffer.length == 0) || !package) {
349-
printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n",
350-
(unsigned)buffer.length, package);
351349
status = AE_BAD_DATA;
352350
acpi_util_eval_error(handle, pathname, status);
353351
goto end;
354352
}
355353
if (package->type != ACPI_TYPE_PACKAGE) {
356-
printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n",
357-
package->type);
358354
status = AE_BAD_DATA;
359355
acpi_util_eval_error(handle, pathname, status);
360356
goto end;
361357
}
362358
if (!package->package.count) {
363-
printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n",
364-
package);
365359
status = AE_BAD_DATA;
366360
acpi_util_eval_error(handle, pathname, status);
367361
goto end;
@@ -380,17 +374,13 @@ acpi_evaluate_reference(acpi_handle handle,
380374

381375
if (element->type != ACPI_TYPE_LOCAL_REFERENCE) {
382376
status = AE_BAD_DATA;
383-
printk(KERN_ERR PREFIX
384-
"Expecting a [Reference] package element, found type %X\n",
385-
element->type);
386377
acpi_util_eval_error(handle, pathname, status);
387378
break;
388379
}
389380

390381
if (!element->reference.handle) {
391-
printk(KERN_WARNING PREFIX "Invalid reference in"
392-
" package %s\n", pathname);
393382
status = AE_NULL_ENTRY;
383+
acpi_util_eval_error(handle, pathname, status);
394384
break;
395385
}
396386
/* Get the acpi_handle. */

include/acpi/acpi_bus.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ struct acpi_device_wakeup_flags {
313313
u8 valid:1; /* Can successfully enable wakeup? */
314314
u8 run_wake:1; /* Run-Wake GPE devices */
315315
u8 notifier_present:1; /* Wake-up notify handler has been installed */
316+
u8 enabled:1; /* Enabled for wakeup */
316317
};
317318

318319
struct acpi_device_wakeup_context {

0 commit comments

Comments
 (0)