[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cdi-devel] Interrupts



Hi all,

I'm currently implementing CDI for a small monolithic kernel. Besides
getting drivers, my goal in doing so is to find pontential problems with
CDI. I think with interrupt handling I've found a first thing that needs
clarification on what drivers can expect. In particular, I remember
Matt's change to pcnet to use cdi_wait_irq instead of doing it manually.

So the question is: Has pcnet ever been right in doing it manually? Was
it just ugly or was it wrong?

The point is that currently in my kernel CDI drivers generally run with
IRQs turned off as the kernel lacks proper locking, so I'm not sure what
would happen if I would allow IRQs in any place (or even let it be
preempted). So pcnet would wait forever for an IRQ to happen.

We should clarify who would be right in this scenario: The kernel or
pcnet? Basically I'd say it is reasonable to define that CDI drivers may
not assume that they can receive IRQs while running another function.
The only exception is when using cdi_wait_irq. If you prefer we could
define instead that OSes must always allow IRQs (in the long run you
need to make the drivers preemptible anyway).

What do you think? Do all other OSes implementing CDI so far allow IRQs
at any time or does it just happen to work? (I think meanwhile all
drivers are well-behaved and don't do it manually)

Kevin