All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Wessel <jason.wessel@windriver.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>,
	linux-rt-users <linux-rt-users@vger.kernel.org>
Subject: Re: [ANNOUNCE] 3.0-rt4
Date: Thu, 28 Jul 2011 12:42:23 -0500	[thread overview]
Message-ID: <4E319F7F.8040802@windriver.com> (raw)
In-Reply-To: <alpine.LFD.2.02.1107272222420.2660@ionos>

[-- Attachment #1: Type: text/plain, Size: 542 bytes --]

On 07/27/2011 04:37 PM, Thomas Gleixner wrote:
>  - KGDB (not yet disabled) is reportedly unusable on -rt right now due
>    to missing hacks in the console locking which I dropped on purpose.
>

To work around this in the short term you can use this patch, in addition to the clocksource watchdog patch that Thomas brewed up.

Comments are welcome of course.   Ultimately the right solution is to change separation between the console and the HW to have a polled mode + work queue so as not to introduce any kind of latency.

Thanks,
Jason.

[-- Attachment #2: kgdboc_8250_lock_fix.patch --]
[-- Type: text/x-diff, Size: 2694 bytes --]

Index: linux-2.6-kgdb/drivers/tty/serial/8250.c
===================================================================
--- linux-2.6-kgdb.orig/drivers/tty/serial/8250.c	2011-07-28 09:07:06.313204001 -0500
+++ linux-2.6-kgdb/drivers/tty/serial/8250.c	2011-07-28 09:21:43.363203854 -0500
@@ -38,6 +38,7 @@
 #include <linux/nmi.h>
 #include <linux/mutex.h>
 #include <linux/slab.h>
+#include <linux/kdb.h>
 
 #include <asm/io.h>
 #include <asm/irq.h>
@@ -2894,10 +2895,14 @@
 
 	touch_nmi_watchdog();
 
-	if (up->port.sysrq || oops_in_progress)
-		locked = spin_trylock_irqsave(&up->port.lock, flags);
-	else
-		spin_lock_irqsave(&up->port.lock, flags);
+	if (unlikely(in_kdb_printk())) {
+		locked = 0;
+	} else {
+		if (up->port.sysrq || oops_in_progress)
+			locked = spin_trylock_irqsave(&up->port.lock, flags);
+		else
+			spin_lock_irqsave(&up->port.lock, flags);
+	}
 
 	/*
 	 *	First save the IER then disable the interrupts
Index: linux-2.6-kgdb/include/linux/kdb.h
===================================================================
--- linux-2.6-kgdb.orig/include/linux/kdb.h	2011-07-28 09:09:55.523204135 -0500
+++ linux-2.6-kgdb/include/linux/kdb.h	2011-07-28 09:12:21.183204000 -0500
@@ -153,12 +153,14 @@
 extern int kdb_register_repeat(char *, kdb_func_t, char *, char *,
 			       short, kdb_repeat_t);
 extern int kdb_unregister(char *);
+#define in_kdb_printk() (kdb_trap_printk)
 #else /* ! CONFIG_KGDB_KDB */
 #define kdb_printf(...)
 #define kdb_init(x)
 #define kdb_register(...)
 #define kdb_register_repeat(...)
 #define kdb_uregister(x)
+#define in_kdb_printk() (0)
 #endif	/* CONFIG_KGDB_KDB */
 enum {
 	KDB_NOT_INITIALIZED,
Index: linux-2.6-kgdb/kernel/debug/kdb/kdb_io.c
===================================================================
--- linux-2.6-kgdb.orig/kernel/debug/kdb/kdb_io.c	2011-07-28 09:05:40.963204003 -0500
+++ linux-2.6-kgdb/kernel/debug/kdb/kdb_io.c	2011-07-28 09:13:02.463204337 -0500
@@ -539,7 +539,6 @@
 	int diag;
 	int linecount;
 	int logging, saved_loglevel = 0;
-	int saved_trap_printk;
 	int got_printf_lock = 0;
 	int retlen = 0;
 	int fnd, len;
@@ -550,8 +549,6 @@
 	unsigned long uninitialized_var(flags);
 
 	preempt_disable();
-	saved_trap_printk = kdb_trap_printk;
-	kdb_trap_printk = 0;
 
 	/* Serialize kdb_printf if multiple cpus try to write at once.
 	 * But if any cpu goes recursive in kdb, just print the output,
@@ -807,7 +804,6 @@
 	} else {
 		__release(kdb_printf_lock);
 	}
-	kdb_trap_printk = saved_trap_printk;
 	preempt_enable();
 	return retlen;
 }
@@ -817,9 +813,11 @@
 	va_list ap;
 	int r;
 
+	kdb_trap_printk++;
 	va_start(ap, fmt);
 	r = vkdb_printf(fmt, ap);
 	va_end(ap);
+	kdb_trap_printk--;
 
 	return r;
 }

  parent reply	other threads:[~2011-07-28 17:42 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 21:37 [ANNOUNCE] 3.0-rt4 Thomas Gleixner
2011-07-27 21:57 ` Frank Rowand
2011-07-27 22:05   ` Thomas Gleixner
2011-07-27 22:27     ` Frank Rowand
2011-07-28  7:33 ` Nikita V. Youshchenko
2011-07-28  8:06   ` Thomas Gleixner
2011-07-28  8:24     ` Nikita V. Youshchenko
2011-07-28  8:44       ` Peter Zijlstra
2011-07-28  8:51         ` Nikita V. Youshchenko
2011-07-28  9:21           ` Anca Emanuel
2011-07-28 16:10             ` Thomas Gleixner
2011-07-28  9:37           ` Thomas Gleixner
2011-07-28  8:43     ` Peter Zijlstra
2011-07-28  9:41 ` Yong Zhang
2011-07-28  9:41   ` Yong Zhang
2011-07-28  9:49   ` Thomas Gleixner
2011-07-28 11:22 ` N, Mugunthan V
2011-07-28 11:36   ` Thomas Gleixner
2011-07-28 15:59 ` hermann
2011-07-28 17:41 ` Paul E. McKenney
2011-07-28 17:43   ` Thomas Gleixner
2011-07-28 18:32     ` Paul E. McKenney
2011-07-28 19:05       ` Thomas Gleixner
2011-07-28 19:34         ` Paul E. McKenney
2011-07-28 20:29           ` Paul E. McKenney
2011-07-28 17:42 ` Jason Wessel [this message]
2011-07-28 17:49   ` Thomas Gleixner
2011-07-28 19:16 ` Fernando Lopez-Lezcano
2011-07-28 19:36   ` Thomas Gleixner
2011-07-29  0:13     ` Fernando Lopez-Lezcano
2011-07-28 21:22   ` Peter Zijlstra
2011-07-28 21:22     ` Peter Zijlstra
2011-07-28 22:55     ` Pekka Enberg
2011-07-29  0:17     ` Fernando Lopez-Lezcano
2011-08-04  8:36     ` [tip:core/urgent] slab, lockdep: Annotate the locks before using them tip-bot for Peter Zijlstra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E319F7F.8040802@windriver.com \
    --to=jason.wessel@windriver.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.