linux/drivers/rtc
Tomas Janousek 5cdc98b8f5 rtc-dev: stop periodic interrupts on device release
Solves http://bugzilla.kernel.org/show_bug.cgi?id=11127

The old rtc.c driver did it and some drivers (like rtc-sh) do it in their
release function, though they should not -- because they should provide
the irq_set_state op and 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 (instead of having the framework call the 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.

The correct way, in my opinion, should be this:
1) The driver provides the irq_set_state op and does not care closing the
   interrupts in its release op.
2) If the driver does not provide the op and handles PIE in the ioctl op, it's
   reponsible for closing them in its release op.
3) Something similar for other IRQs, like UIE -- if there's no in-kernel API
   like irq_set_state, handle it in ioctl and release ops. The framework will
   be responsible either for everything or for nothing. (This will probably
   change later.)

Signed-off-by: Tomas Janousek <tomi@nomi.cz>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-30 09:41:47 -07:00
..
class.c
hctosys.c
interface.c
Kconfig
Makefile
rtc-at32ap700x.c
rtc-at91rm9200.c
rtc-at91sam9.c
rtc-bfin.c
rtc-cmos.c
rtc-core.h
rtc-dev.c
rtc-ds1216.c
rtc-ds1302.c
rtc-ds1305.c
rtc-ds1307.c
rtc-ds1374.c
rtc-ds1511.c
rtc-ds1553.c
rtc-ds1672.c
rtc-ds1742.c
rtc-ep93xx.c
rtc-fm3130.c
rtc-isl1208.c
rtc-lib.c
rtc-m41t80.c
rtc-m41t94.c
rtc-m48t59.c
rtc-m48t86.c
rtc-max6900.c
rtc-max6902.c
rtc-omap.c
rtc-pcf8563.c
rtc-pcf8583.c
rtc-pl030.c
rtc-pl031.c
rtc-ppc.c
rtc-proc.c
rtc-r9701.c
rtc-rs5c313.c
rtc-rs5c348.c
rtc-rs5c372.c
rtc-s3c.c
rtc-s35390a.c
rtc-sa1100.c
rtc-sh.c
rtc-stk17ta8.c
rtc-sysfs.c
rtc-test.c
rtc-v3020.c
rtc-vr41xx.c
rtc-x1205.c