Commit 1150ea69 authored by Yanmin Zhang's avatar Yanmin Zhang Committed by Linus Torvalds

[PATCH] interrupt is enabled before it should be when kernel is booted

There is a minor problem in function start_kernel.  start_kernel will
enable interrupt after calling profile_init.  However, before that,
function time_init on IA64 platform could enable interrupt.  See this call
sequence:

  start_kernel
  ->time_init
    ->ia64_init_itm
      ->register_time_interpolator
        ->write_seqlock_irq.
Signed-off-by: default avatarZhang Yanmin <yanmin.zhang@intel.com>
Signed-off-by: default avatarYao Jun <junx.yao@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4d731857
...@@ -1448,11 +1448,13 @@ is_better_time_interpolator(struct time_interpolator *new) ...@@ -1448,11 +1448,13 @@ is_better_time_interpolator(struct time_interpolator *new)
void void
register_time_interpolator(struct time_interpolator *ti) register_time_interpolator(struct time_interpolator *ti)
{ {
unsigned long flags;
spin_lock(&time_interpolator_lock); spin_lock(&time_interpolator_lock);
write_seqlock_irq(&xtime_lock); write_seqlock_irqsave(&xtime_lock, flags);
if (is_better_time_interpolator(ti)) if (is_better_time_interpolator(ti))
time_interpolator = ti; time_interpolator = ti;
write_sequnlock_irq(&xtime_lock); write_sequnlock_irqrestore(&xtime_lock, flags);
ti->next = time_interpolator_list; ti->next = time_interpolator_list;
time_interpolator_list = ti; time_interpolator_list = ti;
...@@ -1463,6 +1465,7 @@ void ...@@ -1463,6 +1465,7 @@ void
unregister_time_interpolator(struct time_interpolator *ti) unregister_time_interpolator(struct time_interpolator *ti)
{ {
struct time_interpolator *curr, **prev; struct time_interpolator *curr, **prev;
unsigned long flags;
spin_lock(&time_interpolator_lock); spin_lock(&time_interpolator_lock);
prev = &time_interpolator_list; prev = &time_interpolator_list;
...@@ -1474,7 +1477,7 @@ unregister_time_interpolator(struct time_interpolator *ti) ...@@ -1474,7 +1477,7 @@ unregister_time_interpolator(struct time_interpolator *ti)
prev = &curr->next; prev = &curr->next;
} }
write_seqlock_irq(&xtime_lock); write_seqlock_irqsave(&xtime_lock, flags);
if (ti == time_interpolator) { if (ti == time_interpolator) {
/* we lost the best time-interpolator: */ /* we lost the best time-interpolator: */
time_interpolator = NULL; time_interpolator = NULL;
...@@ -1483,7 +1486,7 @@ unregister_time_interpolator(struct time_interpolator *ti) ...@@ -1483,7 +1486,7 @@ unregister_time_interpolator(struct time_interpolator *ti)
if (is_better_time_interpolator(curr)) if (is_better_time_interpolator(curr))
time_interpolator = curr; time_interpolator = curr;
} }
write_sequnlock_irq(&xtime_lock); write_sequnlock_irqrestore(&xtime_lock, flags);
spin_unlock(&time_interpolator_lock); spin_unlock(&time_interpolator_lock);
} }
#endif /* CONFIG_TIME_INTERPOLATION */ #endif /* CONFIG_TIME_INTERPOLATION */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment