linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: arnd@arndb.de
To: paulus@samba.org
Cc: linuxppc-dev@ozlabs.org, cbe-oss-dev@ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: [patch 15/20] spufs: fix spu irq affinity setting
Date: Mon, 19 Jun 2006 20:33:30 +0200	[thread overview]
Message-ID: <20060619183406.169490000@klappe.arndb.de> (raw)
In-Reply-To: 20060619183315.653672000@klappe.arndb.de

From: Geoff Levand <geoffrey.levand@am.sony.com>

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>

Index: powerpc.git/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- powerpc.git.orig/arch/powerpc/platforms/cell/spu_base.c
+++ powerpc.git/arch/powerpc/platforms/cell/spu_base.c
@@ -522,14 +522,6 @@ int spu_irq_class_1_bottom(struct spu *s
 	return ret;
 }
 
-void spu_irq_setaffinity(struct spu *spu, int cpu)
-{
-	u64 target = iic_get_target_id(cpu);
-	u64 route = target << 48 | target << 32 | target << 16;
-	spu_int_route_set(spu, route);
-}
-EXPORT_SYMBOL_GPL(spu_irq_setaffinity);
-
 static int __init find_spu_node_id(struct device_node *spe)
 {
 	unsigned int *id;
Index: powerpc.git/arch/powerpc/platforms/cell/spu_priv1_mmio.c
===================================================================
--- powerpc.git.orig/arch/powerpc/platforms/cell/spu_priv1_mmio.c
+++ powerpc.git/arch/powerpc/platforms/cell/spu_priv1_mmio.c
@@ -24,6 +24,8 @@
 #include <asm/spu.h>
 #include <asm/spu_priv1.h>
 
+#include "interrupt.h"
+
 static void int_mask_and(struct spu *spu, int class, u64 mask)
 {
 	u64 old_mask;
@@ -60,8 +62,10 @@ static u64 int_stat_get(struct spu *spu,
 	return in_be64(&spu->priv1->int_stat_RW[class]);
 }
 
-static void int_route_set(struct spu *spu, u64 route)
+static void cpu_affinity_set(struct spu *spu, int cpu)
 {
+	u64 target = iic_get_target_id(cpu);
+	u64 route = target << 48 | target << 32 | target << 16;
 	out_be64(&spu->priv1->int_route_RW, route);
 }
 
@@ -138,7 +142,7 @@ const struct spu_priv1_ops spu_priv1_mmi
 	.int_mask_get = int_mask_get,
 	.int_stat_clear = int_stat_clear,
 	.int_stat_get = int_stat_get,
-	.int_route_set = int_route_set,
+	.cpu_affinity_set = cpu_affinity_set,
 	.mfc_dar_get = mfc_dar_get,
 	.mfc_dsisr_get = mfc_dsisr_get,
 	.mfc_dsisr_set = mfc_dsisr_set,
Index: powerpc.git/arch/powerpc/platforms/cell/spufs/sched.c
===================================================================
--- powerpc.git.orig/arch/powerpc/platforms/cell/spufs/sched.c
+++ powerpc.git/arch/powerpc/platforms/cell/spufs/sched.c
@@ -43,6 +43,7 @@
 #include <asm/mmu_context.h>
 #include <asm/spu.h>
 #include <asm/spu_csa.h>
+#include <asm/spu_priv1.h>
 #include "spufs.h"
 
 #define SPU_MIN_TIMESLICE 	(100 * HZ / 1000)
@@ -363,7 +364,7 @@ int spu_activate(struct spu_context *ctx
 	 * We're likely to wait for interrupts on the same
 	 * CPU that we are now on, so send them here.
 	 */
-	spu_irq_setaffinity(spu, raw_smp_processor_id());
+	spu_cpu_affinity_set(spu, raw_smp_processor_id());
 	put_active_spu(spu);
 	return 0;
 }
Index: powerpc.git/include/asm-powerpc/spu_priv1.h
===================================================================
--- powerpc.git.orig/include/asm-powerpc/spu_priv1.h
+++ powerpc.git/include/asm-powerpc/spu_priv1.h
@@ -33,7 +33,7 @@ struct spu_priv1_ops
 	u64 (*int_mask_get) (struct spu *spu, int class);
 	void (*int_stat_clear) (struct spu *spu, int class, u64 stat);
 	u64 (*int_stat_get) (struct spu *spu, int class);
-	void (*int_route_set) (struct spu *spu, u64 route);
+	void (*cpu_affinity_set) (struct spu *spu, int cpu);
 	u64 (*mfc_dar_get) (struct spu *spu);
 	u64 (*mfc_dsisr_get) (struct spu *spu);
 	void (*mfc_dsisr_set) (struct spu *spu, u64 dsisr);
@@ -88,9 +88,9 @@ spu_int_stat_get (struct spu *spu, int c
 }
 
 static inline void
-spu_int_route_set (struct spu *spu, u64 route)
+spu_cpu_affinity_set (struct spu *spu, int cpu)
 {
-	spu_priv1_ops->int_stat_get(spu, route);
+	spu_priv1_ops->cpu_affinity_set(spu, cpu);
 }
 
 static inline u64

--

  parent reply	other threads:[~2006-06-19 18:33 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-19 18:33 [patch 00/20] cell: patches for 2.6.18 arnd
2006-06-19 18:33 ` [patch 01/20] cell: add RAS support arnd
2006-06-20 15:43   ` [Cbe-oss-dev] " Olof Johansson
2006-06-20 16:26     ` Arnd Bergmann
2006-06-20 17:50       ` Olof Johansson
2006-06-20 19:00         ` Geoff Levand
2006-06-21  1:46     ` Benjamin Herrenschmidt
2006-06-19 18:33 ` [patch 02/20] cell: fix interrupt priority handling arnd
2006-06-19 18:33 ` [patch 03/20] cell: update defconfig arnd
2006-06-19 18:33 ` [patch 04/20] cell: register SPUs as sysdevs arnd
2006-06-19 18:33 ` [patch 05/20] cell: always build spu base into the kernel arnd
2006-06-19 18:33 ` [patch 06/20] spufs: restore mapping of mssync register arnd
2006-06-19 18:33 ` [patch 07/20] spufs: fix deadlock in spu_create error path arnd
2006-06-20  1:16   ` Michael Ellerman
2006-06-19 18:33 ` [patch 08/20] spufs: set up correct SLB entries for 64k pages arnd
2006-06-19 18:33 ` [patch 09/20] spufs: add a phys-id attribute to each SPU context arnd
2006-06-19 18:33 ` [patch 10/20] spufs: fix initial state of wbox file arnd
2006-06-19 18:33 ` [patch 11/20] spufs: use kzalloc in create_spu arnd
2006-06-19 18:33 ` [patch 12/20] spufs: dont try to access SPE channel 1 count arnd
2006-06-19 18:33 ` [patch 13/20] spufs: split the Cell BE support into generic and platform dependant parts arnd
2006-06-19 18:33 ` [patch 14/20] spufs: further abstract priv1 register access arnd
2006-06-19 18:33 ` arnd [this message]
2006-06-19 18:33 ` [patch 16/20] spufs: remove stop_code from struct spu arnd
2006-06-19 18:33 ` [patch 17/20] spufs: fix Makefile for "make clean" arnd
2006-06-19 18:33 ` [patch 18/20] spufs: clear class2 interrupt status before wakeup arnd
2006-06-19 18:33 ` [patch 19/20] spufs: fail spu_create with invalid flags arnd
2006-06-19 18:33 ` [patch 20/20] spufs: one more fix for 64k pages arnd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060619183406.169490000@klappe.arndb.de \
    --to=arnd@arndb.de \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).