From: Johannes Berg <johannes@sipsolutions.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>
Subject: pmf_register_irq_client gives sleep with locks held warning
Date: Tue, 30 May 2006 22:19:00 +0200 [thread overview]
Message-ID: <1149020341.5128.7.camel@johannes> (raw)
[-- Attachment #1: Type: text/plain, Size: 1167 bytes --]
Hi,
When testing headphone detection stuff I got this:
[ 634.218762] BUG: sleeping function called from invalid context at mm/slab.c:2794
[ 634.218774] in_atomic():0, irqs_disabled():1
[ 634.218777] Call Trace:
[ 634.218779] [D67ADC00] [C00085F8] show_stack+0x50/0x190 (unreliable)
[ 634.218794] [D67ADC30] [C0024030] __might_sleep+0xcc/0xe8
[ 634.218804] [D67ADC40] [C0076C04] __kmalloc+0xf4/0xf8
[ 634.218815] [D67ADC60] [C00B37D4] proc_create+0x9c/0xe8
[ 634.218827] [D67ADC90] [C00B3930] proc_mkdir_mode+0x2c/0x88
[ 634.218833] [D67ADCB0] [C005227C] register_handler_proc+0xe4/0xfc
[ 634.218844] [D67ADD50] [C0051D70] setup_irq+0x118/0x16c
[ 634.218850] [D67ADD70] [C0051E68] request_irq+0xa4/0xb8
[ 634.218855] [D67ADDA0] [C0020BA0] macio_do_gpio_irq_enable+0x40/0x50
[ 634.218860] [D67ADDB0] [C00208BC] pmf_register_irq_client+0x88/0x9c
[..., not important]
The problem obviously is that request_irq via setup_irq and ... may
sleep via kmalloc, while pmf_register_irq_client spin_lock_irqsave()s
around the call.
The solution is probably to use spin_lock() instead of
spin_lock_irqsave() here.
Comments?
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
next reply other threads:[~2006-05-31 9:12 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-30 20:19 Johannes Berg [this message]
2006-06-01 0:59 ` pmf_register_irq_client gives sleep with locks held warning Benjamin Herrenschmidt
2006-06-08 18:58 ` Johannes Berg
2006-06-10 0:03 ` Benjamin Herrenschmidt
2006-06-10 9:27 ` Johannes Berg
2006-06-10 22:04 ` Benjamin Herrenschmidt
2006-06-13 8:43 ` Johannes Berg
2006-06-13 9:58 ` Benjamin Herrenschmidt
2006-06-13 15:43 ` [PATCH] make pmf irq_client functions safe against pmf interrupts coming in Johannes Berg
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=1149020341.5128.7.camel@johannes \
--to=johannes@sipsolutions.net \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.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).