linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: XICS - fix getting the server number size
@ 2008-10-22 14:36 Sebastien Dugue
  2008-10-22 20:34 ` Milton Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastien Dugue @ 2008-10-22 14:36 UTC (permalink / raw)
  To: linux-ppc; +Cc: Tim Chavez, Jean Pierre Dion, Milton Miller


  The 'ibm,interrupt-server#-size' properties are not cpu nodes properties,
but rather live under the interrupt source controller nodes (compatible
ibm,ppc-xics).

  Therefore, this patch moves the detection of this property outside of
xics_update_irq_servers() and into xics_init_IRQ().

  Also this adds a check for mismatched sizes across the interrupt source
controller nodes. Not sure this is necessary as in this case the firmware
might be seriously busted.

Signed-off-by: Sebastien Dugue <sebastien.dugue@bull.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Milton Miller <miltonm@bga.com>
---
 arch/powerpc/platforms/pseries/xics.c |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index e190477..75a289b 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -579,7 +579,7 @@ static void xics_update_irq_servers(void)
 	int i, j;
 	struct device_node *np;
 	u32 ilen;
-	const u32 *ireg, *isize;
+	const u32 *ireg;
 	u32 hcpuid;
 
 	/* Find the server numbers for the boot cpu. */
@@ -607,11 +607,6 @@ static void xics_update_irq_servers(void)
 		}
 	}
 
-	/* get the bit size of server numbers */
-	isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
-	if (isize)
-		interrupt_server_size = *isize;
-
 	of_node_put(np);
 }
 
@@ -682,6 +677,7 @@ void __init xics_init_IRQ(void)
 	struct device_node *np;
 	u32 indx = 0;
 	int found = 0;
+	const u32 *isize;
 
 	ppc64_boot_msg(0x20, "XICS Init");
 
@@ -701,6 +697,26 @@ void __init xics_init_IRQ(void)
 	if (found == 0)
 		return;
 
+	/* get the bit size of server numbers */
+	found = 0;
+
+	for_each_compatible_node(np, NULL, "ibm,ppc-xics") {
+		isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
+
+		if (!isize)
+			continue;
+
+		if (!found) {
+			interrupt_server_size = *isize;
+			found = 1;
+		} else if (*isize != interrupt_server_size) {
+			printk(KERN_WARNING "XICS: "
+			       "mismatched ibm,interrupt-server#-size\n");
+			interrupt_server_size = max(*isize,
+						    interrupt_server_size);
+		}
+	}
+
 	xics_update_irq_servers();
 	xics_init_host();
 
-- 
1.6.0.1.308.gede4c

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: XICS - fix getting the server number size
  2008-10-22 14:36 [PATCH] powerpc: XICS - fix getting the server number size Sebastien Dugue
@ 2008-10-22 20:34 ` Milton Miller
  2008-10-23  6:22   ` Sebastien Dugue
  0 siblings, 1 reply; 3+ messages in thread
From: Milton Miller @ 2008-10-22 20:34 UTC (permalink / raw)
  To: Sebastien Dugue; +Cc: linux-ppc, Tim Chavez, Jean Pierre Dion


On Oct 22, 2008, at 9:36 AM, Sebastien Dugue wrote:

>
>   The 'ibm,interrupt-server#-size' properties are not cpu nodes 
> properties,
> but rather live under the interrupt source controller nodes (compatible
> ibm,ppc-xics).
>
>   Therefore, this patch moves the detection of this property outside of
> xics_update_irq_servers() and into xics_init_IRQ().
>

yes, PAPR says its on one of the interrupt nodes.   I am too tired to
decipher if it on the presentation or source.


Acked-by: Milton Miller <miltonm@bga.com>

>   Also this adds a check for mismatched sizes across the interrupt 
> source
> controller nodes. Not sure this is necessary as in this case the 
> firmware
> might be seriously busted.

I am hoping you have tested this?  A POWER6 box?

Last time I looked (POWER5 timeframe) firmware was ignoring the 
parameter
to set-indicator(gqirm) which is the only use of this property.

milton

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc: XICS - fix getting the server number size
  2008-10-22 20:34 ` Milton Miller
@ 2008-10-23  6:22   ` Sebastien Dugue
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastien Dugue @ 2008-10-23  6:22 UTC (permalink / raw)
  To: Milton Miller; +Cc: linux-ppc, Tim Chavez, Jean Pierre Dion

On Wed, 22 Oct 2008 15:34:52 -0500 Milton Miller <miltonm@bga.com> wrote:

> 
> On Oct 22, 2008, at 9:36 AM, Sebastien Dugue wrote:
> 
> >
> >   The 'ibm,interrupt-server#-size' properties are not cpu nodes 
> > properties,
> > but rather live under the interrupt source controller nodes (compatible
> > ibm,ppc-xics).
> >
> >   Therefore, this patch moves the detection of this property outside of
> > xics_update_irq_servers() and into xics_init_IRQ().
> >
> 
> yes, PAPR says its on one of the interrupt nodes.   I am too tired to
> decipher if it on the presentation or source.

  Interrupt source nodes. I tried to check the device tree on a POWER5
box, but all those we have here are running LPAR'ed AIX and I'm not sure
the DT dump tool is not lying to me and filtering the interesting stuff
(not interrupt nodes reported).

> 
> 
> Acked-by: Milton Miller <miltonm@bga.com>
> 
> >   Also this adds a check for mismatched sizes across the interrupt 
> > source
> > controller nodes. Not sure this is necessary as in this case the 
> > firmware
> > might be seriously busted.
> 
> I am hoping you have tested this?  A POWER6 box?

  Yep, on a POWER6 box doing cpu off/onlining. Unfortunately I don't have
a POWER5 box running Linux right now to test on.

> 
> Last time I looked (POWER5 timeframe) firmware was ignoring the 
> parameter
> to set-indicator(gqirm) which is the only use of this property.

  Right, the POWER6 also seems to ignore this, but it will avoid being
bitten the day this changes.

  Thanks,

  Sebastien.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-10-23  7:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-22 14:36 [PATCH] powerpc: XICS - fix getting the server number size Sebastien Dugue
2008-10-22 20:34 ` Milton Miller
2008-10-23  6:22   ` Sebastien Dugue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).