Message ID | 20090702124726.a253f13d.akpm@linux-foundation.org (mailing list archive) |
---|---|
State | RFC, archived |
Headers | show |
On Thu, 02 Jul 2009 12:47:26 PDT, Andrew Morton said: > apart from having a crappy title, linux-next's > > : commit f29876421ec11f7d66f3d982219ef3af9bcccf32 > : Author: Rusty Russell <rusty@rustcorp.com.au> > : AuthorDate: Wed Jul 1 12:37:19 2009 +1000 > : Commit: Stephen Rothwell <sfr@canb.auug.org.au> > : CommitDate: Wed Jul 1 12:37:19 2009 +1000 > : > : misc:work_on_cpu-acpi > : > > causes get_throttling() to newly be called from an IPI, and lockdep doesn't > like irq-disabled interrupt handlers doing local_irq_enable(). > > > If we rely upon these functions only ever being called from > smp_call_function_single(), and if smp_call_function_single() is > correctly implemented, we should be able to do this: I'll take a leap of faith on the "correctly implemented" part. However, I admit I'm probably going to wait till Len or somebody agrees on the "only calledf from function_single()" part being correct before test-driving the patch...
On Thu, 02 Jul 2009 12:47:26 PDT, Andrew Morton said: > On Thu, 02 Jul 2009 15:16:03 -0400 > Valdis.Kletnieks@vt.edu wrote: > > [ 0.657296] WARNING: at kernel/lockdep.c:2143 trace_hardirqs_on_caller+0xc7/0x145() > If we rely upon these functions only ever being called from > smp_call_function_single(), and if smp_call_function_single() is > correctly implemented, we should be able to do this: > > --- a/drivers/acpi/processor_throttling.c~a > +++ a/drivers/acpi/processor_throttling.c That does seem to have scared the warning into hiding - I'm not seeing it anymore in -mmotm0702. Thanks.
--- a/drivers/acpi/processor_throttling.c~a +++ a/drivers/acpi/processor_throttling.c @@ -616,6 +616,8 @@ static int acpi_processor_get_throttling u32 duty_mask = 0; u32 duty_value = 0; + WARN_ON_ONCE(!irqs_disabled()); + if (!pr) return -EINVAL; @@ -628,8 +630,6 @@ static int acpi_processor_get_throttling duty_mask <<= pr->throttling.duty_offset; - local_irq_disable(); - value = inl(pr->throttling.address); /* @@ -646,8 +646,6 @@ static int acpi_processor_get_throttling pr->throttling.state = state; - local_irq_enable(); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling state is T%d (%d%% throttling applied)\n", state, pr->throttling.states[state].performance)); @@ -919,6 +917,8 @@ static int acpi_processor_set_throttling u32 duty_mask = 0; u32 duty_value = 0; + WARN_ON_ONCE(!irqs_disabled()); + if (!pr) return -EINVAL; @@ -948,8 +948,6 @@ static int acpi_processor_set_throttling duty_mask = ~duty_mask; } - local_irq_disable(); - /* * Disable throttling by writing a 0 to bit 4. Note that we must * turn it off before you can change the duty_value. @@ -975,8 +973,6 @@ static int acpi_processor_set_throttling pr->throttling.state = state; - local_irq_enable(); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Throttling state set to T%d (%d%%)\n", state, (pr->throttling.states[state].performance ? pr->