Re: 2.5.69+bk: "sleeping function called from illegal context" on

Paul Fulghum (paulkf@microgate.com)
13 May 2003 12:28:11 -0500


On Tue, 2003-05-13 at 12:21, Alex Riesen wrote:
> Paul Fulghum, Tue, May 13, 2003 17:31:01 +0200:
> > Similar to this patch for synclink_cs.c:
> ...
> > - mod_timer(&link->release, jiffies + HZ/20);
> > + mgslpc_release((u_long)link);
>
> Tried that. This time the trace looks different:
>
> Debug: sleeping function called from illegal context at include/asm/semaphore.h:119
> Call Trace:
> [<c0118bc8>] __might_sleep+0x58/0x70
> [<c6a31eb6>] +0x82/0x58c [pcmcia_core]
> [<c6a2d193>] undo_irq+0x23/0x90 [pcmcia_core]
> [<c6a31eb6>] +0x82/0x58c [pcmcia_core]
> [<c6a302f8>] pcmcia_release_irq+0xb8/0xe0 [pcmcia_core]
> [<c6a25e00>] pcnet_release+0x0/0x80 [pcnet_cs]
> [<c6a312d5>] CardServices+0x155/0x260 [pcmcia_core]
> [<c6a312c9>] CardServices+0x149/0x260 [pcmcia_core]
> [<c6a25e56>] pcnet_release+0x56/0x80 [pcnet_cs]
> [<c01224a4>] run_timer_softirq+0xc4/0x1a0
> [<c010a8b3>] handle_IRQ_event+0x33/0xf0
> [<c011e889>] do_softirq+0xa9/0xb0
> [<c010abb5>] do_IRQ+0x125/0x150
> [<c01093a8>] common_interrupt+0x18/0x20

Hmmm... the pcnet_release() function is still being called
from a timer context.

Looking at pcnet_cs.c I see that in function pcnet_close()
that the release function is being being run from
a timer. Try changing that instance to calling pcnet_release()
directly as you did in the CS_EVENT handler.

-- 
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/