Re: [PATCH] rtc-dev: stop periodic interrupts on device release

From: Alessandro Zummo
Date: Sat Jul 26 2008 - 13:55:35 EST


On Sat, 26 Jul 2008 16:46:17 +0100
Tomas Janousek <tomi@xxxxxxx> wrote:

> Solves http://bugzilla.kernel.org/show_bug.cgi?id=11127
>
> The old rtc.c driver did it, some drivers (like rtc-sh) do it in their release
> function too, but rtc-cmos does not -- because it provides the irq_set_state
> op -- so the rtc framework itself should care about it. This patch makes it do
> so.
>
> I am aware that some drivers, like rtc-sh, handle userspace PIE sets in their
> ioctl op, exporting the irq_set_state op at the same time. The logic in
> rtc_irq_set_state should make sure it doesn't matter and the driver should not
> need to care stopping periodic interrupts in its release routine any more.
> I did not look at other drivers though.

I'm not sure this is appropriate. sometimes the PIE is used to control
external hardware and it doesn't make sense to have an application that's
always open to handle that.

Any app should be responsible to release what it has allocated, if appropriate,
and not rely on someone else to do on his behalf.


--

Best regards,

Alessandro Zummo,
Tower Technologies - Torino, Italy

http://www.towertech.it

--
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/