Re: [PATCH 1/1] UIO: Add a write() function to enable/disableinterrupts

From: Thomas Gleixner
Date: Wed Jun 04 2008 - 03:06:29 EST


On Wed, 4 Jun 2008, Uwe Kleine-König wrote:
> Hello Hans-Jürgen,
>
> > Sometimes it is necessary to enable/disable the interrupt of a UIO device
> > from the userspace part of the driver. With this patch, the UIO kernel driver
> > can implement an "irqcontrol()" function that does this. Userspace can write
> > an s32 value to /dev/uioX (usually 0 or 1 to turn the irq off or on). The
> > UIO core will then call the driver's irqcontrol function.
> IMHO it would make sense to demand that irqcontrol() is idempotent and
> then call irqcontrol(ON) before blocking in read and poll.

We thought about that, but it is racy. Also explicit control is way
better than automagic hackery.

Thanks,
tglx