Lines Matching +full:uv +full:- +full:shutdown

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 * Copyright (c) 2009-2013 Silicon Graphics, Inc. All Rights Reserved.
12 #include <asm/uv/uv_mmrs.h>
13 #include <asm/uv/uv_hub.h>
14 #include <asm/uv/bios.h>
15 #include <asm/uv/uv.h>
38 .irq = -1,
92 /* Setup interrupt and return non-zero if early expiration occurred. */
101 uv_write_global_mmr64(pnode, UVH_INT_CMPB, -1L); in uv_setup_intr()
121 * Per-cpu timer tracking routines
134 /* Allocate per-node list of cpu timer expiration times. */
141 return -ENOMEM; in uv_rtc_allocate_timers()
155 return -ENOMEM; in uv_rtc_allocate_timers()
157 spin_lock_init(&head->lock); in uv_rtc_allocate_timers()
158 head->ncpus = uv_blade_nr_possible_cpus(bid); in uv_rtc_allocate_timers()
159 head->next_cpu = -1; in uv_rtc_allocate_timers()
163 head->cpu[bcpu].lcpu = cpu; in uv_rtc_allocate_timers()
164 head->cpu[bcpu].expires = ULLONG_MAX; in uv_rtc_allocate_timers()
174 int c, bcpu = -1; in uv_rtc_find_next_timer()
176 head->next_cpu = -1; in uv_rtc_find_next_timer()
177 for (c = 0; c < head->ncpus; c++) { in uv_rtc_find_next_timer()
178 u64 exp = head->cpu[c].expires; in uv_rtc_find_next_timer()
185 head->next_cpu = bcpu; in uv_rtc_find_next_timer()
186 c = head->cpu[bcpu].lcpu; in uv_rtc_find_next_timer()
207 u64 *t = &head->cpu[bcpu].expires; in uv_rtc_set_timer()
211 spin_lock_irqsave(&head->lock, flags); in uv_rtc_set_timer()
213 next_cpu = head->next_cpu; in uv_rtc_set_timer()
218 expires < head->cpu[next_cpu].expires) { in uv_rtc_set_timer()
219 head->next_cpu = bcpu; in uv_rtc_set_timer()
223 spin_unlock_irqrestore(&head->lock, flags); in uv_rtc_set_timer()
224 return -ETIME; in uv_rtc_set_timer()
228 spin_unlock_irqrestore(&head->lock, flags); in uv_rtc_set_timer()
243 u64 *t = &head->cpu[bcpu].expires; in uv_rtc_unset_timer()
247 spin_lock_irqsave(&head->lock, flags); in uv_rtc_unset_timer()
249 if ((head->next_cpu == bcpu && uv_read_rtc(NULL) >= *t) || force) in uv_rtc_unset_timer()
255 if (head->next_cpu == bcpu) in uv_rtc_unset_timer()
259 spin_unlock_irqrestore(&head->lock, flags); in uv_rtc_unset_timer()
272 * Starting with HUB rev 2.0, the UV RTC register is replicated across all
294 int ced_cpu = cpumask_first(ced->cpumask); in uv_rtc_next_event()
300 * Shutdown the RTC timer
304 int ced_cpu = cpumask_first(evt->cpumask); in uv_rtc_shutdown()
315 if (!ced || !ced->event_handler) in uv_rtc_interrupt()
321 ced->event_handler(ced); in uv_rtc_interrupt()
337 ced->cpumask = cpumask_of(smp_processor_id()); in uv_rtc_register_clockevents()
346 return -ENODEV; in uv_rtc_setup_clock()
350 printk(KERN_INFO "UV RTC clocksource failed rc %d\n", rc); in uv_rtc_setup_clock()
352 printk(KERN_INFO "UV RTC clocksource registered freq %lu MHz\n", in uv_rtc_setup_clock()
383 printk(KERN_INFO "UV RTC clockevents registered\n"); in uv_rtc_setup_clock()
389 printk(KERN_INFO "UV RTC clockevents failed rc %d\n", rc); in uv_rtc_setup_clock()