diff options
author | Paul Mackerras <paulus@samba.org> | 2006-12-04 15:59:07 +1100 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-12-04 15:59:07 +1100 |
commit | 79acbb3ff2d8095b692e1502b9eb2ccec348de26 (patch) | |
tree | 6ab773e5a8f9de2cd6443362b21d0d6fffe3b35e /arch/powerpc/platforms/cell | |
parent | 19a79859e168640f8e16d7b216d211c1c52b687a (diff) | |
parent | 2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2 (diff) |
Merge branch 'linux-2.6' into for-linus
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/spu_base.c | 41 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/hw_ops.c | 2 |
3 files changed, 35 insertions, 10 deletions
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index 032bc923342..d5aeb3c6dd4 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c @@ -668,14 +668,19 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) for (i=0; i < 3; i++) { ret = of_irq_map_one(np, i, &oirq); - if (ret) + if (ret) { + pr_debug("spu_new: failed to get irq %d\n", i); goto err; - + } ret = -EINVAL; + pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0], + oirq.controller->full_name); spu->irqs[i] = irq_create_of_mapping(oirq.controller, oirq.specifier, oirq.size); - if (spu->irqs[i] == NO_IRQ) + if (spu->irqs[i] == NO_IRQ) { + pr_debug("spu_new: failed to map it !\n"); goto err; + } } return 0; @@ -694,7 +699,7 @@ static int spu_map_resource(struct device_node *node, int nr, struct resource resource = { }; int ret; - ret = of_address_to_resource(node, 0, &resource); + ret = of_address_to_resource(node, nr, &resource); if (ret) goto out; @@ -717,22 +722,42 @@ static int __init spu_map_device(struct spu *spu, struct device_node *node) ret = spu_map_resource(node, 0, (void __iomem**)&spu->local_store, &spu->local_store_phys); - if (ret) + if (ret) { + pr_debug("spu_new: failed to map %s resource 0\n", + node->full_name); goto out; + } ret = spu_map_resource(node, 1, (void __iomem**)&spu->problem, &spu->problem_phys); - if (ret) + if (ret) { + pr_debug("spu_new: failed to map %s resource 1\n", + node->full_name); goto out_unmap; + } ret = spu_map_resource(node, 2, (void __iomem**)&spu->priv2, NULL); - if (ret) + if (ret) { + pr_debug("spu_new: failed to map %s resource 2\n", + node->full_name); goto out_unmap; + } if (!firmware_has_feature(FW_FEATURE_LPAR)) ret = spu_map_resource(node, 3, (void __iomem**)&spu->priv1, NULL); - if (ret) + if (ret) { + pr_debug("spu_new: failed to map %s resource 3\n", + node->full_name); goto out_unmap; + } + pr_debug("spu_new: %s maps:\n", node->full_name); + pr_debug(" local store : 0x%016lx -> 0x%p\n", + spu->local_store_phys, spu->local_store); + pr_debug(" problem state : 0x%016lx -> 0x%p\n", + spu->problem_phys, spu->problem); + pr_debug(" priv2 : 0x%p\n", spu->priv2); + pr_debug(" priv1 : 0x%p\n", spu->priv1); + return 0; out_unmap: diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 5b8ba6c3aa3..0ea2361865a 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -385,7 +385,7 @@ static ssize_t spufs_mbox_read(struct file *file, char __user *buf, udata = (void __user *)buf; spu_acquire(ctx); - for (count = 0; count <= len; count += 4, udata++) { + for (count = 0; (count + 4) <= len; count += 4, udata++) { int ret; ret = ctx->ops->mbox_read(ctx, &mbox_data); if (ret == 0) diff --git a/arch/powerpc/platforms/cell/spufs/hw_ops.c b/arch/powerpc/platforms/cell/spufs/hw_ops.c index 2ad534a04be..59c87f12da5 100644 --- a/arch/powerpc/platforms/cell/spufs/hw_ops.c +++ b/arch/powerpc/platforms/cell/spufs/hw_ops.c @@ -147,7 +147,7 @@ static void spu_hw_signal1_write(struct spu_context *ctx, u32 data) static u32 spu_hw_signal2_read(struct spu_context *ctx) { - return in_be32(&ctx->spu->problem->signal_notify1); + return in_be32(&ctx->spu->problem->signal_notify2); } static void spu_hw_signal2_write(struct spu_context *ctx, u32 data) |