diff mbox series

[2/2] acpi/ec: check _GPE is not used for hardware-reduced

Message ID 20200930015225.281805-2-alex.hung@canonical.com
State New
Headers show
Series [1/2] lib: refactor fwts_acpi_is_reduced_hardware | expand

Commit Message

Alex Hung Sept. 30, 2020, 1:52 a.m. UTC
ACPI spec states "This method is not required on Hardware-reduced ACPI
platforms". In addition, Linux also ignores _GPE for hardware-reduced.
See kernel's drivers/acpi/ec.c for details.

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/devices/ec/ec.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

ivanhu Oct. 5, 2020, 9:29 a.m. UTC | #1
On 9/30/20 9:52 AM, Alex Hung wrote:
> ACPI spec states "This method is not required on Hardware-reduced ACPI
> platforms". In addition, Linux also ignores _GPE for hardware-reduced.
> See kernel's drivers/acpi/ec.c for details.
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/devices/ec/ec.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/acpi/devices/ec/ec.c b/src/acpi/devices/ec/ec.c
> index 856b091f..59d099eb 100644
> --- a/src/acpi/devices/ec/ec.c
> +++ b/src/acpi/devices/ec/ec.c
> @@ -93,6 +93,14 @@ static void method_test_GPE_return(
>  	FWTS_UNUSED(buf);
>  	bool failed = false;
>  
> +	if (fwts_acpi_is_reduced_hardware(fw)) {
> +		fwts_failed(fw, LOG_LEVEL_HIGH,
> +			"MethodGPEExist",
> +			"%s is not required for Hardware-reduced ACPI platforms",
> +			name);
> +		return;
> +	}
> +
>  	switch (obj->Type) {
>  	case ACPI_TYPE_INTEGER:
>  		if (obj->Integer.Value <= 255)
> 

Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/devices/ec/ec.c b/src/acpi/devices/ec/ec.c
index 856b091f..59d099eb 100644
--- a/src/acpi/devices/ec/ec.c
+++ b/src/acpi/devices/ec/ec.c
@@ -93,6 +93,14 @@  static void method_test_GPE_return(
 	FWTS_UNUSED(buf);
 	bool failed = false;
 
+	if (fwts_acpi_is_reduced_hardware(fw)) {
+		fwts_failed(fw, LOG_LEVEL_HIGH,
+			"MethodGPEExist",
+			"%s is not required for Hardware-reduced ACPI platforms",
+			name);
+		return;
+	}
+
 	switch (obj->Type) {
 	case ACPI_TYPE_INTEGER:
 		if (obj->Integer.Value <= 255)