public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Maciej Rutecki <maciej.rutecki@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-bluetooth@vger.kernel.org, marcel@holtmann.org
Subject: Re: [2.6.29-git12] BUG: scheduling while atomic: swapper/0/0x10000100
Date: Fri, 10 Apr 2009 13:41:34 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.00.0904101329170.21577@localhost.localdomain> (raw)
In-Reply-To: <8db1092f0904100340g7b7eb310y805e8680a32e3ac8@mail.gmail.com>

On Fri, 10 Apr 2009, Maciej Rutecki wrote:

> 2009/4/10 Andrew Morton <akpm@linux-foundation.org>
> 
> > Did this get fixed?
> 
> On 2.6.30-rc1-git3 still the same:
> [  162.541793] BUG: scheduling while atomic: swapper/0/0x10000100

Yikes.	

0x10000100
       ^----- softirq count leaked.

We have a check for that in do_softirq, but none in do_IRQ. Can you
please apply the patch below and test whether it triggers ?

Thanks,

	tglx
---
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c
index c3fe010..d164396 100644
--- a/arch/x86/kernel/irq.c
+++ b/arch/x86/kernel/irq.c
@@ -206,6 +206,7 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
 	/* high bit used in ret_from_ code  */
 	unsigned vector = ~regs->orig_ax;
 	unsigned irq;
+	int prev_count = preempt_count();
 
 	exit_idle();
 	irq_enter();
@@ -225,6 +226,13 @@ unsigned int __irq_entry do_IRQ(struct pt_regs *regs)
 
 	irq_exit();
 
+	if (unlikely(prev_count != preempt_count())) {
+		printk(KERN_ERR "huh, entered interrupt %d"
+		       "with preempt_count %08x, exited with %08x?\n", irq,
+		       prev_count, preempt_count());
+		preempt_count() = prev_count;
+	}
+
 	set_irq_regs(old_regs);
 	return 1;
 }

  reply	other threads:[~2009-04-10 11:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-07  7:37 [2.6.29-git12] BUG: scheduling while atomic: swapper/0/0x10000100 Maciej Rutecki
2009-04-10  4:20 ` Andrew Morton
2009-04-10 10:40   ` Maciej Rutecki
2009-04-10 11:41     ` Thomas Gleixner [this message]
2009-04-10 14:47       ` Maciej Rutecki
2009-04-10 16:26         ` Thomas Gleixner
2009-04-10 16:52           ` Maciej Rutecki
2009-04-10 17:16             ` Thomas Gleixner
2009-04-10 17:57               ` Maciej Rutecki
2009-04-10 18:25                 ` Thomas Gleixner
2009-04-18 13:04                   ` Dave Young
2009-04-11 19:52                     ` Marcel Holtmann
2009-05-16 14:31                       ` Maciej Rutecki
2009-04-10 16:57           ` Maciej Rutecki

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=alpine.LFD.2.00.0904101329170.21577@localhost.localdomain \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.rutecki@gmail.com \
    --cc=marcel@holtmann.org \
    /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