linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RT] don't let printk unconditionally turn on interrupts
@ 2006-01-21  2:36 Steven Rostedt
  2006-01-21 10:28 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Steven Rostedt @ 2006-01-21  2:36 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: john stultz, Thomas Gleixner, LKML

Ingo,

My first try at booting -rt8 on my machine crashed immediately.  No nmi,
no nothing. Just a lockup at the registration of the ACPI_PM timer.
This would happen every time, and after struggling for a while, I
finally found out why!

The printk in timeofday_periodic_hook that is called holding the
write_lock of system_time_lock (a raw_seq_lock) was causing lots of
havoc.  The printk would turn on interrupts, and then I would get a
deadlock when the interrupt would do a read on system_time_lock.

So here's the patch:

-- Steve

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

Index: linux-2.6.15-rt8/kernel/printk.c
===================================================================
--- linux-2.6.15-rt8.orig/kernel/printk.c	2006-01-20 14:12:07.000000000 -0500
+++ linux-2.6.15-rt8/kernel/printk.c	2006-01-20 21:23:46.000000000 -0500
@@ -772,7 +772,7 @@
 		 */
 #if defined(CONFIG_PREEMPT_RT) && !defined(CONFIG_PRINTK_IGNORE_LOGLEVEL) && !defined(CONFIG_PPC) \
     && !defined(CONFIG_PARANOID_GENERIC_TIME)
-		spin_unlock_irq(&logbuf_lock);
+		spin_unlock_irqrestore(&logbuf_lock, flags);
 #else
 		spin_unlock(&logbuf_lock);
 #endif



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

* Re: [PATCH RT] don't let printk unconditionally turn on interrupts
  2006-01-21  2:36 [PATCH RT] don't let printk unconditionally turn on interrupts Steven Rostedt
@ 2006-01-21 10:28 ` Ingo Molnar
  2006-01-21 12:07   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Ingo Molnar @ 2006-01-21 10:28 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: john stultz, Thomas Gleixner, LKML


* Steven Rostedt <rostedt@goodmis.org> wrote:

> Ingo,
> 
> My first try at booting -rt8 on my machine crashed immediately.  No 
> nmi, no nothing. Just a lockup at the registration of the ACPI_PM 
> timer. This would happen every time, and after struggling for a while, 
> I finally found out why!
> 
> The printk in timeofday_periodic_hook that is called holding the 
> write_lock of system_time_lock (a raw_seq_lock) was causing lots of 
> havoc.  The printk would turn on interrupts, and then I would get a 
> deadlock when the interrupt would do a read on system_time_lock.

argh. This piece of code has caused so many problems already. Some 
people want console drivers to be preemptible, but i guess being able to 
boot trumps things ;)

could you check out the variant in 2.6.15-rt11 - i tweaked it slightly 
over yours, hopefully making the behavior more consistent.

	Ingo

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

* Re: [PATCH RT] don't let printk unconditionally turn on interrupts
  2006-01-21 10:28 ` Ingo Molnar
@ 2006-01-21 12:07   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2006-01-21 12:07 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: john stultz, Thomas Gleixner, LKML


On Sat, 21 Jan 2006, Ingo Molnar wrote:

> could you check out the variant in 2.6.15-rt11 - i tweaked it slightly
> over yours, hopefully making the behavior more consistent.

I'll take a look Monday.

Thanks,

-- Steve

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

end of thread, other threads:[~2006-01-21 12:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-21  2:36 [PATCH RT] don't let printk unconditionally turn on interrupts Steven Rostedt
2006-01-21 10:28 ` Ingo Molnar
2006-01-21 12:07   ` Steven Rostedt

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