PCMCIA 2.5.X sleeping from illegal context

Paul Fulghum (paulkf@microgate.com)
12 May 2003 16:35:32 -0500


The 2.5.X PCMCIA kernel support seems to have a problem
with drivers/pcmcia/rsrc_mgr.c in function undo_irq().

This function is called from pcmcia_release_irq() in
drivers/pcmcia/cs.c

pcmcia_release_irq() is called by individual drivers
when releasing resources.

When a device gets a CS_EVENT_CARD_REMOVAL event from
cs.c, the device sets a timer to call the release
function defined in the device driver to release resources.
This is the convention used with all PCMCIA drivers I
can see.

The release timer function is running in a context where it
is illegal to call a sleeping function.

undo_irq() has added semaphore calls down(rsrc_sem)/up(rsrc_sem)
in 2.5.X which generates the kernel 'sleeping function called
from illegal context at include/asm/semaphore.h' message.

So, are all the PCMCIA drivers supposed to be changed to not
release resources in the timer context? And if so, what
is the new convention?

Or should the synchronization used in undo_irq() be
changed to something that is legal from a timer context.

Thanks,
Paul

-- 
Paul Fulghum, paulkf@microgate.com
Microgate Corporation, http://www.microgate.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/