Skip to content

Commit fbfa926

Browse files
sudeep-hollaKAGA-KOKO
authored andcommitted
clockevents: Warn if cpu_all_mask is used as cpumask
Using cpu_all_mask in clockevents cpumask may result in issues while comparing multiple clockevent devices to choose the preferred one. On one of the platforms with 2 system (i.e. non per-CPU) timers with different ratings, having cpu_all_mask for one of the device resulted in a boot hang due to a endless loop in clockevents_notify_released() as both were clocksources were selected as preferred. In order to prevent such issues in the future, warn if any clockevent driver sets cpu_all_mask as it's cpumask and just override it to use cpu_possible_mask. All the existing occurrences of cpu_all_mask are already replaced with cpu_possible_mask. Signed-off-by: Sudeep Holla <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected]
1 parent 234b384 commit fbfa926

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/time/clockevents.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ void clockevents_register_device(struct clock_event_device *dev)
463463
dev->cpumask = cpumask_of(smp_processor_id());
464464
}
465465

466+
if (dev->cpumask == cpu_all_mask) {
467+
WARN(1, "%s cpumask == cpu_all_mask, using cpu_possible_mask instead\n",
468+
dev->name);
469+
dev->cpumask = cpu_possible_mask;
470+
}
471+
466472
raw_spin_lock_irqsave(&clockevents_lock, flags);
467473

468474
list_add(&dev->list, &clockevent_devices);

0 commit comments

Comments
 (0)