linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* pmf_register_irq_client gives sleep with locks held warning
@ 2006-05-30 20:19 Johannes Berg
  2006-06-01  0:59 ` Benjamin Herrenschmidt
  0 siblings, 1 reply; 9+ messages in thread
From: Johannes Berg @ 2006-05-30 20:19 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list

[-- 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 --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2006-06-13 16:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-30 20:19 pmf_register_irq_client gives sleep with locks held warning Johannes Berg
2006-06-01  0:59 ` 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

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