linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/4] cell: fix initialisation on systems with no SPEs
@ 2007-04-13  1:48 Jeremy Kerr
  2007-04-13  7:08 ` [Cbe-oss-dev] " Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Jeremy Kerr @ 2007-04-13  1:48 UTC (permalink / raw)
  To: cbe-oss-dev, linuxppc-dev

This change fixes the case where spu_base and spufs are initialised on a
system with no SPEs - unconditionally create the spu_lists so spu_alloc
doesn't explode, and check for spu_management ops before starting spufs.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>

 arch/powerpc/platforms/cell/spu_base.c    |    7 ++++---
 arch/powerpc/platforms/cell/spufs/inode.c |    5 +++++
 2 files changed, 9 insertions(+), 3 deletions(-)

Index: linux-2.6-spufs/arch/powerpc/platforms/cell/spu_base.c
===================================================================
--- linux-2.6-spufs.orig/arch/powerpc/platforms/cell/spu_base.c
+++ linux-2.6-spufs/arch/powerpc/platforms/cell/spu_base.c
@@ -43,6 +43,7 @@ static LIST_HEAD(spu_full_list);
 static DEFINE_MUTEX(spu_mutex);
 static spinlock_t spu_list_lock = SPIN_LOCK_UNLOCKED;
 
+EXPORT_SYMBOL_GPL(spu_management_ops);
 EXPORT_SYMBOL_GPL(spu_priv1_ops);
 
 void spu_invalidate_slbs(struct spu *spu)
@@ -723,6 +724,9 @@ static int __init init_spu_base(void)
 {
 	int i, ret;
 
+	for (i = 0; i < MAX_NUMNODES; i++)
+		INIT_LIST_HEAD(&spu_list[i]);
+
 	if (!spu_management_ops)
 		return 0;
 
@@ -731,9 +735,6 @@ static int __init init_spu_base(void)
 	if (ret)
 		return ret;
 
-	for (i = 0; i < MAX_NUMNODES; i++)
-		INIT_LIST_HEAD(&spu_list[i]);
-
 	ret = spu_enumerate_spus(create_spu);
 
 	if (ret) {
Index: linux-2.6-spufs/arch/powerpc/platforms/cell/spufs/inode.c
===================================================================
--- linux-2.6-spufs.orig/arch/powerpc/platforms/cell/spufs/inode.c
+++ linux-2.6-spufs/arch/powerpc/platforms/cell/spufs/inode.c
@@ -36,6 +36,7 @@
 #include <asm/prom.h>
 #include <asm/semaphore.h>
 #include <asm/spu.h>
+#include <asm/spu_priv1.h>
 #include <asm/uaccess.h>
 
 #include "spufs.h"
@@ -653,6 +654,10 @@ static int __init spufs_init(void)
 {
 	int ret;
 
+	ret = -ENODEV;
+	if (!spu_management_ops)
+		goto out;
+
 	ret = -ENOMEM;
 	spufs_inode_cache = kmem_cache_create("spufs_inode_cache",
 			sizeof(struct spufs_inode_info), 0,

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Cbe-oss-dev] [PATCH 3/4] cell: fix initialisation on systems with no SPEs
  2007-04-13  1:48 [PATCH 3/4] cell: fix initialisation on systems with no SPEs Jeremy Kerr
@ 2007-04-13  7:08 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2007-04-13  7:08 UTC (permalink / raw)
  To: Jeremy Kerr; +Cc: linuxppc-dev, cbe-oss-dev

On Fri, Apr 13, 2007 at 11:48:59AM +1000, Jeremy Kerr wrote:
> This change fixes the case where spu_base and spufs are initialised on a
> system with no SPEs - unconditionally create the spu_lists so spu_alloc
> doesn't explode, and check for spu_management ops before starting spufs.

Ok.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-13  7:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-13  1:48 [PATCH 3/4] cell: fix initialisation on systems with no SPEs Jeremy Kerr
2007-04-13  7:08 ` [Cbe-oss-dev] " Christoph Hellwig

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).