From: cbouatmailru@gmail.com (Anton Vorontsov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 2/4] ARM: kgdb: Disable preemption before re-enabling interrupts
Date: Wed, 7 Jul 2010 21:13:20 +0400 [thread overview]
Message-ID: <20100707171320.GB20015@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <20100707171222.GA16448@oksana.dev.rtsoft.ru>
We have to disable preemption before enabling local IRQs because
local_irq_enable() makes it possible for the kernel to reschedule,
so the kernel might hit a breakpoint causing itself to re-enter
KGDB and die.
Signed-off-by: Anton Vorontsov <avorontsov@mvista.com>
---
arch/arm/kernel/kgdb.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c
index 5c61100..6ece654 100644
--- a/arch/arm/kernel/kgdb.c
+++ b/arch/arm/kernel/kgdb.c
@@ -167,9 +167,17 @@ static void kgdb_call_nmi_hook(void *ignored)
void kgdb_roundup_cpus(unsigned long flags)
{
+ /*
+ * We have to disable preemption before enabling local
+ * IRQs because local_irq_enable() makes it possible for
+ * the kernel to reschedule, so the kernel might hit a
+ * breakpoint causing itself to re-enter KGDB and die.
+ */
+ preempt_disable();
local_irq_enable();
smp_call_function(kgdb_call_nmi_hook, NULL, 0);
local_irq_disable();
+ preempt_enable();
}
#ifdef CONFIG_SMP
--
1.7.0.5
next prev parent reply other threads:[~2010-07-07 17:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-07 17:12 [PATCH RFC 0/4] ARM/KGDB: Some fixes for SMP machines Anton Vorontsov
2010-07-07 17:13 ` [PATCH RFC 1/4] ARM: kgdb: Must poll for IPIs during busy-waiting Anton Vorontsov
2010-07-07 17:13 ` Anton Vorontsov [this message]
2010-07-07 17:13 ` [PATCH RFC 3/4] net: Implement napi_try_disable() Anton Vorontsov
2010-07-07 17:13 ` [PATCH RFC 4/4] kgdb: Quiesce IO back-end before rounding up secondary CPUs Anton Vorontsov
2010-07-07 17:54 ` [PATCH RFC 0/4] ARM/KGDB: Some fixes for SMP machines Anton Vorontsov
2010-07-08 8:48 ` Will Deacon
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=20100707171320.GB20015@oksana.dev.rtsoft.ru \
--to=cbouatmailru@gmail.com \
--cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).