OHCI1394:sleeping function called from invalid context [need idea for fixing]
From: kernel-stuff
Date: Wed Dec 01 2004 - 00:23:44 EST
I am trying to debug a problem with the OHCI1394 module. Basically i get "sleeping function called from invalid context" in dmesg whenever I capture video from my camcorder. Looking at the stack trace - dma_pool_create is called from within IRQ handler - or so it seems. Similarly the ohci1394 module also calls dma_pool_destroy in IRQ. This happens when I connect and disconnect the camcorder.
I am thinking of ways to fix this - and have no clue so far. I fixed couple other similar but easy-to-fix ones in ohci1394.c - by changing from GFP_KERNEL to GFP_ATOMIC but this one looks more complicated - DMA Pool needs to be freed when device disconnects - how to do this outside of the IRQ? More complicated (to me of course :) is the allocaction part - driver needs a DMA pool on device connect - no idea how to get it outside of the IRQ path.
Can anyone give an idea how to go about fixing this? Normally what's the correct place for a module to call dma_pool_create/destroy?
Below is a sample stack trace -
Parry.
=======================================================
Debug: sleeping function called from invalid context at include/asm/semaphore.h:107
in_atomic():0[expected: 0], irqs_disabled():1
[<0211cbcb>] __might_sleep+0x7d/0x8a
[<02245065>] dma_pool_destroy+0x1a/0x114
[<32c1cb6a>] free_dma_rcv_ctx+0x9f/0xc8 [ohci1394]
[<32c1a649>] ohci_devctl+0x778/0x799 [ohci1394]
[<32b9f657>] hpsb_unlisten_channel+0x3b/0x3e [ieee1394]
[<32dae33b>] handle_iso_listen+0x1ab/0x268 [raw1394]
[<32db1c47>] state_connected+0xf1/0x1c7 [raw1394]
[<32db1d9b>] raw1394_write+0x7e/0x92 [raw1394]
[<02165c82>] vfs_write+0xb6/0xe2
[<02165d4c>] sys_write+0x3c/0x62
Debug: sleeping function called from invalid context at mm/slab.c:2063
in_atomic():0[expected: 0], irqs_disabled():1
[<0211cbcb>] __might_sleep+0x7d/0x8a
[<0214bc76>] kmem_cache_alloc+0x1d/0x4c
[<02244e80>] dma_pool_create+0x70/0x17e
[<021757cb>] do_lookup+0x1f/0x8f
[<32c1cd29>] alloc_dma_rcv_ctx+0x196/0x3a3 [ohci1394]
[<02154106>] handle_mm_fault+0xe4/0x21e
[<32c1a0ad>] ohci_devctl+0x1dc/0x799 [ohci1394]
[<0215222e>] follow_page_pte+0xec/0xfd
[<32b9f615>] hpsb_listen_channel+0x3f/0x46 [ieee1394]
[<32dae2ac>] handle_iso_listen+0x11c/0x268 [raw1394]
[<32db1c47>] state_connected+0xf1/0x1c7 [raw1394]
[<32db1d9b>] raw1394_write+0x7e/0x92 [raw1394]
[<02165c82>] vfs_write+0xb6/0xe2
[<02165d4c>] sys_write+0x3c/0x62
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/