Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * Author: Kumar Gala <galak@kernel.crashing.org>
0004  *
0005  * Copyright 2009 Freescale Semiconductor Inc.
0006  */
0007 
0008 #include <linux/stddef.h>
0009 #include <linux/kernel.h>
0010 #include <linux/smp.h>
0011 #include <linux/threads.h>
0012 #include <linux/hardirq.h>
0013 
0014 #include <asm/dbell.h>
0015 #include <asm/interrupt.h>
0016 #include <asm/irq_regs.h>
0017 #include <asm/kvm_ppc.h>
0018 #include <asm/trace.h>
0019 
0020 #ifdef CONFIG_SMP
0021 
0022 DEFINE_INTERRUPT_HANDLER_ASYNC(doorbell_exception)
0023 {
0024     struct pt_regs *old_regs = set_irq_regs(regs);
0025 
0026     trace_doorbell_entry(regs);
0027 
0028     ppc_msgsync();
0029 
0030     if (should_hard_irq_enable())
0031         do_hard_irq_enable();
0032 
0033     kvmppc_clear_host_ipi(smp_processor_id());
0034     __this_cpu_inc(irq_stat.doorbell_irqs);
0035 
0036     smp_ipi_demux_relaxed(); /* already performed the barrier */
0037 
0038     trace_doorbell_exit(regs);
0039 
0040     set_irq_regs(old_regs);
0041 }
0042 #else /* CONFIG_SMP */
0043 DEFINE_INTERRUPT_HANDLER_ASYNC(doorbell_exception)
0044 {
0045     printk(KERN_WARNING "Received doorbell on non-smp system\n");
0046 }
0047 #endif /* CONFIG_SMP */