On Fri Feb 11, 2005 at 20:05:31 +0100, Cedric Roux wrote:
ethernet card (ne2k-pci) sends an IRQ (number 9). The IRQ thread passes wait_for_irq_message_hw then calls do_IRQ. do_IRQ does its stuff, then calls irq_exit.
In irq_exit, we have a softirq pending (don't ask me why, that's just the way it is), so we call do_softirq.
We then enter net_tx_action.
I then pass the details. To be short, we enter the TCP/IP stack, do some stuff, then go back into the ethernet driver code, in ei_start_xmit (8390.c).
This function calls disable_irq_nosync, which calls desc->handler->disable, which is in fact do_l4lx_irq_dev_disable.
This one will call switch_to_irq_idle_loop.
I don't exactly know what happens next (lack of time), but if I remove the call to switch_to_irq_idle_loop (and of course the corresponding call to switch_to_irq_thread) in do_l4lx_irq_dev_disable (respectively do_l4lx_irq_dev_enable) everything works fine (well, I don't get crashes when I do my telnet anymore).
Thanks for this ample explanation.
My questions are: 1 - why to call this switch_to_irq_idle_loop? what's the purpose of it?
The purpose is to prevent that interrupts get through. The tricky part here has been IRQ probing. I guess I need to reevaluate this issue...
2 - if I remove this call, do I get a wrong system or is it ok? what do I lose if it is ok (speed?)?
Should be ok if it works on your system.
3 - a comment in switch_to_irq_idle_loop says: /* Looks like interrupts are disabled multiple times in 2.6 */ shouldn't you use a counter in switch_to_irq_thread and only do the switch if it's back to zero? (I mean, imagine 2 calls to switch_to_irq_idle_loop followed by 1 call to switch_to_irq_thread, should it really come back from idle at this point?)
That's not what I would expect from the hardware, disable just disables it, no matter how ofter you do it.
(By the way, the l4linux kernel won't compile with 4k stacks,
It compiled for me as of today but I had to fix some small issues to make it actually work (but I only tested this slightly). Should hit CVS by tomorrow.
you never call irq_ctx_init, maybe you should call it in init_IRQ?)
No, l4linux has always worked more like the 4k-IRQ way, not as the old way in 8k-stacks.
Adam