Re: User mode drivers: part 1, interrupt handling (patch for 2.6.11)

From: Peter Chubb
Date: Sun Mar 13 2005 - 22:08:08 EST


>>>>> "Jon" == Jon Smirl <jonsmirl@xxxxxxxxx> writes:

Jon> On Sat, 12 Mar 2005 10:11:18 -0700 (MST), Zwane Mwaikambo
Jon> <zwane@xxxxxxxxxxxxxxxx> wrote:
>> Alan's proposal sounds very plausible and additionally if we find
>> that we have an irq line screaming we could use the same supplied
>> information to disable userspace interrupt handled devices first.

Jon> I like it too and it would help Xen. Now we just need to modify
Jon> 800 device drivers to use it.

It's incomplete. But you probably knew that...

The main problem I see is that even with the proposed interface, you'd
need to disable the interrupt in the interrupt controller, because
merely acknowledging an interrupt to a device doesn't stop it from
interrupting. And you really want the device to stop asserting the
interrupt before doing an EOI, unless you're going to mask the
interrupt. So you'd need to have an interface that not only
acknowledged the current interrupt but also prevented the device from
interrupting. That typically means reading a status register (slow!)
and then setting one or more bits in one or more control registers.

Also for a user level driver you really want to do the EIO before
invoking user space. Otherwise, depending on the interrupt
controller, lower numbered interrupts could be masked until the user
space returns --- which might be a long time off.

Reading the status register is typically one of the slowest
single parts of a device driver (latency can be > 2 usec), so you don't
really want to have to read it again within the driver... so you'd
probably want to pass it as part of the interrupt arguments to the
driver.

--
Dr Peter Chubb http://www.gelato.unsw.edu.au peterc AT gelato.unsw.edu.au
The technical we do immediately, the political takes *forever*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/