From: Peter Zijlstra Date: Mon, 25 Sep 2006 23:24:23 +0000 (-0700) Subject: [PATCH] rtc: lockdep fix/workaround X-Git-Tag: v2.6.19-rc1~1242 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b16f21f144010aa627c58b3a33be49ebfd685dc;p=linux-2.6 [PATCH] rtc: lockdep fix/workaround BUG: warning at kernel/lockdep.c:1816/trace_hardirqs_on() (Not tainted) [] show_trace_log_lvl+0x58/0x171 [] show_trace+0xd/0x10 [] dump_stack+0x19/0x1b [] trace_hardirqs_on+0xa2/0x11e [] _spin_unlock_irq+0x22/0x26 [] rtc_get_rtc_time+0x32/0x176 [] hpet_rtc_interrupt+0x92/0x14d [] handle_IRQ_event+0x20/0x4d [] __do_IRQ+0x94/0xef [] do_IRQ+0x9e/0xbd [] common_interrupt+0x25/0x2c DWARF2 unwinder stuck at common_interrupt+0x25/0x2c Signed-off-by: Peter Zijlstra Acked-by: Ingo Molnar Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c index 6e6a7c7a7e..ab6429b4a8 100644 --- a/drivers/char/rtc.c +++ b/drivers/char/rtc.c @@ -209,11 +209,12 @@ static const unsigned char days_in_mo[] = */ static inline unsigned char rtc_is_updating(void) { + unsigned long flags; unsigned char uip; - spin_lock_irq(&rtc_lock); + spin_lock_irqsave(&rtc_lock, flags); uip = (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP); - spin_unlock_irq(&rtc_lock); + spin_unlock_irqrestore(&rtc_lock, flags); return uip; }