From: James Bottomley <James.Bottomley@suse.de>
To: Tedheadster <tedheadster@gmail.com>
Cc: linux-scsi@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: aha1542 oops caused by new request_irq routines
Date: Mon, 31 May 2010 09:32:44 -0500 [thread overview]
Message-ID: <1275316364.2823.22.camel@mulgrave.site> (raw)
In-Reply-To: <AANLkTilB661W9H9IPxn9TGBvv-omVnAh43r3XR5uM58m@mail.gmail.com>
On Mon, 2010-05-31 at 10:03 -0400, Tedheadster wrote:
> I'm reliably getting this oops:
>
> Configuring Adaptec (SCSI-ID 6) at IO:334, IRQ 10, DMA priority 6
> BUG: sleeping function called from invalid context at mm/slub.c:1598
> in_atomic(): 0, irqs_disabled(): 1, pid: 4782, name: modprobe
> Pid: 4782, comm: modprobe Not tainted 2.6.30.10-105.2.23.RODATA.fc11.i586 #1
> Call Trace:
> [<c0469e58>] ? request_threaded_irq+0x85/0x145
> [<c0422ab7>] __might_sleep+0xc4/0xc9
> [<c04a4322>] kmem_cache_alloc_notrace+0x29/0xb0
> [<c0469e58>] request_threaded_irq+0x85/0x145
> [<d086439c>] ? do_aha1542_intr_handle+0x0/0x2be [aha1542]
> [<d08696aa>] aha1542_detect+0x631/0x76f [aha1542]
> [<d0869841>] init_this_scsi_driver+0x59/0xc7 [aha1542]
> [<d08697e8>] ? init_this_scsi_driver+0x0/0xc7 [aha1542]
> [<c040114b>] do_one_initcall+0x51/0x13f
> [<c0451111>] sys_init_module+0x8b/0x192
> [<c0403535>] syscall_call+0x7/0xb
> scsi5 : Adaptec 1542
So this one's a bit tricky. aha1542 uses a global spinlock to give it
thread safety and various other things. In this case it's trying to use
the lock to hold off the interrupt until everything is set up.
Now that we're doing a GFP_KERNEL allocation in the interrupt handler
code you can't disable interrupts while calling request_irq since this
is an old card liable to spurious interrupts as it gets poked in setup.
I think a possible solution is this, since the mere act of installing an
interrupt handler shouldn't trigger the problem.
However, I thought the pattern of disabling interrupts and setting up
the handler and registers was a common one ... is there some way this is
supposed to work now that doesn't involve altering the drivers?
James
---
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c
index 2a8cf13..0852079 100644
--- a/drivers/scsi/aha1542.c
+++ b/drivers/scsi/aha1542.c
@@ -1190,13 +1190,12 @@ fail:
DEB(aha1542_stat());
DEB(printk("aha1542_detect: enable interrupt channel %d\n", irq_level));
- spin_lock_irqsave(&aha1542_lock, flags);
if (request_irq(irq_level, do_aha1542_intr_handle, 0,
"aha1542", shpnt)) {
printk(KERN_ERR "Unable to allocate IRQ for adaptec controller.\n");
- spin_unlock_irqrestore(&aha1542_lock, flags);
goto unregister;
}
+ spin_lock_irqsave(&aha1542_lock, flags);
if (dma_chan != 0xFF) {
if (request_dma(dma_chan, "aha1542")) {
printk(KERN_ERR "Unable to allocate DMA channel for Adaptec.\n");
next prev parent reply other threads:[~2010-05-31 14:32 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 14:03 aha1542 oops Tedheadster
2010-05-31 14:32 ` James Bottomley [this message]
2010-05-31 15:22 ` aha1542 oops caused by new request_irq routines Tedheadster
2010-05-31 16:43 ` Thomas Gleixner
2010-05-31 16:59 ` James Bottomley
2010-05-31 17:19 ` Thomas Gleixner
2010-05-31 17:30 ` James Bottomley
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=1275316364.2823.22.camel@mulgrave.site \
--to=james.bottomley@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=tedheadster@gmail.com \
--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 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).