WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] avoid reseting the MPIC w

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] avoid reseting the MPIC when sharing
From: Xen patchbot-linux-ppc-2.6 <patchbot-linux-ppc-2.6@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Oct 2006 16:41:23 +0000
Delivery-date: Fri, 13 Oct 2006 10:49:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID f0be2cc05103e19788416719e2b9ec38b38bd26e
# Parent  d2b37a151f5b27924e5aa59b4701ae8a7a623b25
[LINUX][XEN][POWERPC] avoid reseting the MPIC when sharing

This patch copies the function used by maple/setup.c to allocate the
MPIC, but we disable the flag that tells the MPIC code to reset it.
It is highly possible that this might solve our MPIC spurious
interrupt problem in Xen.

Inspired-by: Amos Waterland <apw@xxxxxxxxxx>
Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 arch/powerpc/platforms/xen/evtchn.c |   43 ++++++++++++++++++++++++++++++++++--
 1 files changed, 41 insertions(+), 2 deletions(-)

diff -r d2b37a151f5b -r f0be2cc05103 arch/powerpc/platforms/xen/evtchn.c
--- a/arch/powerpc/platforms/xen/evtchn.c       Tue Oct 10 09:57:12 2006 -0400
+++ b/arch/powerpc/platforms/xen/evtchn.c       Fri Oct 13 12:36:39 2006 -0400
@@ -32,7 +32,6 @@
 
 struct hw_interrupt_type *xen_pirq;
 static struct hw_interrupt_type hc_irq;
-extern struct machdep_calls mach_maple_md;
 
 static unsigned int xen_startup_irq(unsigned int irq)
 {
@@ -75,12 +74,52 @@ static inline struct mpic *mpic_from_irq
        return container_of(irq_desc[irq].chip, struct mpic, hc_irq);
 }
 
+/* borrowed from platform/maple/setup.c */
+static __init void xen_share_maple_init_IRQ(void)
+{
+       struct device_node *root;
+       unsigned int *opprop;
+       unsigned long opic_addr;
+       struct mpic *mpic;
+       unsigned char senses[128];
+       int n;
+
+       DBG(" -> %s\n", __func__);
+
+       /* XXX: Non standard, replace that with a proper openpic/mpic node
+        * in the device-tree. Find the Open PIC if present */
+       root = of_find_node_by_path("/");
+       opprop = (unsigned int *) get_property(root,
+                               "platform-open-pic", NULL);
+       if (opprop == 0)
+               panic("OpenPIC not found !\n");
+
+       n = prom_n_addr_cells(root);
+       for (opic_addr = 0; n > 0; --n)
+               opic_addr = (opic_addr << 32) + *opprop++;
+       of_node_put(root);
+
+       /* Obtain sense values from device-tree */
+       prom_get_irq_senses(senses, 0, 128);
+
+       /* XEN: the only change is we want to avoid the reset */
+
+       mpic = mpic_alloc(opic_addr,
+                         MPIC_PRIMARY | MPIC_BIG_ENDIAN |
+                         MPIC_BROKEN_U3 /* | MPIC_WANTS_RESET */,
+                         0, 0, 128, 128, senses, 128, "Xen-U3-MPIC");
+       BUG_ON(mpic == NULL);
+       mpic_init(mpic);
+
+       DBG(" <- %s\n", __func__);
+}
+
 static void xen_share_pic(void)
 {
        struct mpic *mpic;
 
        xen_pirq = irq_desc[0].chip;
-       mach_maple_md.init_IRQ();
+       xen_share_maple_init_IRQ();
 
        /* FIXME: 0 may not be valid */
        mpic = mpic_from_irq(0);

_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [linux-ppc-2.6] [LINUX][XEN][POWERPC] avoid reseting the MPIC when sharing, Xen patchbot-linux-ppc-2 . 6 <=