Commit:     aac2e68481681a362ab6f44fc515034e2a4c7f2c
Parent:     5cc44e086d7a4e20035997ec612678ca91f426e7
Author:     Christian Krafft <[EMAIL PROTECTED]>
AuthorDate: Thu Aug 30 01:33:53 2007 +0200
Committer:  Arnd Bergmann <[EMAIL PROTECTED]>
CommitDate: Thu Aug 30 01:35:05 2007 +0200

    [POWERPC] spu_manage: fix spu_unit_number for celleb device tree
    This fixes a regression introduced with 2.6.23-rc4 after on some
    confusion about the device tree interfaces.
    IBM QS21 device trees provide "physical-id", so we changed the code to
    run on that and remain compatible with all IBM machines.
    However, the Toshiba Celleb device tree provides the "unit-id" property,
    which was in the Linux code, but never used in this way on IBM hardware.
    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]>
    Signed-off-by: Arnd Bergmann <[EMAIL PROTECTED]>
    Cc: Jeremy Kerr <[EMAIL PROTECTED]>
 arch/powerpc/platforms/cell/spu_manage.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/platforms/cell/spu_manage.c 
index 7c0668a..0e14f53 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -48,10 +48,18 @@ static u64 __init find_spu_unit_number(struct device_node 
        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;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to