Skip to content

Commit 1ef8014

Browse files
Sebastien Duguepaulusmack
authored andcommitted
powerpc/pseries: Fix getting the server number size
The 'ibm,interrupt-server#-size' properties are not in the cpu nodes, which is where we currently look for them, but rather live under the interrupt source controller nodes (which have "ibm,ppc-xics" in their compatible property). This moves the code that looks for the ibm,interrupt-server#-size properties from xics_update_irq_servers() 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. This property only appears on POWER6 boxes and is only used in the set-indicator(gqirm) call, and apparently firmware currently ignores the value we pass. Nevertheless we need to fix it in case future firmware versions use it. Signed-off-by: Sebastien Dugue <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Acked-by: Milton Miller <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 691de57 commit 1ef8014

File tree

1 file changed

+22
-6
lines changed
  • arch/powerpc/platforms/pseries

1 file changed

+22
-6
lines changed

arch/powerpc/platforms/pseries/xics.c

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ static void xics_update_irq_servers(void)
579579
int i, j;
580580
struct device_node *np;
581581
u32 ilen;
582-
const u32 *ireg, *isize;
582+
const u32 *ireg;
583583
u32 hcpuid;
584584

585585
/* Find the server numbers for the boot cpu. */
@@ -607,11 +607,6 @@ static void xics_update_irq_servers(void)
607607
}
608608
}
609609

610-
/* get the bit size of server numbers */
611-
isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
612-
if (isize)
613-
interrupt_server_size = *isize;
614-
615610
of_node_put(np);
616611
}
617612

@@ -682,6 +677,7 @@ void __init xics_init_IRQ(void)
682677
struct device_node *np;
683678
u32 indx = 0;
684679
int found = 0;
680+
const u32 *isize;
685681

686682
ppc64_boot_msg(0x20, "XICS Init");
687683

@@ -701,6 +697,26 @@ void __init xics_init_IRQ(void)
701697
if (found == 0)
702698
return;
703699

700+
/* get the bit size of server numbers */
701+
found = 0;
702+
703+
for_each_compatible_node(np, NULL, "ibm,ppc-xics") {
704+
isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
705+
706+
if (!isize)
707+
continue;
708+
709+
if (!found) {
710+
interrupt_server_size = *isize;
711+
found = 1;
712+
} else if (*isize != interrupt_server_size) {
713+
printk(KERN_WARNING "XICS: "
714+
"mismatched ibm,interrupt-server#-size\n");
715+
interrupt_server_size = max(*isize,
716+
interrupt_server_size);
717+
}
718+
}
719+
704720
xics_update_irq_servers();
705721
xics_init_host();
706722

0 commit comments

Comments
 (0)