pci_insert_device called from interrupt context in cb_alloc

From: Tobias Ringström (zajbot@goteborg.utfors.se)
Date: Sat Jul 15 2000 - 06:37:36 EST


Hi!

(regarding linux-2.4-test*)

The function pci_insert_device is called from interrupt context in
cb_alloc. This leads to problems because this makes the PCI device
probe function get called from interrupt context, which contradicts
the description in Documentation/pci.txt. This does indeed cause
problems when init_netdev is called from int context later.

Martin, should pci.c have a kernel thread that calls the probe
functions, thus allowing pci_insert_device to be called from interrupt
context, or is it forbidden to call pci_insert_device from interrupt
context. If so, I think "if (in_interrupt()) BUG();" should be added
to avoid confusion. A comment in pci.txt would also be nice.

The situation at hand is a bit weird because when the yenta driver
queues interrupts, and uses a kernel thread to handle the interrupts
in kernel context. Unfortunally, the pcmcia code uses timers that take
us back to interrupt context before cb_alloc is called.

I made a patch that changed the pcmcia code to operate in kernel
context a while ago, using schedule_timeout instead of timers, but I
did not release it since it required changes to the non-yenta drivers,
and I did not have time to change them.

Dave, would this last change be good or bad in your opinion?

/Tobias

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



This archive was generated by hypermail 2b29 : Sat Jul 15 2000 - 21:00:21 EST