Browse Source

[PATCH] get_cmos_time() locking fix (lockdep)

rtc_lock is supposed to be irq-safe.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrew Morton 19 years ago
parent
commit
7ba1c6c88c
1 changed files with 3 additions and 2 deletions
  1. 3 2
      arch/i386/kernel/time.c

+ 3 - 2
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 get_cmos_time(void)
 {
 {
 	unsigned long retval;
 	unsigned long retval;
+	unsigned long flags;
 
 
-	spin_lock(&rtc_lock);
+	spin_lock_irqsave(&rtc_lock, flags);
 
 
 	if (efi_enabled)
 	if (efi_enabled)
 		retval = efi_get_time();
 		retval = efi_get_time();
 	else
 	else
 		retval = mach_get_cmos_time();
 		retval = mach_get_cmos_time();
 
 
-	spin_unlock(&rtc_lock);
+	spin_unlock_irqrestore(&rtc_lock, flags);
 
 
 	return retval;
 	return retval;
 }
 }