mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tom Rini <trini@kernel.crashing.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: kus Kusche Klaus <kus@keba.com>,
	Serge Noiraud <serge.noiraud@bull.net>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: RT and kernel debugger ( 2.6.12rc6  + RT  > 48-00 )
Date: Fri, 17 Jun 2005 12:23:41 -0700	[thread overview]
Message-ID: <20050617192341.GA4824@smtp.west.cox.net> (raw)
In-Reply-To: <20050614072015.GA31891@elte.hu>

On Tue, Jun 14, 2005 at 09:20:15AM +0200, Ingo Molnar wrote:
> 
> * kus Kusche Klaus <kus@keba.com> wrote:
> 
> > I was one of those who tried to get kgdb working.
> > 
> > Here I described how far I came:
> > http://www.ussg.iu.edu/hypermail/linux/kernel/0505.1/0700.html
> 
> does ethernet debugging work if you disable the netpoll WARN_ON() that 
> triggers?

With the KGDB at http://kgdb.linsyssoft.com/cvs.htm the following is all
that's needed for PREEMPT_RT to work:
--- linux-2.6.10.orig/drivers/net/kgdb_eth.c
+++ linux-2.6.10/drivers/net/kgdb_eth.c
@@ -55,22 +55,49 @@ static int eth_getDebugChar(void)
 {
 	int chr;
 
-	while (atomic_read(&in_count) == 0)
+#ifdef CONFIG_PREEMPT_RT
+	/*
+	 * A bit hairy. Netpoll API users uses mutexes (indirectly) and
+	 * thus must have interrupts enabled:
+	 */
+	local_irq_enable();
+#endif
+
+	while (atomic_read(&in_count) == 0) {
+		WARN_ON_RT(irqs_disabled());
 		netpoll_poll(&np);
+		WARN_ON_RT(irqs_disabled());
+	}
 
 	chr = in_buf[in_tail++];
 	in_tail &= (IN_BUF_SIZE - 1);
 	atomic_dec(&in_count);
+#ifdef CONFIG_PREEMPT_RT
+	local_irq_disable();
+#endif
 	return chr;
 }
 
 static void eth_flushDebugChar(void)
 {
+#ifdef CONFIG_PREEMPT_RT
+	/*
+	 * A bit hairy. Netpoll API users uses mutexes (indirectly) and
+	 * thus must have interrupts enabled:
+	 */
+	local_irq_enable();
+#endif
+
 	if (out_count && np.dev) {
+		WARN_ON_RT(irqs_disabled());
 		netpoll_send_udp(&np, out_buf, out_count);
+		WARN_ON_RT(irqs_disabled());
 		memset(out_buf, 0, sizeof(out_buf));
 		out_count = 0;
 	}
+#ifdef CONFIG_PREEMPT_RT
+	local_irq_disable();
+#endif
 }
 
 static void eth_putDebugChar(int chr)
--- linux-2.6.10.orig/kernel/kgdb.c
+++ linux-2.6.10/kernel/kgdb.c
@@ -85,7 +85,7 @@ struct kgdb_arch *kgdb_ops = &arch_kgdb_
 
 static const char hexchars[] = "0123456789abcdef";
 
-static spinlock_t slavecpulocks[NR_CPUS];
+static raw_spinlock_t slavecpulocks[NR_CPUS];
 static volatile int procindebug[NR_CPUS];
 atomic_t kgdb_setting_breakpoint;
 struct task_struct *kgdb_usethread, *kgdb_contthread;

-- 
Tom Rini
http://gate.crashing.org/~trini/

  reply	other threads:[~2005-06-17 19:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-14  6:42 kus Kusche Klaus
2005-06-14  7:20 ` Ingo Molnar
2005-06-17 19:23   ` Tom Rini [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-06-14  7:37 kus Kusche Klaus
2005-06-13 14:31 Serge Noiraud
2005-06-13 14:51 ` Ingo Molnar
2005-06-15  1:50 ` Lee Revell

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=20050617192341.GA4824@smtp.west.cox.net \
    --to=trini@kernel.crashing.org \
    --cc=kus@keba.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=serge.noiraud@bull.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome