diff mbox

[02/21] FADT: non-x86 machines need an FADT but x86 can survive without one

Message ID 1454981583-31872-3-git-send-email-al.stone@linaro.org
State Rejected
Headers show

Commit Message

Al Stone Feb. 9, 2016, 1:32 a.m. UTC
If there is no FADT, x86 machines can get by.  Others cannot (or at
least should not).  On non-x86 machines, cause the initialization to
fail instead of ignoring a zero-length FADT.

Signed-off-by: Al Stone <al.stone@linaro.org>
---
 src/acpi/fadt/fadt.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

Colin Ian King Feb. 9, 2016, 11:45 a.m. UTC | #1
On 09/02/16 01:32, Al Stone wrote:
> If there is no FADT, x86 machines can get by.  Others cannot (or at
> least should not).  On non-x86 machines, cause the initialization to
> fail instead of ignoring a zero-length FADT.
> 
> Signed-off-by: Al Stone <al.stone@linaro.org>
> ---
>  src/acpi/fadt/fadt.c | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index 1a5560c..aacf317 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -56,10 +56,17 @@ static int fadt_init(fwts_framework *fw)
>  	fadt = (const fwts_acpi_table_fadt*)table->data;
>  	fadt_size = table->length;
>  
> -	/*  Not having a FADT is not a failure */
> +	/*  Not having a FADT is not a failure on x86 */
>  	if (fadt_size == 0) {
> -		fwts_log_info(fw, "FADT does not exist, this is not necessarily a failure, skipping tests.");
> -		return FWTS_SKIP;
> +		if (fw->target_arch == FWTS_ARCH_X86) {
> +			fwts_log_info(fw,
> +				      "FADT does not exist, this is not "
> +				      "necessarily a failure, skipping tests.");
> +			return FWTS_SKIP;
> +		} else {
> +			fwts_log_error(fw, "ACPI table FACP has zero length!");
> +			return FWTS_ERROR;
> +		}
>  	}
>  
>  	return FWTS_OK;
> 
Acked-by: Colin Ian King <colin.king@canonucal.com>
Ivan Hu Feb. 16, 2016, 2:57 a.m. UTC | #2
On 2016年02月09日 09:32, Al Stone wrote:
> If there is no FADT, x86 machines can get by.  Others cannot (or at
> least should not).  On non-x86 machines, cause the initialization to
> fail instead of ignoring a zero-length FADT.
>
> Signed-off-by: Al Stone <al.stone@linaro.org>
> ---
>   src/acpi/fadt/fadt.c | 13 ++++++++++---
>   1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
> index 1a5560c..aacf317 100644
> --- a/src/acpi/fadt/fadt.c
> +++ b/src/acpi/fadt/fadt.c
> @@ -56,10 +56,17 @@ static int fadt_init(fwts_framework *fw)
>   	fadt = (const fwts_acpi_table_fadt*)table->data;
>   	fadt_size = table->length;
>
> -	/*  Not having a FADT is not a failure */
> +	/*  Not having a FADT is not a failure on x86 */
>   	if (fadt_size == 0) {
> -		fwts_log_info(fw, "FADT does not exist, this is not necessarily a failure, skipping tests.");
> -		return FWTS_SKIP;
> +		if (fw->target_arch == FWTS_ARCH_X86) {
> +			fwts_log_info(fw,
> +				      "FADT does not exist, this is not "
> +				      "necessarily a failure, skipping tests.");
> +			return FWTS_SKIP;
> +		} else {
> +			fwts_log_error(fw, "ACPI table FACP has zero length!");
> +			return FWTS_ERROR;
> +		}
>   	}
>
>   	return FWTS_OK;
>

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

Patch

diff --git a/src/acpi/fadt/fadt.c b/src/acpi/fadt/fadt.c
index 1a5560c..aacf317 100644
--- a/src/acpi/fadt/fadt.c
+++ b/src/acpi/fadt/fadt.c
@@ -56,10 +56,17 @@  static int fadt_init(fwts_framework *fw)
 	fadt = (const fwts_acpi_table_fadt*)table->data;
 	fadt_size = table->length;
 
-	/*  Not having a FADT is not a failure */
+	/*  Not having a FADT is not a failure on x86 */
 	if (fadt_size == 0) {
-		fwts_log_info(fw, "FADT does not exist, this is not necessarily a failure, skipping tests.");
-		return FWTS_SKIP;
+		if (fw->target_arch == FWTS_ARCH_X86) {
+			fwts_log_info(fw,
+				      "FADT does not exist, this is not "
+				      "necessarily a failure, skipping tests.");
+			return FWTS_SKIP;
+		} else {
+			fwts_log_error(fw, "ACPI table FACP has zero length!");
+			return FWTS_ERROR;
+		}
 	}
 
 	return FWTS_OK;