Commit 861be32c authored by Geoff Levand's avatar Geoff Levand Committed by Paul Mackerras

[POWERPC] ps3: bind interrupt to cpu

Change the PS3 irq allocation routines to take an argument indicating which
cpu (processor thread) the interrupt should be serviced on.

The current system configuration favors device interrupts that are serviced
on cpu0, so that is used as the default.
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Acked-by: default avatarArnd Bergmann <arnd.bergmann@de.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 9cf9e196
This diff is collapsed.
...@@ -111,7 +111,7 @@ static void __init ps3_smp_setup_cpu(int cpu) ...@@ -111,7 +111,7 @@ static void __init ps3_smp_setup_cpu(int cpu)
BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3); BUILD_BUG_ON(PPC_MSG_DEBUGGER_BREAK != 3);
for (i = 0; i < MSG_COUNT; i++) { for (i = 0; i < MSG_COUNT; i++) {
result = ps3_alloc_event_irq(&virqs[i]); result = ps3_alloc_event_irq(cpu, &virqs[i]);
if (result) if (result)
continue; continue;
......
...@@ -267,20 +267,20 @@ static int __init setup_interrupts(struct spu *spu) ...@@ -267,20 +267,20 @@ static int __init setup_interrupts(struct spu *spu)
{ {
int result; int result;
result = ps3_alloc_spe_irq(spu_pdata(spu)->spe_id, 0, result = ps3_alloc_spe_irq(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
&spu->irqs[0]); 0, &spu->irqs[0]);
if (result) if (result)
goto fail_alloc_0; goto fail_alloc_0;
result = ps3_alloc_spe_irq(spu_pdata(spu)->spe_id, 1, result = ps3_alloc_spe_irq(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
&spu->irqs[1]); 1, &spu->irqs[1]);
if (result) if (result)
goto fail_alloc_1; goto fail_alloc_1;
result = ps3_alloc_spe_irq(spu_pdata(spu)->spe_id, 2, result = ps3_alloc_spe_irq(PS3_BINDING_CPU_ANY, spu_pdata(spu)->spe_id,
&spu->irqs[2]); 2, &spu->irqs[2]);
if (result) if (result)
goto fail_alloc_2; goto fail_alloc_2;
......
...@@ -783,8 +783,8 @@ static int ps3_vuart_probe(struct device *_dev) ...@@ -783,8 +783,8 @@ static int ps3_vuart_probe(struct device *_dev)
vuart_private.in_use++; vuart_private.in_use++;
if (vuart_private.in_use == 1) { if (vuart_private.in_use == 1) {
result = ps3_alloc_vuart_irq((void*)&vuart_private.bmp.status, result = ps3_alloc_vuart_irq(PS3_BINDING_CPU_ANY,
&vuart_private.virq); (void*)&vuart_private.bmp.status, &vuart_private.virq);
if (result) { if (result) {
dev_dbg(&dev->core, dev_dbg(&dev->core,
......
...@@ -140,19 +140,28 @@ unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr); ...@@ -140,19 +140,28 @@ unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr);
/* inrerrupt routines */ /* inrerrupt routines */
int ps3_alloc_io_irq(unsigned int interrupt_id, unsigned int *virq); enum ps3_cpu_binding {
PS3_BINDING_CPU_ANY = -1,
PS3_BINDING_CPU_0 = 0,
PS3_BINDING_CPU_1 = 1,
};
int ps3_alloc_io_irq(enum ps3_cpu_binding cpu, unsigned int interrupt_id,
unsigned int *virq);
int ps3_free_io_irq(unsigned int virq); int ps3_free_io_irq(unsigned int virq);
int ps3_alloc_event_irq(unsigned int *virq); int ps3_alloc_event_irq(enum ps3_cpu_binding cpu, unsigned int *virq);
int ps3_free_event_irq(unsigned int virq); int ps3_free_event_irq(unsigned int virq);
int ps3_send_event_locally(unsigned int virq); int ps3_send_event_locally(unsigned int virq);
int ps3_connect_event_irq(const struct ps3_device_id *did, int ps3_connect_event_irq(enum ps3_cpu_binding cpu,
unsigned int interrupt_id, unsigned int *virq); const struct ps3_device_id *did, unsigned int interrupt_id,
unsigned int *virq);
int ps3_disconnect_event_irq(const struct ps3_device_id *did, int ps3_disconnect_event_irq(const struct ps3_device_id *did,
unsigned int interrupt_id, unsigned int virq); unsigned int interrupt_id, unsigned int virq);
int ps3_alloc_vuart_irq(void* virt_addr_bmp, unsigned int *virq); int ps3_alloc_vuart_irq(enum ps3_cpu_binding cpu, void* virt_addr_bmp,
int ps3_free_vuart_irq(unsigned int virq);
int ps3_alloc_spe_irq(unsigned long spe_id, unsigned int class,
unsigned int *virq); unsigned int *virq);
int ps3_free_vuart_irq(unsigned int virq);
int ps3_alloc_spe_irq(enum ps3_cpu_binding cpu, unsigned long spe_id,
unsigned int class, unsigned int *virq);
int ps3_free_spe_irq(unsigned int virq); int ps3_free_spe_irq(unsigned int virq);
/* lv1 result codes */ /* lv1 result codes */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment