powerpc/xics: EOI xics ipi by hand in kexec

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, October 15, 2008 - 12:06 pm

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a57c9...
Commit:     1a57c926b6da56b4f904a0d8117ac362724f8c66
Parent:     b4963255ad5a426f04a0bb15c4315fa4bb40cde9
Author:     Milton Miller <miltonm@bga.com>
AuthorDate: Fri Oct 10 01:56:35 2008 +0000
Committer:  Benjamin Herrenschmidt <benh@kernel.crashing.org>
CommitDate: Mon Oct 13 16:24:18 2008 +1100

    powerpc/xics: EOI xics ipi by hand in kexec
    
    EOI normally has the side effect of returning the cpu to the base
    priority to recieve the next interrupt.  This is actually controlled
    by the top byte of the xirr register.   When we are exiting the
    kernel in kexec we must eoi the ipi for the next kernel because we
    never return from the handler, but we want to leave interrupt
    delivery blocked until the next kernel takes action.
    
    Since the hardware ipi vector is fixed, its easiest to just do the
    eoi explicitly.
    
    Signed-off-by: Milton Miller <miltonm@bga.com>
    Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
 arch/powerpc/platforms/pseries/xics.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 0bb5533..165234d 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -757,25 +757,21 @@ void xics_teardown_cpu(void)
 
 void xics_kexec_teardown_cpu(int secondary)
 {
-	unsigned int ipi;
-	struct irq_desc *desc;
-
 	xics_teardown_cpu();
 
 	/*
-	 * we need to EOI the IPI
+	 * we take the ipi irq but and never return so we
+	 * need to EOI the IPI, but want to leave our priority 0
 	 *
-	 * probably need to check all the other interrupts too
+	 * should we check all the other interrupts too?
 	 * should we be flagging idle loop instead?
 	 * or creating some task to be scheduled?
 	 */
 
-	ipi = irq_find_mapping(xics_host, XICS_IPI);
-	if (ipi == XICS_IRQ_SPURIOUS)
-		return;
-	desc = get_irq_desc(ipi);
-	if (desc->chip && desc->chip->eoi)
-		desc->chip->eoi(ipi);
+	if (firmware_has_feature(FW_FEATURE_LPAR))
+		lpar_xirr_info_set((0x00 << 24) | XICS_IPI);
+	else
+		direct_xirr_info_set((0x00 << 24) | XICS_IPI);
 
 	/*
 	 * Some machines need to have at least one cpu in the GIQ,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
powerpc/xics: EOI xics ipi by hand in kexec, Linux Kernel Mailing ..., (Wed Oct 15, 12:06 pm)