Skip to content

Commit

Permalink
clockevents: Handle empty cpumask gracefully
Browse files Browse the repository at this point in the history
For UP it's stupid to request an initialized cpumask for the clock
event devices. Though we need the mask set even on UP to avoid a
horrible ifdeffery especially in the broadcast code.

For SMP we can at least try to survive with a warning and set the
cpumask of the cpu we're running on. That gives a decent chance to
bring the machine up and retrieve the debug info.

Signed-off-by: Thomas Gleixner <[email protected]>
Cc: Linus Walleij <[email protected]
Cc: Lee Jones <[email protected]>
Cc: Russell King - ARM Linux <[email protected]>
Cc: Stephen Boyd <[email protected]>
  • Loading branch information
KAGA-KOKO committed Jun 3, 2011
1 parent 1fa7b6a commit 1b054b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion kernel/time/clockevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ void clockevents_register_device(struct clock_event_device *dev)
unsigned long flags;

BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED);
BUG_ON(!dev->cpumask);
if (!dev->cpumask) {
WARN_ON(num_possible_cpus() > 1);
dev->cpumask = cpumask_of(smp_processor_id());
}

raw_spin_lock_irqsave(&clockevents_lock, flags);

Expand Down

0 comments on commit 1b054b6

Please sign in to comment.