diff mbox

[08/17] ACPI, APEI, GHES, Support disable GHES at boot time

Message ID 1310534068-30547-9-git-send-email-ying.huang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Huang, Ying July 13, 2011, 5:14 a.m. UTC
Some machine may have broken firmware so that GHES and firmware first
mode should be disabled.  This patch adds support to that.

Signed-off-by: Huang Ying <ying.huang@intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Matthew Garrett <mjg@redhat.com>
---
 drivers/acpi/apei/ghes.c |    8 ++++++++
 drivers/acpi/apei/hest.c |   17 +++++++++--------
 include/acpi/apei.h      |    1 +
 3 files changed, 18 insertions(+), 8 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Don Zickus July 14, 2011, 2:47 p.m. UTC | #1
On Wed, Jul 13, 2011 at 01:14:19PM +0800, Huang Ying wrote:
> Some machine may have broken firmware so that GHES and firmware first
> mode should be disabled.  This patch adds support to that.

Does this still work if you have disabled ghes module support in the
previous patch?

Cheers,
Don

> 
> Signed-off-by: Huang Ying <ying.huang@intel.com>
> Reviewed-by: Andi Kleen <ak@linux.intel.com>
> Reviewed-by: Matthew Garrett <mjg@redhat.com>
> ---
>  drivers/acpi/apei/ghes.c |    8 ++++++++
>  drivers/acpi/apei/hest.c |   17 +++++++++--------
>  include/acpi/apei.h      |    1 +
>  3 files changed, 18 insertions(+), 8 deletions(-)
> 
> --- a/drivers/acpi/apei/ghes.c
> +++ b/drivers/acpi/apei/ghes.c
> @@ -77,6 +77,9 @@ struct ghes {
>  	};
>  };
>  
> +int ghes_disable;
> +module_param_named(disable, ghes_disable, bool, 0);
> +
>  static int ghes_panic_timeout	__read_mostly = 30;
>  
>  /*
> @@ -665,6 +668,11 @@ static int __init ghes_init(void)
>  		return -EINVAL;
>  	}
>  
> +	if (ghes_disable) {
> +		pr_info(GHES_PFX "GHES is not enabled!\n");
> +		return -EINVAL;
> +	}
> +
>  	rc = ghes_ioremap_init();
>  	if (rc)
>  		goto err;
> --- a/drivers/acpi/apei/hest.c
> +++ b/drivers/acpi/apei/hest.c
> @@ -231,16 +231,17 @@ void __init acpi_hest_init(void)
>  		goto err;
>  	}
>  
> -	rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
> -	if (rc)
> -		goto err;
> -
> -	rc = hest_ghes_dev_register(ghes_count);
> -	if (!rc) {
> -		pr_info(HEST_PFX "Table parsing has been initialized.\n");
> -		return;
> +	if (!ghes_disable) {
> +		rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
> +		if (rc)
> +			goto err;
> +		rc = hest_ghes_dev_register(ghes_count);
> +		if (rc)
> +			goto err;
>  	}
>  
> +	pr_info(HEST_PFX "Table parsing has been initialized.\n");
> +	return;
>  err:
>  	hest_disable = 1;
>  }
> --- a/include/acpi/apei.h
> +++ b/include/acpi/apei.h
> @@ -18,6 +18,7 @@
>  
>  extern int hest_disable;
>  extern int erst_disable;
> +extern int ghes_disable;
>  
>  #ifdef CONFIG_ACPI_APEI
>  void __init acpi_hest_init(void);
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Huang, Ying July 15, 2011, 12:31 a.m. UTC | #2
On 07/14/2011 10:47 PM, Don Zickus wrote:
> On Wed, Jul 13, 2011 at 01:14:19PM +0800, Huang Ying wrote:
>> Some machine may have broken firmware so that GHES and firmware first
>> mode should be disabled.  This patch adds support to that.
> 
> Does this still work if you have disabled ghes module support in the
> previous patch?

Yes.  Module param can be specified in kernel command line, for example
"ghes.disable=y".

Best Regards,
Huang Ying
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Don Zickus July 15, 2011, 1:33 p.m. UTC | #3
On Fri, Jul 15, 2011 at 08:31:00AM +0800, Huang Ying wrote:
> On 07/14/2011 10:47 PM, Don Zickus wrote:
> > On Wed, Jul 13, 2011 at 01:14:19PM +0800, Huang Ying wrote:
> >> Some machine may have broken firmware so that GHES and firmware first
> >> mode should be disabled.  This patch adds support to that.
> > 
> > Does this still work if you have disabled ghes module support in the
> > previous patch?
> 
> Yes.  Module param can be specified in kernel command line, for example
> "ghes.disable=y".

Ok.  I just tested that too.  Didn't realize a built-in could still use
module params.

Tested-and-Reviewed-by: Don Zickus <dzickus@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/acpi/apei/ghes.c
+++ b/drivers/acpi/apei/ghes.c
@@ -77,6 +77,9 @@  struct ghes {
 	};
 };
 
+int ghes_disable;
+module_param_named(disable, ghes_disable, bool, 0);
+
 static int ghes_panic_timeout	__read_mostly = 30;
 
 /*
@@ -665,6 +668,11 @@  static int __init ghes_init(void)
 		return -EINVAL;
 	}
 
+	if (ghes_disable) {
+		pr_info(GHES_PFX "GHES is not enabled!\n");
+		return -EINVAL;
+	}
+
 	rc = ghes_ioremap_init();
 	if (rc)
 		goto err;
--- a/drivers/acpi/apei/hest.c
+++ b/drivers/acpi/apei/hest.c
@@ -231,16 +231,17 @@  void __init acpi_hest_init(void)
 		goto err;
 	}
 
-	rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
-	if (rc)
-		goto err;
-
-	rc = hest_ghes_dev_register(ghes_count);
-	if (!rc) {
-		pr_info(HEST_PFX "Table parsing has been initialized.\n");
-		return;
+	if (!ghes_disable) {
+		rc = apei_hest_parse(hest_parse_ghes_count, &ghes_count);
+		if (rc)
+			goto err;
+		rc = hest_ghes_dev_register(ghes_count);
+		if (rc)
+			goto err;
 	}
 
+	pr_info(HEST_PFX "Table parsing has been initialized.\n");
+	return;
 err:
 	hest_disable = 1;
 }
--- a/include/acpi/apei.h
+++ b/include/acpi/apei.h
@@ -18,6 +18,7 @@ 
 
 extern int hest_disable;
 extern int erst_disable;
+extern int ghes_disable;
 
 #ifdef CONFIG_ACPI_APEI
 void __init acpi_hest_init(void);