diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2007-04-23 15:08:29 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@klappe.arndb.de> | 2007-04-23 15:19:00 -0400 |
commit | ccf17e9d008dfebbf90dfa4ee1a56e81c784c73e (patch) | |
tree | 9d33f1e33f49b1ec82af24a3d8ab65750936f97a /arch/powerpc | |
parent | befdc746ee027d686a06be29cb1391f9d2c45cf6 (diff) |
[POWERPC] spu_base: fix initialisation on systems with no SPEs
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>
Signed-off-by: Arnd Bergmann <arnd.bergmann@de.ibm.com>
arch/powerpc/platforms/cell/spu_base.c | 7 ++++---
arch/powerpc/platforms/cell/spufs/inode.c | 5 +++++
2 files changed, 9 insertions(+), 3 deletions(-)
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 8 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 5 |
2 files changed, 10 insertions, 3 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 2e8aa9433b3b..8086eb1ed60d 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -36,6 +36,8 @@ | |||
36 | #include <asm/xmon.h> | 36 | #include <asm/xmon.h> |
37 | 37 | ||
38 | const struct spu_management_ops *spu_management_ops; | 38 | const struct spu_management_ops *spu_management_ops; |
39 | EXPORT_SYMBOL_GPL(spu_management_ops); | ||
40 | |||
39 | const struct spu_priv1_ops *spu_priv1_ops; | 41 | const struct spu_priv1_ops *spu_priv1_ops; |
40 | 42 | ||
41 | static struct list_head spu_list[MAX_NUMNODES]; | 43 | static struct list_head spu_list[MAX_NUMNODES]; |
@@ -589,6 +591,9 @@ static int __init init_spu_base(void) | |||
589 | { | 591 | { |
590 | int i, ret = 0; | 592 | int i, ret = 0; |
591 | 593 | ||
594 | for (i = 0; i < MAX_NUMNODES; i++) | ||
595 | INIT_LIST_HEAD(&spu_list[i]); | ||
596 | |||
592 | if (!spu_management_ops) | 597 | if (!spu_management_ops) |
593 | goto out; | 598 | goto out; |
594 | 599 | ||
@@ -597,9 +602,6 @@ static int __init init_spu_base(void) | |||
597 | if (ret) | 602 | if (ret) |
598 | goto out; | 603 | goto out; |
599 | 604 | ||
600 | for (i = 0; i < MAX_NUMNODES; i++) | ||
601 | INIT_LIST_HEAD(&spu_list[i]); | ||
602 | |||
603 | ret = spu_enumerate_spus(create_spu); | 605 | ret = spu_enumerate_spus(create_spu); |
604 | 606 | ||
605 | if (ret) { | 607 | if (ret) { |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 8f6cd8763306..13e4f70ec8c0 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <asm/prom.h> | 36 | #include <asm/prom.h> |
37 | #include <asm/semaphore.h> | 37 | #include <asm/semaphore.h> |
38 | #include <asm/spu.h> | 38 | #include <asm/spu.h> |
39 | #include <asm/spu_priv1.h> | ||
39 | #include <asm/uaccess.h> | 40 | #include <asm/uaccess.h> |
40 | 41 | ||
41 | #include "spufs.h" | 42 | #include "spufs.h" |
@@ -665,6 +666,10 @@ static int __init spufs_init(void) | |||
665 | { | 666 | { |
666 | int ret; | 667 | int ret; |
667 | 668 | ||
669 | ret = -ENODEV; | ||
670 | if (!spu_management_ops) | ||
671 | goto out; | ||
672 | |||
668 | ret = -ENOMEM; | 673 | ret = -ENOMEM; |
669 | spufs_inode_cache = kmem_cache_create("spufs_inode_cache", | 674 | spufs_inode_cache = kmem_cache_create("spufs_inode_cache", |
670 | sizeof(struct spufs_inode_info), 0, | 675 | sizeof(struct spufs_inode_info), 0, |