linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle
@ 2009-05-19  8:09 Shaohua Li
  2009-05-19 12:55 ` Thomas Gleixner
  2009-05-27  3:39 ` Len Brown
  0 siblings, 2 replies; 5+ messages in thread
From: Shaohua Li @ 2009-05-19  8:09 UTC (permalink / raw)
  To: linux-kernel, linux-acpi; +Cc: lenb, thisistempbox, mingo

When AMD C1E is enabled, local APIC timer will stop even in C1. This patch uses
broadcast ipi to replace local APIC timer in C1.

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

[ impact: avoid boot hang in AMD CPU with C1E enabled ]

Tested-by: Dmitry Lyzhyn <thisistempbox@yahoo.com>
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
---
 drivers/acpi/processor_idle.c |    6 ++++++
 1 file changed, 6 insertions(+)

Index: linux/drivers/acpi/processor_idle.c
===================================================================
--- linux.orig/drivers/acpi/processor_idle.c	2009-05-19 09:45:23.000000000 +0800
+++ linux/drivers/acpi/processor_idle.c	2009-05-19 09:56:59.000000000 +0800
@@ -148,6 +148,9 @@ static void acpi_timer_check_state(int s
 	if (cpu_has(&cpu_data(pr->id), X86_FEATURE_ARAT))
 		return;
 
+	if (boot_cpu_has(X86_FEATURE_AMDC1E))
+		type = ACPI_STATE_C1;
+
 	/*
 	 * Check, if one of the previous states already marked the lapic
 	 * unstable
@@ -611,6 +614,7 @@ static int acpi_processor_power_verify(s
 		switch (cx->type) {
 		case ACPI_STATE_C1:
 			cx->valid = 1;
+			acpi_timer_check_state(i, pr, cx);
 			break;
 
 		case ACPI_STATE_C2:
@@ -835,6 +839,7 @@ static int acpi_idle_enter_c1(struct cpu
 		return 0;
 	}
 
+	acpi_state_timer_broadcast(pr, cx, 1);
 	kt1 = ktime_get_real();
 	acpi_idle_do_entry(cx);
 	kt2 = ktime_get_real();
@@ -842,6 +847,7 @@ static int acpi_idle_enter_c1(struct cpu
 
 	local_irq_enable();
 	cx->usage++;
+	acpi_state_timer_broadcast(pr, cx, 0);
 
 	return idle_time;
 }

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle
  2009-05-19  8:09 [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle Shaohua Li
@ 2009-05-19 12:55 ` Thomas Gleixner
  2009-05-19 15:09   ` Shaohua Li
  2009-05-27  3:39 ` Len Brown
  1 sibling, 1 reply; 5+ messages in thread
From: Thomas Gleixner @ 2009-05-19 12:55 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux-kernel, linux-acpi, lenb, thisistempbox, mingo

On Tue, 19 May 2009, Shaohua Li wrote:

> When AMD C1E is enabled, local APIC timer will stop even in C1. This patch uses
> broadcast ipi to replace local APIC timer in C1.
> 
> http://bugzilla.kernel.org/show_bug.cgi?id=13233

Hmm. This was addressed before in 

commit a8d6829044901a67732904be5f1eacdf8539604f (x86: prevent C-states
hang on AMD C1E enabled machines)

We limit C-States to 1 via acpi_processor_cstate_check().

And we have the broadcast logic in c1e_idle() already. We also select
c1e_idle as the idle routine, so why is the ACPI code not using this. ?

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle
  2009-05-19 12:55 ` Thomas Gleixner
@ 2009-05-19 15:09   ` Shaohua Li
  2009-05-19 15:24     ` Thomas Gleixner
  0 siblings, 1 reply; 5+ messages in thread
From: Shaohua Li @ 2009-05-19 15:09 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: linux-kernel, linux-acpi, lenb, thisistempbox, mingo

On Tue, May 19, 2009 at 08:55:10PM +0800, Thomas Gleixner wrote:
> On Tue, 19 May 2009, Shaohua Li wrote:
> 
> > When AMD C1E is enabled, local APIC timer will stop even in C1. This patch uses
> > broadcast ipi to replace local APIC timer in C1.
> > 
> > http://bugzilla.kernel.org/show_bug.cgi?id=13233
> 
> Hmm. This was addressed before in 
> 
> commit a8d6829044901a67732904be5f1eacdf8539604f (x86: prevent C-states
> hang on AMD C1E enabled machines)
> 
> We limit C-States to 1 via acpi_processor_cstate_check().
> 
> And we have the broadcast logic in c1e_idle() already. We also select
> c1e_idle as the idle routine, so why is the ACPI code not using this. ?
We used to call pm_idle_save() for C1, which will call c1e_idle. But this is
removed, guess the reason is we want to do C1 enter per the information gotten
from BIOS. So this bug is a regression actually. The patch follows the logic
of c1e_idle().

Thanks,
Shaohua

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle
  2009-05-19 15:09   ` Shaohua Li
@ 2009-05-19 15:24     ` Thomas Gleixner
  0 siblings, 0 replies; 5+ messages in thread
From: Thomas Gleixner @ 2009-05-19 15:24 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux-kernel, linux-acpi, lenb, thisistempbox, mingo

On Tue, 19 May 2009, Shaohua Li wrote:

> On Tue, May 19, 2009 at 08:55:10PM +0800, Thomas Gleixner wrote:
> > On Tue, 19 May 2009, Shaohua Li wrote:
> > 
> > > When AMD C1E is enabled, local APIC timer will stop even in C1. This patch uses
> > > broadcast ipi to replace local APIC timer in C1.
> > > 
> > > http://bugzilla.kernel.org/show_bug.cgi?id=13233
> > 
> > Hmm. This was addressed before in 
> > 
> > commit a8d6829044901a67732904be5f1eacdf8539604f (x86: prevent C-states
> > hang on AMD C1E enabled machines)
> > 
> > We limit C-States to 1 via acpi_processor_cstate_check().
> > 
> > And we have the broadcast logic in c1e_idle() already. We also select
> > c1e_idle as the idle routine, so why is the ACPI code not using this. ?
>
> We used to call pm_idle_save() for C1, which will call c1e_idle. But this is
> removed, guess the reason is we want to do C1 enter per the information gotten
> from BIOS. So this bug is a regression actually. The patch follows the logic
> of c1e_idle().

Hmm, ok. As long as the code does not undo something which was already
set up in c1e_idle() I have no objections.

Thanks,

	tglx

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle
  2009-05-19  8:09 [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle Shaohua Li
  2009-05-19 12:55 ` Thomas Gleixner
@ 2009-05-27  3:39 ` Len Brown
  1 sibling, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-05-27  3:39 UTC (permalink / raw)
  To: Shaohua Li; +Cc: linux-kernel, linux-acpi, thisistempbox, mingo

applied

thanks,
Len Brown, Intel Open Source Technology Center


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-05-27  3:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-19  8:09 [PATCH 1/2]cpuidle: makes AMD C1E works in acpi_idle Shaohua Li
2009-05-19 12:55 ` Thomas Gleixner
2009-05-19 15:09   ` Shaohua Li
2009-05-19 15:24     ` Thomas Gleixner
2009-05-27  3:39 ` Len Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).