Lines Matching full:bc
38 static void tick_broadcast_setup_oneshot(struct clock_event_device *bc, bool from_periodic);
40 static void tick_resume_broadcast_oneshot(struct clock_event_device *bc);
46 tick_broadcast_setup_oneshot(struct clock_event_device *bc, bool from_periodic) { BUG(); } in tick_broadcast_setup_oneshot() argument
48 static inline void tick_resume_broadcast_oneshot(struct clock_event_device *bc) { } in tick_resume_broadcast_oneshot() argument
77 static void tick_broadcast_start_periodic(struct clock_event_device *bc) in tick_broadcast_start_periodic() argument
79 if (bc) in tick_broadcast_start_periodic()
80 tick_setup_periodic(bc, 1); in tick_broadcast_start_periodic()
249 struct clock_event_device *bc = tick_broadcast_device.evtdev; in tick_device_uses_broadcast() local
266 tick_broadcast_start_periodic(bc); in tick_device_uses_broadcast()
268 tick_broadcast_setup_oneshot(bc, false); in tick_device_uses_broadcast()
307 if (cpumask_empty(tick_broadcast_mask) && bc) in tick_device_uses_broadcast()
308 clockevents_shutdown(bc); in tick_device_uses_broadcast()
317 if (bc && !(bc->features & CLOCK_EVT_FEAT_HRTIMER)) in tick_device_uses_broadcast()
356 struct clock_event_device *bc = tick_broadcast_device.evtdev; in tick_do_broadcast() local
371 local = !(bc->features & CLOCK_EVT_FEAT_HRTIMER); in tick_do_broadcast()
440 struct clock_event_device *bc, *dev; in tick_broadcast_control() local
460 bc = tick_broadcast_device.evtdev; in tick_broadcast_control()
478 if (bc && !(bc->features & CLOCK_EVT_FEAT_HRTIMER) && in tick_broadcast_control()
496 if (bc) { in tick_broadcast_control()
499 clockevents_shutdown(bc); in tick_broadcast_control()
502 tick_broadcast_start_periodic(bc); in tick_broadcast_control()
504 tick_broadcast_setup_oneshot(bc, false); in tick_broadcast_control()
526 struct clock_event_device *bc = tick_broadcast_device.evtdev; in tick_shutdown_broadcast() local
529 if (bc && cpumask_empty(tick_broadcast_mask)) in tick_shutdown_broadcast()
530 clockevents_shutdown(bc); in tick_shutdown_broadcast()
551 struct clock_event_device *bc; in tick_suspend_broadcast() local
556 bc = tick_broadcast_device.evtdev; in tick_suspend_broadcast()
557 if (bc) in tick_suspend_broadcast()
558 clockevents_shutdown(bc); in tick_suspend_broadcast()
581 struct clock_event_device *bc; in tick_resume_broadcast() local
586 bc = tick_broadcast_device.evtdev; in tick_resume_broadcast()
588 if (bc) { in tick_resume_broadcast()
589 clockevents_tick_resume(bc); in tick_resume_broadcast()
594 tick_broadcast_start_periodic(bc); in tick_resume_broadcast()
598 tick_resume_broadcast_oneshot(bc); in tick_resume_broadcast()
638 static void tick_broadcast_set_affinity(struct clock_event_device *bc, in tick_broadcast_set_affinity() argument
641 if (!(bc->features & CLOCK_EVT_FEAT_DYNIRQ)) in tick_broadcast_set_affinity()
644 if (cpumask_equal(bc->cpumask, cpumask)) in tick_broadcast_set_affinity()
647 bc->cpumask = cpumask; in tick_broadcast_set_affinity()
648 irq_set_affinity(bc->irq, bc->cpumask); in tick_broadcast_set_affinity()
651 static void tick_broadcast_set_event(struct clock_event_device *bc, int cpu, in tick_broadcast_set_event() argument
654 if (!clockevent_state_oneshot(bc)) in tick_broadcast_set_event()
655 clockevents_switch_state(bc, CLOCK_EVT_STATE_ONESHOT); in tick_broadcast_set_event()
657 clockevents_program_event(bc, expires, 1); in tick_broadcast_set_event()
658 tick_broadcast_set_affinity(bc, cpumask_of(cpu)); in tick_broadcast_set_event()
661 static void tick_resume_broadcast_oneshot(struct clock_event_device *bc) in tick_resume_broadcast_oneshot() argument
663 clockevents_switch_state(bc, CLOCK_EVT_STATE_ONESHOT); in tick_resume_broadcast_oneshot()
770 static int broadcast_needs_cpu(struct clock_event_device *bc, int cpu) in broadcast_needs_cpu() argument
772 if (!(bc->features & CLOCK_EVT_FEAT_HRTIMER)) in broadcast_needs_cpu()
774 if (bc->next_event == KTIME_MAX) in broadcast_needs_cpu()
776 return bc->bound_on == cpu ? -EBUSY : 0; in broadcast_needs_cpu()
779 static void broadcast_shutdown_local(struct clock_event_device *bc, in broadcast_shutdown_local() argument
787 if (bc->features & CLOCK_EVT_FEAT_HRTIMER) { in broadcast_shutdown_local()
788 if (broadcast_needs_cpu(bc, smp_processor_id())) in broadcast_shutdown_local()
790 if (dev->next_event < bc->next_event) in broadcast_shutdown_local()
800 struct clock_event_device *bc, *dev = td->evtdev; in ___tick_broadcast_oneshot_control() local
805 bc = tick_broadcast_device.evtdev; in ___tick_broadcast_oneshot_control()
815 ret = broadcast_needs_cpu(bc, cpu); in ___tick_broadcast_oneshot_control()
825 if (bc->features & CLOCK_EVT_FEAT_HRTIMER) in ___tick_broadcast_oneshot_control()
834 broadcast_shutdown_local(bc, dev); in ___tick_broadcast_oneshot_control()
848 } else if (dev->next_event < bc->next_event) { in ___tick_broadcast_oneshot_control()
849 tick_broadcast_set_event(bc, cpu, dev->next_event); in ___tick_broadcast_oneshot_control()
857 ret = broadcast_needs_cpu(bc, cpu); in ___tick_broadcast_oneshot_control()
1024 static void tick_broadcast_setup_oneshot(struct clock_event_device *bc, in tick_broadcast_setup_oneshot() argument
1030 if (!bc) in tick_broadcast_setup_oneshot()
1039 if (bc->event_handler == tick_handle_oneshot_broadcast) { in tick_broadcast_setup_oneshot()
1063 bc->event_handler = tick_handle_oneshot_broadcast; in tick_broadcast_setup_oneshot()
1064 bc->next_event = KTIME_MAX; in tick_broadcast_setup_oneshot()
1097 if (clockevent_state_oneshot(bc)) in tick_broadcast_setup_oneshot()
1118 tick_broadcast_set_event(bc, cpu, nexttick); in tick_broadcast_setup_oneshot()
1126 struct clock_event_device *bc; in tick_broadcast_switch_to_oneshot() local
1134 bc = tick_broadcast_device.evtdev; in tick_broadcast_switch_to_oneshot()
1135 if (bc) in tick_broadcast_switch_to_oneshot()
1136 tick_broadcast_setup_oneshot(bc, oldmode == TICKDEV_MODE_PERIODIC); in tick_broadcast_switch_to_oneshot()
1144 struct clock_event_device *bc; in hotplug_cpu__broadcast_tick_pull() local
1148 bc = tick_broadcast_device.evtdev; in hotplug_cpu__broadcast_tick_pull()
1150 if (bc && broadcast_needs_cpu(bc, deadcpu)) { in hotplug_cpu__broadcast_tick_pull()
1176 clockevents_program_event(bc, bc->next_event, 1); in hotplug_cpu__broadcast_tick_pull()
1212 struct clock_event_device *bc = tick_broadcast_device.evtdev; in tick_broadcast_oneshot_available() local
1214 return bc ? bc->features & CLOCK_EVT_FEAT_ONESHOT : false; in tick_broadcast_oneshot_available()
1220 struct clock_event_device *bc = tick_broadcast_device.evtdev; in __tick_broadcast_oneshot_control() local
1222 if (!bc || (bc->features & CLOCK_EVT_FEAT_HRTIMER)) in __tick_broadcast_oneshot_control()