Guest User

Untitled

a guest
Nov 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.07 KB | None | 0 0
  1. --- a/kernel/time/tick-broadcast.c
  2. +++ b/kernel/time/tick-broadcast.c
  3. @@ -523,10 +523,11 @@ static void tick_broadcast_init_next_event(struct cpumask *mask,
  4.   */
  5.  void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
  6.  {
  7. +   int cpu = smp_processor_id();
  8. +
  9.     /* Set it up only once ! */
  10.     if (bc->event_handler != tick_handle_oneshot_broadcast) {
  11.         int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC;
  12. -       int cpu = smp_processor_id();
  13.  
  14.         bc->event_handler = tick_handle_oneshot_broadcast;
  15.         clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
  16. @@ -552,6 +553,15 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
  17.             tick_broadcast_set_event(tick_next_period, 1);
  18.         } else
  19.             bc->next_event.tv64 = KTIME_MAX;
  20. +   } else {
  21. +       /*
  22. +        * The first cpu which switches to oneshot mode sets
  23. +        * the bit for all other cpus which are in the general
  24. +        * (periodic) broadcast mask. So the bit is set and
  25. +        * would prevent the first broadcast enter after this
  26. +        * to program the bc device.
  27. +        */
  28. +       tick_broadcast_clear_oneshot(cpu);
  29.     }
  30.  }
Add Comment
Please, Sign In to add comment