public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc-dev: stop periodic interrupts on device release
@ 2008-07-26 15:46 Tomas Janousek
  2008-07-26 17:55 ` Alessandro Zummo
  2008-07-26 20:50 ` David Brownell
  0 siblings, 2 replies; 13+ messages in thread
From: Tomas Janousek @ 2008-07-26 15:46 UTC (permalink / raw)
  To: linux-kernel, David Brownell, Alessandro Zummo

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.

Signed-off-by: Tomas Janousek <tomi@nomi.cz>
Cc: Alessandro Zummo <alessandro.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
---
 drivers/rtc/rtc-dev.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c
index 90dfa0d..6fafa62 100644
--- a/drivers/rtc/rtc-dev.c
+++ b/drivers/rtc/rtc-dev.c
@@ -408,6 +408,8 @@ static int rtc_dev_release(struct inode *inode, struct file *file)
 #ifdef CONFIG_RTC_INTF_DEV_UIE_EMUL
 	clear_uie(rtc);
 #endif
+	rtc_irq_set_state(rtc, NULL, 0);
+
 	if (rtc->ops->release)
 		rtc->ops->release(rtc->dev.parent);
 
-- 
1.5.6


-- 
Tomáš Janoušek, a.k.a. Liskni_si, http://work.lisk.in/

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-07-29 20:08 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-26 15:46 [PATCH] rtc-dev: stop periodic interrupts on device release Tomas Janousek
2008-07-26 17:55 ` Alessandro Zummo
2008-07-26 18:06   ` Tomáš Janoušek
2008-07-26 18:13     ` Alessandro Zummo
2008-07-26 19:58       ` David Brownell
2008-07-26 20:50 ` David Brownell
2008-07-27  3:03   ` Mike Frysinger
2008-07-27  5:03     ` David Brownell
2008-07-28 20:41   ` Tomáš Janoušek
2008-07-28 20:47     ` Alessandro Zummo
2008-07-28 22:05     ` David Brownell
2008-07-28 23:36       ` Tomáš Janoušek
2008-07-29 20:08         ` David Brownell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox