diff mbox

: ACPI: Add the module param check for processor.max_cstate

Message ID alpine.LFD.2.00.0904232323410.15843@localhost.localdomain (mailing list archive)
State Accepted
Headers show

Commit Message

Len Brown April 24, 2009, 3:24 a.m. UTC
From: Len Brown <len.brown@intel.com>
Subject: [PATCH] ACPI: prevent processor.max_cstate=0 boot crash

As processor.max_cstate is an init-time-only modparam,
sanity checking it at init-time is sufficient.

http://bugzilla.kernel.org/show_bug.cgi?id=13142

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/acpi/processor_idle.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

Comments

Zhao, Yakui April 24, 2009, 3:30 a.m. UTC | #1
On Fri, 2009-04-24 at 11:24 +0800, Len Brown wrote:
> From: Len Brown <len.brown@intel.com>
> Subject: [PATCH] ACPI: prevent processor.max_cstate=0 boot crash
> 
> As processor.max_cstate is an init-time-only modparam,
> sanity checking it at init-time is sufficient.
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=13142
This is also OK. And it is easier.

Thanks.
> 
> Signed-off-by: Len Brown <len.brown@intel.com>
> ---
>  drivers/acpi/processor_idle.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
> index 6fe1214..436127e 100644
> --- a/drivers/acpi/processor_idle.c
> +++ b/drivers/acpi/processor_idle.c
> @@ -1037,6 +1037,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
>  		dev->states[i].desc[0] = '\0';
>  	}
>  
> +	if (max_cstate == 0)
> +		max_cstate = 1;
> +
>  	for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
>  		cx = &pr->power.states[i];
>  		state = &dev->states[count];

--
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

diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c
index 6fe1214..436127e 100644
--- a/drivers/acpi/processor_idle.c
+++ b/drivers/acpi/processor_idle.c
@@ -1037,6 +1037,9 @@  static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
 		dev->states[i].desc[0] = '\0';
 	}
 
+	if (max_cstate == 0)
+		max_cstate = 1;
+
 	for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
 		cx = &pr->power.states[i];
 		state = &dev->states[count];