[PATCH] windfarm: add PowerMac 12,1 support

Benjamin Herrenschmidt benh at kernel.crashing.org
Sun Mar 23 10:25:41 EST 2008


On Sat, 2008-03-22 at 23:14 +0000, David Woodhouse wrote:
> On Sat, 2008-03-22 at 23:02 +0000, David Woodhouse wrote:
> > 
> > Yeah, there's weird shit going on with the sensor/control
> > registration.
> > I think GCC is be miscompiling it -- the sequence of
> >         all = all && pm121_register_control(foo...);
> >         all = all && pm121_register_control(bar...);
> > is bailing out as soon as 'all' gets set to zero. Despite the fact
> > that pm121_register_control() quite blatantly has side-effects.

And it's just supposed to do that no ?

Ben.

> That's after I fix the names in pm121_new_control() and fix
> pm121_register_control() to set controls[id] instead of always setting
> controls[FAN_OD], btw. Without that I don't think it could ever have
> worked. 
> 
> But it's still broken. I'll try to cut it down and file a GCC bug...
> 
> .pm121_new_control:
> .LFB929:
>         .loc 1 883 0
> .LVL44:
>         mflr 0
> .LCFI38:
>         std 0,16(1)
> .LCFI39:
>         std 30,-16(1)
> .LCFI40:
>         std 31,-8(1)
> .LCFI41:
>         stdu 1,-128(1)
> .LCFI42:
>         ld 30,.LCTOC0 at toc(2)
>         mr 31,3
>         .loc 1 886 0
>         ld 9,.LC47-.LCTOC1(30)
>         lwz 0,48(9)
>         cmpwi 7,0,0
>         bne 7,.L31
> .LVL45:
>         .loc 1 889 0
>         ld 4,.LC49-.LCTOC1(30)
>         li 5,2
>         bl .pm121_register_control
>         cmpdi 7,3,0
>         beq 7,.L31
>         .loc 1 890 0
>         mr 3,31
>         ld 4,.LC51-.LCTOC1(30)
>         li 5,1
>         bl .pm121_register_control
>         cmpdi 7,3,0
>         beq 7,.L31
>         .loc 1 891 0
>         mr 3,31
>         ld 4,.LC53-.LCTOC1(30)
>         li 5,0
>         bl .pm121_register_control
>         cmpdi 7,3,0
>         beq 7,.L31
>         .loc 1 892 0
>         mr 3,31
>         ld 4,.LC55-.LCTOC1(30)
>         li 5,3
>         bl .pm121_register_control
>         cmpdi 7,3,0
>         beq 7,.L31
>         .loc 1 895 0
>         ld 3,.LC57-.LCTOC1(30)
>         bl .printk
>         nop
>         .loc 1 896 0
>         ld 9,.LC47-.LCTOC1(30)
>         li 0,1
>         stw 0,48(9)
> .LVL46:
> .L31:
>         .loc 1 898 0
>         addi 1,1,128
>         ld 0,16(1)
>         mtlr 0
>         ld 30,-16(1)
>         ld 31,-8(1)
> .LVL47:
>         blr
> 
> 
> 




More information about the Linuxppc-dev mailing list