diff options
author | Olof Johansson <olof@lixom.net> | 2007-12-27 23:16:29 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2007-12-28 10:22:25 -0500 |
commit | d87bf3bed71375b141e95b5fdbac413ac4b65184 (patch) | |
tree | 4920be669338029456f625e6f6a587b8e31185b0 | |
parent | f365355e65ee619e3b7baeca69b46fd2c4a5ec68 (diff) |
[POWERPC] pasemi: Distribute interrupts evenly across cpus
By default the OpenPIC on PWRficient will bias to one core (since that
will improve changes of the other core being able to stay idle/powered
down). However, this conflicts with most irq load balancing schemes,
since setting an interrupt to be delivered to either core doesn't really
result in the load being shared. It also doesn't work well with the
soft irq disable feature of PPC, since EE will stay on until the first
interrupt is taken while soft disabled.
Set the gconf0 config bit that enables even distribution of interrupts
among the two cores.
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | arch/powerpc/platforms/pasemi/setup.c | 2 | ||||
-rw-r--r-- | arch/powerpc/sysdev/mpic.c | 5 | ||||
-rw-r--r-- | include/asm-powerpc/mpic.h | 3 |
3 files changed, 9 insertions, 1 deletions
diff --git a/arch/powerpc/platforms/pasemi/setup.c b/arch/powerpc/platforms/pasemi/setup.c index eb271fded876..1940e678878e 100644 --- a/arch/powerpc/platforms/pasemi/setup.c +++ b/arch/powerpc/platforms/pasemi/setup.c | |||
@@ -224,7 +224,7 @@ static __init void pas_init_IRQ(void) | |||
224 | openpic_addr = of_read_number(opprop, naddr); | 224 | openpic_addr = of_read_number(opprop, naddr); |
225 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); | 225 | printk(KERN_DEBUG "OpenPIC addr: %lx\n", openpic_addr); |
226 | 226 | ||
227 | mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS; | 227 | mpic_flags = MPIC_PRIMARY | MPIC_LARGE_VECTORS | MPIC_NO_BIAS; |
228 | 228 | ||
229 | nmiprop = of_get_property(mpic_node, "nmi-source", NULL); | 229 | nmiprop = of_get_property(mpic_node, "nmi-source", NULL); |
230 | if (nmiprop) | 230 | if (nmiprop) |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 5a9d8c141e60..f88ff09c4711 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1279,6 +1279,11 @@ void __init mpic_init(struct mpic *mpic) | |||
1279 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) | 1279 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) |
1280 | | MPIC_GREG_GCONF_8259_PTHROU_DIS); | 1280 | | MPIC_GREG_GCONF_8259_PTHROU_DIS); |
1281 | 1281 | ||
1282 | if (mpic->flags & MPIC_NO_BIAS) | ||
1283 | mpic_write(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0), | ||
1284 | mpic_read(mpic->gregs, MPIC_INFO(GREG_GLOBAL_CONF_0)) | ||
1285 | | MPIC_GREG_GCONF_NO_BIAS); | ||
1286 | |||
1282 | /* Set current processor priority to 0 */ | 1287 | /* Set current processor priority to 0 */ |
1283 | mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0); | 1288 | mpic_cpu_write(MPIC_INFO(CPU_CURRENT_TASK_PRI), 0); |
1284 | 1289 | ||
diff --git a/include/asm-powerpc/mpic.h b/include/asm-powerpc/mpic.h index e7ac8109b6e7..943c5a3fac8a 100644 --- a/include/asm-powerpc/mpic.h +++ b/include/asm-powerpc/mpic.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define MPIC_GREG_GLOBAL_CONF_0 0x00020 | 22 | #define MPIC_GREG_GLOBAL_CONF_0 0x00020 |
23 | #define MPIC_GREG_GCONF_RESET 0x80000000 | 23 | #define MPIC_GREG_GCONF_RESET 0x80000000 |
24 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 | 24 | #define MPIC_GREG_GCONF_8259_PTHROU_DIS 0x20000000 |
25 | #define MPIC_GREG_GCONF_NO_BIAS 0x10000000 | ||
25 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff | 26 | #define MPIC_GREG_GCONF_BASE_MASK 0x000fffff |
26 | #define MPIC_GREG_GCONF_MCK 0x08000000 | 27 | #define MPIC_GREG_GCONF_MCK 0x08000000 |
27 | #define MPIC_GREG_GLOBAL_CONF_1 0x00030 | 28 | #define MPIC_GREG_GLOBAL_CONF_1 0x00030 |
@@ -350,6 +351,8 @@ struct mpic | |||
350 | #define MPIC_LARGE_VECTORS 0x00000100 | 351 | #define MPIC_LARGE_VECTORS 0x00000100 |
351 | /* Enable delivery of prio 15 interrupts as MCK instead of EE */ | 352 | /* Enable delivery of prio 15 interrupts as MCK instead of EE */ |
352 | #define MPIC_ENABLE_MCK 0x00000200 | 353 | #define MPIC_ENABLE_MCK 0x00000200 |
354 | /* Disable bias among target selection, spread interrupts evenly */ | ||
355 | #define MPIC_NO_BIAS 0x00000400 | ||
353 | 356 | ||
354 | /* MPIC HW modification ID */ | 357 | /* MPIC HW modification ID */ |
355 | #define MPIC_REGSET_MASK 0xf0000000 | 358 | #define MPIC_REGSET_MASK 0xf0000000 |