diff options
author | Atsushi Nemoto <anemo@mba.ocn.ne.jp> | 2009-06-18 19:49:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-19 19:46:05 -0400 |
commit | e6229bec25be4ba00f31dd26e25721cc96c22262 (patch) | |
tree | a27e4c51dd8b9aaeb589a147a22bbd06bde77cf0 /drivers/rtc/rtc-dev.c | |
parent | 575c5807f6842422e9fe2432fd48dfcc1d7aef41 (diff) |
rtc: make rtc_update_irq callable with irqs enabled
The rtc_update_irq() might be called with irqs enabled, if a interrupt
handler was registered without IRQF_DISABLED. Use
spin_lock_irqsave/spin_unlock_irqrestore instead of spin_lock/spin_unlock.
Also update kerneldoc and drivers which do extra work to follow the
current interface spec, as suggestted by David Brownell.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-dev.c')
-rw-r--r-- | drivers/rtc/rtc-dev.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 45152f4952d6..8a11de9552cd 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -60,8 +60,7 @@ static void rtc_uie_task(struct work_struct *work) | |||
60 | 60 | ||
61 | err = rtc_read_time(rtc, &tm); | 61 | err = rtc_read_time(rtc, &tm); |
62 | 62 | ||
63 | local_irq_disable(); | 63 | spin_lock_irq(&rtc->irq_lock); |
64 | spin_lock(&rtc->irq_lock); | ||
65 | if (rtc->stop_uie_polling || err) { | 64 | if (rtc->stop_uie_polling || err) { |
66 | rtc->uie_task_active = 0; | 65 | rtc->uie_task_active = 0; |
67 | } else if (rtc->oldsecs != tm.tm_sec) { | 66 | } else if (rtc->oldsecs != tm.tm_sec) { |
@@ -74,10 +73,9 @@ static void rtc_uie_task(struct work_struct *work) | |||
74 | } else if (schedule_work(&rtc->uie_task) == 0) { | 73 | } else if (schedule_work(&rtc->uie_task) == 0) { |
75 | rtc->uie_task_active = 0; | 74 | rtc->uie_task_active = 0; |
76 | } | 75 | } |
77 | spin_unlock(&rtc->irq_lock); | 76 | spin_unlock_irq(&rtc->irq_lock); |
78 | if (num) | 77 | if (num) |
79 | rtc_update_irq(rtc, num, RTC_UF | RTC_IRQF); | 78 | rtc_update_irq(rtc, num, RTC_UF | RTC_IRQF); |
80 | local_irq_enable(); | ||
81 | } | 79 | } |
82 | static void rtc_uie_timer(unsigned long data) | 80 | static void rtc_uie_timer(unsigned long data) |
83 | { | 81 | { |