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

Alessandro Zummo
2008-07-26T17:55:34Z

On Sat, 26 Jul 2008 16:46:17 +0100
Tomas Janousek <tomi@nomi.cz> 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