Skip to contentSkip to conversation

ACPICA: AcpiGetSleepTypeData: Reduce warnings

PATCH In review Prarit Bhargava 2 participants 2 messages Oct 22, 2015 – Oct 24, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPICA: AcpiGetSleepTypeData: Reduce warnings

From: Robert Moore <[email protected]>

ACPICA commit 7bb77313091e52a846df4c9c2bea90be31bfb9d8

Eliminate warnings for "not found" _Sx errors, since these are optional. Original NOT_FOUND status is still returned.

Original changes by Prarit Bhargava.
ACPICA BZ 1208.

Before patch:

[prarit@prarit linux]$ dmesg | grep "Sleep State"
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130517/hwxface-571) ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20130517/hwxface-571)

After patch:
[prarit@prarit linux]$ dmesg | grep "Sleep State"
[prarit@prarit linux]$

Cc Robert Moore <[email protected]>
Cc Lv Zheng <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>
---
 drivers/acpi/acpica/hwxface.c |   15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/acpi/acpica/hwxface.c +10 -5
index 5f97468..ea0cee4 100644
@@ -508,7 +508,11 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 	    ACPI_CAST_PTR(char, acpi_gbl_sleep_state_names[sleep_state]);
 	status = acpi_ns_evaluate(info);
 	if (ACPI_FAILURE(status)) {
-		goto cleanup;
+		if (status == AE_NOT_FOUND) {
+			/* The _Sx states are optional, ignore NOT_FOUND */
+			goto finalcleanup;
+		}
+		goto warningcleanup;
 	}
 
 	/* Must have a return object */
@@ -517,7 +521,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO, "No Sleep State object returned from [%s]",
 			    info->relative_pathname));
 		status = AE_AML_NO_RETURN_VALUE;
-		goto cleanup;
+		goto warningcleanup;
 	}
 
 	/* Return object must be of type Package */
@@ -526,7 +530,7 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		ACPI_ERROR((AE_INFO,
 			    "Sleep State return object is not a Package"));
 		status = AE_AML_OPERAND_TYPE;
-		goto cleanup1;
+		goto returnvaluecleanup;
 	}
 
 	/*
@@ -570,16 +574,17 @@ acpi_get_sleep_type_data(u8 sleep_state, u8 *sleep_type_a, u8 *sleep_type_b)
 		break;
 	}
 
-cleanup1:
+returnvaluecleanup:
 	acpi_ut_remove_reference(info->return_object);
 
-cleanup:
+warningcleanup:
 	if (ACPI_FAILURE(status)) {
 		ACPI_EXCEPTION((AE_INFO, status,
 				"While evaluating Sleep State [%s]",
 				info->relative_pathname));
 	}
 
+finalcleanup:
 	ACPI_FREE(info);
 	return_ACPI_STATUS(status);
 }
Signature · 1 line
1.7.9.3
#1 lore raw
Quoted 20 lines · Prarit Bhargava

From: Robert Moore <[email protected]>

ACPICA commit 7bb77313091e52a846df4c9c2bea90be31bfb9d8

Eliminate warnings for "not found" _Sx errors, since these are optional. Original NOT_FOUND status is still returned.

Original changes by Prarit Bhargava.
ACPICA BZ 1208.

Before patch:

[prarit@prarit linux]$ dmesg | grep "Sleep State"
ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S1_] (20130517/hwxface-571) ACPI Exception: AE_NOT_FOUND, While evaluating Sleep State [\_S2_] (20130517/hwxface-571)

After patch:
[prarit@prarit linux]$ dmesg | grep "Sleep State"
[prarit@prarit linux]$

Quoted 6 lines
Cc Robert Moore <[email protected]>
Cc Lv Zheng <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Len Brown <[email protected]>

I'll wait until this comes to me from upstream ACPICA.

Thanks,
Rafael