Lines Matching refs:base
142 struct hrtimer_clock_base *base; in lock_hrtimer_base() local
145 base = timer->base; in lock_hrtimer_base()
146 if (likely(base != &migration_base)) { in lock_hrtimer_base()
147 raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
148 if (likely(base == timer->base)) in lock_hrtimer_base()
149 return base; in lock_hrtimer_base()
151 raw_spin_unlock_irqrestore(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
182 struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base, in get_target_base() argument
185 if (pinned || !base->migration_enabled) in get_target_base()
186 return base; in get_target_base()
191 struct hrtimer_cpu_base *get_target_base(struct hrtimer_cpu_base *base, in get_target_base() argument
194 return base; in get_target_base()
211 switch_hrtimer_base(struct hrtimer *timer, struct hrtimer_clock_base *base, in switch_hrtimer_base() argument
216 int basenum = base->index; in switch_hrtimer_base()
223 if (base != new_base) { in switch_hrtimer_base()
234 return base; in switch_hrtimer_base()
237 timer->base = &migration_base; in switch_hrtimer_base()
238 raw_spin_unlock(&base->cpu_base->lock); in switch_hrtimer_base()
244 raw_spin_lock(&base->cpu_base->lock); in switch_hrtimer_base()
246 timer->base = base; in switch_hrtimer_base()
249 timer->base = new_base; in switch_hrtimer_base()
265 struct hrtimer_clock_base *base = timer->base; in lock_hrtimer_base() local
267 raw_spin_lock_irqsave(&base->cpu_base->lock, *flags); in lock_hrtimer_base()
269 return base; in lock_hrtimer_base()
471 struct hrtimer_clock_base *base = cpu_base->clock_base; in __hrtimer_get_next_event() local
476 for (; active; base++, active >>= 1) { in __hrtimer_get_next_event()
483 next = timerqueue_getnext(&base->active); in __hrtimer_get_next_event()
485 expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in __hrtimer_get_next_event()
502 static inline ktime_t hrtimer_update_base(struct hrtimer_cpu_base *base) in hrtimer_update_base() argument
504 ktime_t *offs_real = &base->clock_base[HRTIMER_BASE_REALTIME].offset; in hrtimer_update_base()
505 ktime_t *offs_boot = &base->clock_base[HRTIMER_BASE_BOOTTIME].offset; in hrtimer_update_base()
506 ktime_t *offs_tai = &base->clock_base[HRTIMER_BASE_TAI].offset; in hrtimer_update_base()
508 return ktime_get_update_offsets_now(&base->clock_was_set_seq, in hrtimer_update_base()
607 struct hrtimer_clock_base *base) in hrtimer_reprogram() argument
610 ktime_t expires = ktime_sub(hrtimer_get_expires(timer), base->offset); in hrtimer_reprogram()
618 if (base->cpu_base != cpu_base) in hrtimer_reprogram()
664 static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) in hrtimer_init_hres() argument
666 base->expires_next.tv64 = KTIME_MAX; in hrtimer_init_hres()
667 base->hres_active = 0; in hrtimer_init_hres()
677 struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases); in retrigger_next_event() local
679 if (!base->hres_active) in retrigger_next_event()
682 raw_spin_lock(&base->lock); in retrigger_next_event()
683 hrtimer_update_base(base); in retrigger_next_event()
684 hrtimer_force_reprogram(base, 0); in retrigger_next_event()
685 raw_spin_unlock(&base->lock); in retrigger_next_event()
693 struct hrtimer_cpu_base *base = this_cpu_ptr(&hrtimer_bases); in hrtimer_switch_to_hres() local
697 "mode on CPU %d\n", base->cpu); in hrtimer_switch_to_hres()
700 base->hres_active = 1; in hrtimer_switch_to_hres()
731 hrtimer_force_reprogram(struct hrtimer_cpu_base *base, int skip_equal) { } in hrtimer_force_reprogram() argument
733 struct hrtimer_clock_base *base) in hrtimer_reprogram() argument
737 static inline void hrtimer_init_hres(struct hrtimer_cpu_base *base) { } in hrtimer_init_hres() argument
813 raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags); in unlock_hrtimer_base()
877 struct hrtimer_clock_base *base) in enqueue_hrtimer() argument
881 base->cpu_base->active_bases |= 1 << base->index; in enqueue_hrtimer()
885 return timerqueue_add(&base->active, &timer->node); in enqueue_hrtimer()
899 struct hrtimer_clock_base *base, in __remove_hrtimer() argument
902 struct hrtimer_cpu_base *cpu_base = base->cpu_base; in __remove_hrtimer()
909 if (!timerqueue_del(&base->active, &timer->node)) in __remove_hrtimer()
910 cpu_base->active_bases &= ~(1 << base->index); in __remove_hrtimer()
930 remove_hrtimer(struct hrtimer *timer, struct hrtimer_clock_base *base, bool restart) in remove_hrtimer() argument
946 reprogram = base->cpu_base == this_cpu_ptr(&hrtimer_bases); in remove_hrtimer()
951 __remove_hrtimer(timer, base, state, reprogram); in remove_hrtimer()
984 struct hrtimer_clock_base *base, *new_base; in hrtimer_start_range_ns() local
988 base = lock_hrtimer_base(timer, &flags); in hrtimer_start_range_ns()
991 remove_hrtimer(timer, base, true); in hrtimer_start_range_ns()
994 tim = ktime_add_safe(tim, base->get_time()); in hrtimer_start_range_ns()
1001 new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED); in hrtimer_start_range_ns()
1036 struct hrtimer_clock_base *base; in hrtimer_try_to_cancel() local
1049 base = lock_hrtimer_base(timer, &flags); in hrtimer_try_to_cancel()
1052 ret = remove_hrtimer(timer, base, false); in hrtimer_try_to_cancel()
1129 int base; in __hrtimer_init() local
1138 base = hrtimer_clockid_to_base(clock_id); in __hrtimer_init()
1139 timer->base = &cpu_base->clock_base[base]; in __hrtimer_init()
1176 cpu_base = READ_ONCE(timer->base->cpu_base); in hrtimer_active()
1184 cpu_base != READ_ONCE(timer->base->cpu_base)); in hrtimer_active()
1209 struct hrtimer_clock_base *base, in __run_hrtimer() argument
1229 __remove_hrtimer(timer, base, HRTIMER_STATE_INACTIVE, 0); in __run_hrtimer()
1263 enqueue_hrtimer(timer, base); in __run_hrtimer()
1280 struct hrtimer_clock_base *base = cpu_base->clock_base; in __hrtimer_run_queues() local
1283 for (; active; base++, active >>= 1) { in __hrtimer_run_queues()
1290 basenow = ktime_add(now, base->offset); in __hrtimer_run_queues()
1292 while ((node = timerqueue_getnext(&base->active))) { in __hrtimer_run_queues()
1312 __run_hrtimer(cpu_base, base, timer, &basenow); in __hrtimer_run_queues()
1576 restart->nanosleep.clockid = t.timer.base->clockid; in hrtimer_nanosleep()
1636 timer->base = new_base; in migrate_hrtimer_list()