2007-08-23 17:04:48

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [Cbe-oss-dev] [patch 1/5] spu_manage: use newer physical-id

On Thursday 23 August 2007, [email protected] wrote:
> Please check "unit-id" if "physical-id" doesn't exist. Because Celleb
> uses "unit-id" to provide spe_id.

Ok, I need to discuss this with Christian then, to make sure we get to
a version that works everywhere. Paul, please ignore this patch for now.

I've update the git repository to only have the other four patches.

Arnd <><


2007-08-28 14:21:04

by Christian Krafft

[permalink] [raw]
Subject: Re: [Cbe-oss-dev] [patch 1/5] spu_manage: use newer physical-id

On Thu, 23 Aug 2007 18:12:19 +0200
Arnd Bergmann <[email protected]> wrote:

> On Thursday 23 August 2007, [email protected] wrote:
> > Please check "unit-id" if "physical-id" doesn't exist. Because Celleb
> > uses "unit-id" to provide spe_id.

Sorry for the late answer, wasn't on cc
and had to receive all mails of the last 6 month once again :-(

Can you check if the patch below is working with celleb device tree ?

------
Subject: spu_manage: fix spu_unit_number for celleb device tree

From: Christian Krafft <[email protected]>

New device trees provide "physical-id".
Celleb device tree provide the "unit-id".
Legacy device tree used the reg property for the physical id of an spe.
This patch fixes find_spu_unit_number to look for the spu id in that order.
The length is checked to avoid misinterpretation in case the attributes
unit-id or reg do not contain the id.

Signed-off-by: Christian Krafft <[email protected]>

Index: linux/arch/powerpc/platforms/cell/spu_manage.c
===================================================================
--- linux.orig/arch/powerpc/platforms/cell/spu_manage.c
+++ linux/arch/powerpc/platforms/cell/spu_manage.c
@@ -48,10 +48,18 @@ static u64 __init find_spu_unit_number(s
{
const unsigned int *prop;
int proplen;
+
+ /* new device trees should provide the physical-id attribute */
prop = of_get_property(spe, "physical-id", &proplen);
if (proplen == 4)
return (u64)*prop;

+ /* celleb device tree provides the unit-id */
+ prop = of_get_property(spe, "unit-id", &proplen);
+ if (proplen == 4)
+ return (u64)*prop;
+
+ /* legacy device trees provide the id in the reg attribute */
prop = of_get_property(spe, "reg", &proplen);
if (proplen == 4)
return (u64)*prop;


--
Mit freundlichen Gr?ssen,
kind regards,

Christian Krafft
IBM Systems & Technology Group,
Linux Kernel Development
IT Specialist

2007-08-29 09:26:54

by Kou Ishizaki

[permalink] [raw]
Subject: Re: [Cbe-oss-dev] [patch 1/5] spu_manage: use newer physical-id


Christian Krafft wrote:
> On Thu, 23 Aug 2007 18:12:19 +0200
> Arnd Bergmann <[email protected]> wrote:
>
> > On Thursday 23 August 2007, [email protected] wrote:
> > > Please check "unit-id" if "physical-id" doesn't exist. Because
Celleb
> > > uses "unit-id" to provide spe_id.
>
> Sorry for the late answer, wasn't on cc
> and had to receive all mails of the last 6 month once again :-(
>
> Can you check if the patch below is working with celleb device tree ?
>
> ------
> Subject: spu_manage: fix spu_unit_number for celleb device tree
>
> From: Christian Krafft <[email protected]>
>
> New device trees provide "physical-id".
> Celleb device tree provide the "unit-id".
> Legacy device tree used the reg property for the physical id of an
spe.
> This patch fixes find_spu_unit_number to look for the spu id in that
order.
> The length is checked to avoid misinterpretation in case the
attributes
> unit-id or reg do not contain the id.
>
> Signed-off-by: Christian Krafft <[email protected]>

Acked-by: Kou Ishizaki <[email protected]>

It works good on Celleb, thanks. Please apply it to 2.6.23.

Best regards,
Kou Ishizaki