From 80167a24a27449c06fbbfb1b0f4a5b965c41b428 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 12 Dec 2014 22:48:44 +0100 Subject: ACPI / scan: Change the level of _DEP-related messages to KERN_DEBUG Two _DEP-related failure messages are printed as dev_err() which is unnecessary and annoying. Use dev_dbg() to print them. While at it, one of the messages should actually say it is related to _DEP, so modify it to that effect. Fixes: 40e7fcb19293 (ACPI: Add _DEP support to fix battery issue on Asus T100TA) Reported-by: Linus Torvalds Signed-off-by: Rafael J. Wysocki --- drivers/acpi/scan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 00189ad63c8f..d838b2f83e21 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2107,7 +2107,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) status = acpi_evaluate_reference(adev->handle, "_DEP", NULL, &dep_devices); if (ACPI_FAILURE(status)) { - dev_err(&adev->dev, "Failed to evaluate _DEP.\n"); + dev_dbg(&adev->dev, "Failed to evaluate _DEP.\n"); return; } @@ -2117,7 +2117,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) status = acpi_get_object_info(dep_devices.handles[i], &info); if (ACPI_FAILURE(status)) { - dev_err(&adev->dev, "Error reading device info\n"); + dev_dbg(&adev->dev, "Error reading _DEP device info\n"); continue; } -- cgit v1.2.3 From c48cf1b9dd8f01358e5385d40fb58061f32313a7 Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 12 Dec 2014 22:51:01 +0100 Subject: ACPI / utils: Drop error messages from acpi_evaluate_reference() Some of the error messages printed by acpi_evaluate_reference() with the KERN_ERR priority should really be debug messages, but then they would be redundant, because acpi_util_eval_error() is called too at the same spots (except for one). Drop the kernel messages from there entirely and leave the acpi_util_eval_error() to handle the debug printing. In one case, replace the kernel message with a call to acpi_util_eval_error(). Signed-off-by: Rafael J. Wysocki --- drivers/acpi/utils.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 371ac12d25b1..5512309d167b 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -347,22 +347,16 @@ acpi_evaluate_reference(acpi_handle handle, package = buffer.pointer; if ((buffer.length == 0) || !package) { - printk(KERN_ERR PREFIX "No return object (len %X ptr %p)\n", - (unsigned)buffer.length, package); status = AE_BAD_DATA; acpi_util_eval_error(handle, pathname, status); goto end; } if (package->type != ACPI_TYPE_PACKAGE) { - printk(KERN_ERR PREFIX "Expecting a [Package], found type %X\n", - package->type); status = AE_BAD_DATA; acpi_util_eval_error(handle, pathname, status); goto end; } if (!package->package.count) { - printk(KERN_ERR PREFIX "[Package] has zero elements (%p)\n", - package); status = AE_BAD_DATA; acpi_util_eval_error(handle, pathname, status); goto end; @@ -381,17 +375,13 @@ acpi_evaluate_reference(acpi_handle handle, if (element->type != ACPI_TYPE_LOCAL_REFERENCE) { status = AE_BAD_DATA; - printk(KERN_ERR PREFIX - "Expecting a [Reference] package element, found type %X\n", - element->type); acpi_util_eval_error(handle, pathname, status); break; } if (!element->reference.handle) { - printk(KERN_WARNING PREFIX "Invalid reference in" - " package %s\n", pathname); status = AE_NULL_ENTRY; + acpi_util_eval_error(handle, pathname, status); break; } /* Get the acpi_handle. */ -- cgit v1.2.3 From 175f8e2650f7ca6b33d338be3ccc1c00e89594ea Mon Sep 17 00:00:00 2001 From: "Rafael J. Wysocki" Date: Fri, 12 Dec 2014 22:51:58 +0100 Subject: ACPI / PM: Do not disable wakeup GPEs that have not been enabled In some cases acpi_device_wakeup() may be called to ensure wakeup power to be off for a given device even though that device's wakeup GPE has not been enabled so far. It calls acpi_disable_gpe() on a GPE that's not enabled and this causes ACPICA to return the AE_LIMIT status code from that call which then is reported as an error by the ACPICA's debug facilities (if enabled). This may lead to a fair amount of confusion, so introduce a new ACPI device wakeup flag to store the wakeup GPE status and avoid disabling wakeup GPEs that have not been enabled. Reported-and-tested-by: Venkat Raghavulu Signed-off-by: Rafael J. Wysocki --- drivers/acpi/device_pm.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c index 076af8149566..e6ff33ecd784 100644 --- a/drivers/acpi/device_pm.c +++ b/drivers/acpi/device_pm.c @@ -680,13 +680,21 @@ static int acpi_device_wakeup(struct acpi_device *adev, u32 target_state, if (error) return error; + if (adev->wakeup.flags.enabled) + return 0; + res = acpi_enable_gpe(wakeup->gpe_device, wakeup->gpe_number); - if (ACPI_FAILURE(res)) { + if (ACPI_SUCCESS(res)) { + adev->wakeup.flags.enabled = 1; + } else { acpi_disable_wakeup_device_power(adev); return -EIO; } } else { - acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number); + if (adev->wakeup.flags.enabled) { + acpi_disable_gpe(wakeup->gpe_device, wakeup->gpe_number); + adev->wakeup.flags.enabled = 0; + } acpi_disable_wakeup_device_power(adev); } return 0; -- cgit v1.2.3