aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc64/kernel/mpic.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc64/kernel/mpic.c')
-rw-r--r--arch/ppc64/kernel/mpic.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/ppc64/kernel/mpic.c b/arch/ppc64/kernel/mpic.c
index 593ea5b82afa..e8fbab1df37f 100644
--- a/arch/ppc64/kernel/mpic.c
+++ b/arch/ppc64/kernel/mpic.c
@@ -792,6 +792,35 @@ void mpic_setup_this_cpu(void)
792#endif /* CONFIG_SMP */ 792#endif /* CONFIG_SMP */
793} 793}
794 794
795/*
796 * XXX: someone who knows mpic should check this.
797 * do we need to eoi the ipi here (see xics comments)?
798 * or can we reset the mpic in the new kernel?
799 */
800void mpic_teardown_this_cpu(void)
801{
802 struct mpic *mpic = mpic_primary;
803 unsigned long flags;
804 u32 msk = 1 << hard_smp_processor_id();
805 unsigned int i;
806
807 BUG_ON(mpic == NULL);
808
809 DBG("%s: teardown_this_cpu(%d)\n", mpic->name, hard_smp_processor_id());
810 spin_lock_irqsave(&mpic_lock, flags);
811
812 /* let the mpic know we don't want intrs. */
813 for (i = 0; i < mpic->num_sources ; i++)
814 mpic_irq_write(i, MPIC_IRQ_DESTINATION,
815 mpic_irq_read(i, MPIC_IRQ_DESTINATION) & ~msk);
816
817 /* Set current processor priority to max */
818 mpic_cpu_write(MPIC_CPU_CURRENT_TASK_PRI, 0xf);
819
820 spin_unlock_irqrestore(&mpic_lock, flags);
821}
822
823
795void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask) 824void mpic_send_ipi(unsigned int ipi_no, unsigned int cpu_mask)
796{ 825{
797 struct mpic *mpic = mpic_primary; 826 struct mpic *mpic = mpic_primary;