diff options
| author | Thomas Gleixner <[email protected]> | 2021-03-14 16:34:35 +0100 |
|---|---|---|
| committer | Thomas Gleixner <[email protected]> | 2021-03-14 16:34:35 +0100 |
| commit | b470ebc9e0e57f53d1db9c49b8a3de4086babd05 (patch) | |
| tree | 95c61291ad5f216967a9be36f19774026ffc88cb /drivers/oprofile/timer_int.c | |
| parent | 4c7bcb51ae25f79e3733982e5d0cd8ce8640ddfc (diff) | |
| parent | 5fbecd2389f48e1415799c63130d0cdce1cf3f60 (diff) | |
Merge tag 'irqchip-fixes-5.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms into irq/urgent
Pull irqchip fixes from Marc Zyngier:
- More compatible strings for the Ingenic irqchip (introducing the
JZ4760B SoC)
- Select GENERIC_IRQ_MULTI_HANDLER on the ARM ep93xx platform
- Drop all GENERIC_IRQ_MULTI_HANDLER selections from the irqchip
Kconfig, now relying on the architecture to get it right
- Drop the debugfs_file field from struct irq_domain, now that
debugfs can track things on its own
Diffstat (limited to 'drivers/oprofile/timer_int.c')
| -rw-r--r-- | drivers/oprofile/timer_int.c | 122 |
1 files changed, 0 insertions, 122 deletions
diff --git a/drivers/oprofile/timer_int.c b/drivers/oprofile/timer_int.c deleted file mode 100644 index 2498a6cd7c24..000000000000 --- a/drivers/oprofile/timer_int.c +++ /dev/null @@ -1,122 +0,0 @@ -/** - * @file timer_int.c - * - * @remark Copyright 2002 OProfile authors - * @remark Read the file COPYING - * - * @author John Levon <[email protected]> - */ - -#include <linux/kernel.h> -#include <linux/notifier.h> -#include <linux/smp.h> -#include <linux/oprofile.h> -#include <linux/profile.h> -#include <linux/init.h> -#include <linux/cpu.h> -#include <linux/hrtimer.h> -#include <asm/irq_regs.h> -#include <asm/ptrace.h> - -#include "oprof.h" - -static DEFINE_PER_CPU(struct hrtimer, oprofile_hrtimer); -static int ctr_running; - -static enum hrtimer_restart oprofile_hrtimer_notify(struct hrtimer *hrtimer) -{ - oprofile_add_sample(get_irq_regs(), 0); - hrtimer_forward_now(hrtimer, ns_to_ktime(TICK_NSEC)); - return HRTIMER_RESTART; -} - -static void __oprofile_hrtimer_start(void *unused) -{ - struct hrtimer *hrtimer = this_cpu_ptr(&oprofile_hrtimer); - - if (!ctr_running) - return; - - hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); - hrtimer->function = oprofile_hrtimer_notify; - - hrtimer_start(hrtimer, ns_to_ktime(TICK_NSEC), - HRTIMER_MODE_REL_PINNED); -} - -static int oprofile_hrtimer_start(void) -{ - get_online_cpus(); - ctr_running = 1; - on_each_cpu(__oprofile_hrtimer_start, NULL, 1); - put_online_cpus(); - return 0; -} - -static void __oprofile_hrtimer_stop(int cpu) -{ - struct hrtimer *hrtimer = &per_cpu(oprofile_hrtimer, cpu); - - if (!ctr_running) - return; - - hrtimer_cancel(hrtimer); -} - -static void oprofile_hrtimer_stop(void) -{ - int cpu; - - get_online_cpus(); - for_each_online_cpu(cpu) - __oprofile_hrtimer_stop(cpu); - ctr_running = 0; - put_online_cpus(); -} - -static int oprofile_timer_online(unsigned int cpu) -{ - local_irq_disable(); - __oprofile_hrtimer_start(NULL); - local_irq_enable(); - return 0; -} - -static int oprofile_timer_prep_down(unsigned int cpu) -{ - __oprofile_hrtimer_stop(cpu); - return 0; -} - -static enum cpuhp_state hp_online; - -static int oprofile_hrtimer_setup(void) -{ - int ret; - - ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN, - "oprofile/timer:online", - oprofile_timer_online, - oprofile_timer_prep_down); - if (ret < 0) - return ret; - hp_online = ret; - return 0; -} - -static void oprofile_hrtimer_shutdown(void) -{ - cpuhp_remove_state_nocalls(hp_online); -} - -int oprofile_timer_init(struct oprofile_operations *ops) -{ - ops->create_files = NULL; - ops->setup = oprofile_hrtimer_setup; - ops->shutdown = oprofile_hrtimer_shutdown; - ops->start = oprofile_hrtimer_start; - ops->stop = oprofile_hrtimer_stop; - ops->cpu_type = "timer"; - printk(KERN_INFO "oprofile: using timer interrupt.\n"); - return 0; -} |