linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -rt] powerpc/qeic: fix sleeping in atomic context
@ 2008-08-26 17:58 Anton Vorontsov
  0 siblings, 0 replies; only message in thread
From: Anton Vorontsov @ 2008-08-26 17:58 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner
  Cc: linuxppc-dev, Daniel Walker, Timur Tabi, linux-kernel

Cascade interrupts do not use threads, thus handlers are called
with interrupts disabled. This means that we must not grab regular
spinlocks, since they might sleep:

BUG: sleeping function called from invalid context swapper(0) at kernel/rtmutex.c:743
in_atomic():1 [00010002], irqs_disabled():1
Call Trace:
[c0353e00] [c0008a04] show_stack+0x4c/0x1ac (unreliable)
[c0353e40] [c001ca18] __might_sleep+0xc0/0x108
[c0353e50] [c0254218] __rt_spin_lock+0x30/0xa0
[c0353e60] [c0018238] qe_ic_mask_irq+0x58/0xc4
[c0353e80] [c0057bc8] handle_level_irq+0x40/0x178
[c0353ea0] [c001a5c0] qe_ic_cascade_low_ipic+0x50/0x68
[c0353eb0] [c00066d0] do_IRQ+0x9c/0xc0
[c0353ec0] [c001167c] ret_from_except+0x0/0x14
--- Exception: 501 at cpu_idle+0xa0/0x104
    LR = cpu_idle+0xa0/0x104
[c0353f80] [c0009b5c] cpu_idle+0x50/0x104 (unreliable)
[c0353fa0] [c0256088] _etext+0x88/0x9c
[c0353fc0] [c0304af8] start_kernel+0x1c4/0x244
[c0353ff0] [00003438] 0x3438

To fix the issue we should use raw spin lock.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---

Note, the patch is for -rt tree only.

 arch/powerpc/sysdev/qe_lib/qe_ic.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index f59444d..a30169c 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -33,7 +33,7 @@
 
 #include "qe_ic.h"
 
-static DEFINE_SPINLOCK(qe_ic_lock);
+static DEFINE_RAW_SPINLOCK(qe_ic_lock);
 
 static struct qe_ic_info qe_ic_info[] = {
 	[1] = {
-- 
1.5.6.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-08-26 17:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-26 17:58 [PATCH -rt] powerpc/qeic: fix sleeping in atomic context Anton Vorontsov

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