diff mbox

pci: aspm: test should skip if it can't read FACP or PCIe config (LP: #1201909)

Message ID 1373997478-26880-1-git-send-email-colin.king@canonical.com
State Accepted
Headers show

Commit Message

Colin Ian King July 16, 2013, 5:57 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

If we can't test ASPM then we should log the test as skipped.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/pci/aspm/aspm.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Ivan Hu July 16, 2013, 11:20 p.m. UTC | #1
On 07/17/2013 01:57 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> If we can't test ASPM then we should log the test as skipped.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/pci/aspm/aspm.c | 14 +++++++++-----
>   1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/src/pci/aspm/aspm.c b/src/pci/aspm/aspm.c
> index 035d1b0..be8ee5b 100644
> --- a/src/pci/aspm/aspm.c
> +++ b/src/pci/aspm/aspm.c
> @@ -331,17 +331,21 @@ static int aspm_check_configuration(fwts_framework *fw)
>   	int aspm_facp;
>
>   	ret = facp_get_aspm_control(fw, &aspm_facp);
> -	if (ret == FWTS_ERROR) {
> -		fwts_log_info(fw, "No valid FACP information present: cannot test ASPM.");
> -		return FWTS_ERROR;
> -	}
> +	if (ret == FWTS_ERROR)
> +		fwts_skipped(fw, "No valid FACP information present: cannot test ASPM.");
>
>   	return ret;
>   }
>
>   static int aspm_pcie_register_configuration(fwts_framework *fw)
>   {
> -	return pcie_check_aspm_registers(fw);
> +	int ret;
> +
> +	ret = pcie_check_aspm_registers(fw);
> +	if (ret == FWTS_ERROR)
> +		fwts_skipped(fw, "Cannot sanity check PCIe register configuration.");
> +
> +	return ret;
>   }
>
>   static fwts_framework_minor_test aspm_tests[] = {
>
Acked-by: Ivan Hu <ivan.hu@canonical.com>
Keng-Yu Lin July 26, 2013, 4:10 a.m. UTC | #2
On Wed, Jul 17, 2013 at 1:57 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> If we can't test ASPM then we should log the test as skipped.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/pci/aspm/aspm.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/src/pci/aspm/aspm.c b/src/pci/aspm/aspm.c
> index 035d1b0..be8ee5b 100644
> --- a/src/pci/aspm/aspm.c
> +++ b/src/pci/aspm/aspm.c
> @@ -331,17 +331,21 @@ static int aspm_check_configuration(fwts_framework *fw)
>         int aspm_facp;
>
>         ret = facp_get_aspm_control(fw, &aspm_facp);
> -       if (ret == FWTS_ERROR) {
> -               fwts_log_info(fw, "No valid FACP information present: cannot test ASPM.");
> -               return FWTS_ERROR;
> -       }
> +       if (ret == FWTS_ERROR)
> +               fwts_skipped(fw, "No valid FACP information present: cannot test ASPM.");
>
>         return ret;
>  }
>
>  static int aspm_pcie_register_configuration(fwts_framework *fw)
>  {
> -       return pcie_check_aspm_registers(fw);
> +       int ret;
> +
> +       ret = pcie_check_aspm_registers(fw);
> +       if (ret == FWTS_ERROR)
> +               fwts_skipped(fw, "Cannot sanity check PCIe register configuration.");
> +
> +       return ret;
>  }
>
>  static fwts_framework_minor_test aspm_tests[] = {
> --
> 1.8.1.2
>

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

diff --git a/src/pci/aspm/aspm.c b/src/pci/aspm/aspm.c
index 035d1b0..be8ee5b 100644
--- a/src/pci/aspm/aspm.c
+++ b/src/pci/aspm/aspm.c
@@ -331,17 +331,21 @@  static int aspm_check_configuration(fwts_framework *fw)
 	int aspm_facp;
 
 	ret = facp_get_aspm_control(fw, &aspm_facp);
-	if (ret == FWTS_ERROR) {
-		fwts_log_info(fw, "No valid FACP information present: cannot test ASPM.");
-		return FWTS_ERROR;
-	}
+	if (ret == FWTS_ERROR)
+		fwts_skipped(fw, "No valid FACP information present: cannot test ASPM.");
 
 	return ret;
 }
 
 static int aspm_pcie_register_configuration(fwts_framework *fw)
 {
-	return pcie_check_aspm_registers(fw);
+	int ret;
+
+	ret = pcie_check_aspm_registers(fw);
+	if (ret == FWTS_ERROR)
+		fwts_skipped(fw, "Cannot sanity check PCIe register configuration.");
+
+	return ret;
 }
 
 static fwts_framework_minor_test aspm_tests[] = {