Merge tag 'aspeed-5.14-devicetree-2' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / drivers / clocksource / dw_apb_timer.c
index b207a77..f5f24a9 100644 (file)
@@ -222,7 +222,8 @@ static int apbt_next_event(unsigned long delta,
 /**
  * dw_apb_clockevent_init() - use an APB timer as a clock_event_device
  *
- * @cpu:       The CPU the events will be targeted at.
+ * @cpu:       The CPU the events will be targeted at or -1 if CPU affiliation
+ *             isn't required.
  * @name:      The name used for the timer and the IRQ for it.
  * @rating:    The rating to give the timer.
  * @base:      I/O base for the timer registers.
@@ -257,7 +258,7 @@ dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
        dw_ced->ced.max_delta_ticks = 0x7fffffff;
        dw_ced->ced.min_delta_ns = clockevent_delta2ns(5000, &dw_ced->ced);
        dw_ced->ced.min_delta_ticks = 5000;
-       dw_ced->ced.cpumask = cpumask_of(cpu);
+       dw_ced->ced.cpumask = cpu < 0 ? cpu_possible_mask : cpumask_of(cpu);
        dw_ced->ced.features = CLOCK_EVT_FEAT_PERIODIC |
                                CLOCK_EVT_FEAT_ONESHOT | CLOCK_EVT_FEAT_DYNIRQ;
        dw_ced->ced.set_state_shutdown = apbt_shutdown;