aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorGeoff Levand <geoffrey.levand@am.sony.com>2006-06-19 14:33:30 -0400
committerPaul Mackerras <paulus@samba.org>2006-06-21 01:01:31 -0400
commita91942ae7ebd518006dcbeb2a1d7b147253c080e (patch)
tree74a923f4847495b509089d92010c42c0cb123f4a /arch/powerpc
parent540270d82db943855538cea5d0c790e7e669dda0 (diff)
[POWERPC] spufs: fix spu irq affinity setting
This changes the hypervisor abstraction of setting cpu affinity to a higher level to avoid platform dependent interrupt controller routines. I replaced spu_priv1_ops:spu_int_route_set() with a new routine spu_priv1_ops:spu_cpu_affinity_set(). As a by-product, this change eliminated what looked like an existing bug in the set affinity code where spu_int_route_set() mistakenly called int_stat_get(). Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/platforms/cell/spu_base.c8
-rw-r--r--arch/powerpc/platforms/cell/spu_priv1_mmio.c8
-rw-r--r--arch/powerpc/platforms/cell/spufs/sched.c3
3 files changed, 8 insertions, 11 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c
index c3bb7299c4b5..8ca22394e4d3 100644
--- a/arch/powerpc/platforms/cell/spu_base.c
+++ b/arch/powerpc/platforms/cell/spu_base.c
@@ -522,14 +522,6 @@ int spu_irq_class_1_bottom(struct spu *spu)
522 return ret; 522 return ret;
523} 523}
524 524
525void spu_irq_setaffinity(struct spu *spu, int cpu)
526{
527 u64 target = iic_get_target_id(cpu);
528 u64 route = target << 48 | target << 32 | target << 16;
529 spu_int_route_set(spu, route);
530}
531EXPORT_SYMBOL_GPL(spu_irq_setaffinity);
532
533static int __init find_spu_node_id(struct device_node *spe) 525static int __init find_spu_node_id(struct device_node *spe)
534{ 526{
535 unsigned int *id; 527 unsigned int *id;
diff --git a/arch/powerpc/platforms/cell/spu_priv1_mmio.c b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
index abe8a84925d2..71b69f0a1a48 100644
--- a/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ b/arch/powerpc/platforms/cell/spu_priv1_mmio.c
@@ -24,6 +24,8 @@
24#include <asm/spu.h> 24#include <asm/spu.h>
25#include <asm/spu_priv1.h> 25#include <asm/spu_priv1.h>
26 26
27#include "interrupt.h"
28
27static void int_mask_and(struct spu *spu, int class, u64 mask) 29static void int_mask_and(struct spu *spu, int class, u64 mask)
28{ 30{
29 u64 old_mask; 31 u64 old_mask;
@@ -60,8 +62,10 @@ static u64 int_stat_get(struct spu *spu, int class)
60 return in_be64(&spu->priv1->int_stat_RW[class]); 62 return in_be64(&spu->priv1->int_stat_RW[class]);
61} 63}
62 64
63static void int_route_set(struct spu *spu, u64 route) 65static void cpu_affinity_set(struct spu *spu, int cpu)
64{ 66{
67 u64 target = iic_get_target_id(cpu);
68 u64 route = target << 48 | target << 32 | target << 16;
65 out_be64(&spu->priv1->int_route_RW, route); 69 out_be64(&spu->priv1->int_route_RW, route);
66} 70}
67 71
@@ -138,7 +142,7 @@ const struct spu_priv1_ops spu_priv1_mmio_ops =
138 .int_mask_get = int_mask_get, 142 .int_mask_get = int_mask_get,
139 .int_stat_clear = int_stat_clear, 143 .int_stat_clear = int_stat_clear,
140 .int_stat_get = int_stat_get, 144 .int_stat_get = int_stat_get,
141 .int_route_set = int_route_set, 145 .cpu_affinity_set = cpu_affinity_set,
142 .mfc_dar_get = mfc_dar_get, 146 .mfc_dar_get = mfc_dar_get,
143 .mfc_dsisr_get = mfc_dsisr_get, 147 .mfc_dsisr_get = mfc_dsisr_get,
144 .mfc_dsisr_set = mfc_dsisr_set, 148 .mfc_dsisr_set = mfc_dsisr_set,
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c
index bf652cd77000..3dcc5d8d66b9 100644
--- a/arch/powerpc/platforms/cell/spufs/sched.c
+++ b/arch/powerpc/platforms/cell/spufs/sched.c
@@ -43,6 +43,7 @@
43#include <asm/mmu_context.h> 43#include <asm/mmu_context.h>
44#include <asm/spu.h> 44#include <asm/spu.h>
45#include <asm/spu_csa.h> 45#include <asm/spu_csa.h>
46#include <asm/spu_priv1.h>
46#include "spufs.h" 47#include "spufs.h"
47 48
48#define SPU_MIN_TIMESLICE (100 * HZ / 1000) 49#define SPU_MIN_TIMESLICE (100 * HZ / 1000)
@@ -363,7 +364,7 @@ int spu_activate(struct spu_context *ctx, u64 flags)
363 * We're likely to wait for interrupts on the same 364 * We're likely to wait for interrupts on the same
364 * CPU that we are now on, so send them here. 365 * CPU that we are now on, so send them here.
365 */ 366 */
366 spu_irq_setaffinity(spu, raw_smp_processor_id()); 367 spu_cpu_affinity_set(spu, raw_smp_processor_id());
367 put_active_spu(spu); 368 put_active_spu(spu);
368 return 0; 369 return 0;
369} 370}