From: Andrew Morton Date: Mon, 10 Jul 2006 11:44:59 +0000 (-0700) Subject: [PATCH] get_cmos_time() locking fix (lockdep) X-Git-Tag: v2.6.18-rc2~173 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ba1c6c88c945b065a75094830f6b76f414e42ad;p=linux-2.6 [PATCH] get_cmos_time() locking fix (lockdep) rtc_lock is supposed to be irq-safe. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/arch/i386/kernel/time.c b/arch/i386/kernel/time.c index 316421a7f5..8705c0f057 100644 --- a/arch/i386/kernel/time.c +++ b/arch/i386/kernel/time.c @@ -206,15 +206,16 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) unsigned long get_cmos_time(void) { unsigned long retval; + unsigned long flags; - spin_lock(&rtc_lock); + spin_lock_irqsave(&rtc_lock, flags); if (efi_enabled) retval = efi_get_time(); else retval = mach_get_cmos_time(); - spin_unlock(&rtc_lock); + spin_unlock_irqrestore(&rtc_lock, flags); return retval; }