[lkml]   [2007]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch 24/29] x86: fix freeze in x86_64 RTC update code in time_64.c
2.6.23-stable review patch.  If anyone has any objections, please let us

From: David P. Reed <>

patch c399da0d97e06803e51085ec076b63a3168aad1b in mainline.

x86: fix freeze in x86_64 RTC update code in time_64.c

Fix hard freeze on x86_64 when the ntpd service calls

A repeatable but randomly timed freeze has been happening in Fedora 6
and 7 for the last year, whenever I run the ntpd service on my AMD64x2
HP Pavilion dv9000z laptop. This freeze is due to the use of
spin_lock(&rtc_lock) under the assumption (per a bad comment) that
set_rtc_mmss is called only with interrupts disabled. The call from
ntp.c to update_persistent_clock is made with interrupts enabled.

[ ported to 2.6.23.stable ]

Signed-off-by: David P. Reed <>
Signed-off-by: Thomas Gleixner <>
Signed-off-by: Ingo Molnar <>
Signed-off-by: Greg Kroah-Hartman <>

arch/x86_64/kernel/time.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)

--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -87,18 +87,15 @@ static int set_rtc_mmss(unsigned long no
int retval = 0;
int real_seconds, real_minutes, cmos_minutes;
unsigned char control, freq_select;
+ unsigned long flags;

- * IRQs are disabled when we're called from the timer interrupt,
- * no need for spin_lock_irqsave()
+ * set_rtc_mmss is called when irqs are enabled, so disable irqs here
- spin_lock(&rtc_lock);
+ spin_lock_irqsave(&rtc_lock, flags);
* Tell the clock it's being set and stop it.

@@ -143,7 +140,7 @@ static int set_rtc_mmss(unsigned long no

- spin_unlock(&rtc_lock);
+ spin_unlock_irqrestore(&rtc_lock, flags);

return retval;
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-11-20 19:39    [W:0.112 / U:13.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site