[PATCH 08/14] cell: enable pause(0) in cpu_idle

Milton Miller miltonm at bga.com
Sat Dec 10 04:09:13 EST 2005


On Dec 9, 2005, at 10:10 AM, Arnd Bergmann wrote:

> On Middeweken 07 Dezember 2005 18:28, Milton Miller wrote:
>> Hi Arnd.   Quite a few comments on this one.
>
> Unfortunately, I can't test my changes here, because I'm still on
> second generation hardware, while the code is written for the current
> DD3.x CPUs. I hope Max can help me with some of this.
>
> I'll send an updated patch for this to address your comments. It
> will also have an update to not use pause(0) at all on DD2.x hardware.

...

>>> +       /* Enable DEC and EE interrupt request */
>>> +       thread_switch_control  = mfspr(SPRN_TSC_CELL);
>>> +       thread_switch_control |= TSCR_EE_ENABLE | TSCR_EE_BOOST;
>>> +
>>> +       if (smp_processor_id()%2)
>>
>> smp_processor_id is software number, and does not necessarily
>> correspond to the hardware thread id.   Either use the hw
>> version, or better yet, read the PIR (spr 1023?) directly.
>
> Hmm, who sets up the PIR? It would definitely be better to use
> that for getting reliable information (e.g. when not using SMT),
> but I'm not sure if PIR is available or correct on our boards.

Since this assumption is throughout the code, I won't insist using PIR.

>
>>> +static struct pmd_regs __iomem *find_pmd_mmio(int cpu)
>>> +{
>>> +       struct device_node *node;
>>> +       int node_number = cpu / 2;
>>
>> hmm... so # threads / node hard coded in here ...
>
> Yes, it really shouldn't, but we couldn't find a good way
> around this. The association between logical CPUs, nodes and
> threads is done through the ibm,ppc-interrupt-server#s
> property of a CPU device node, right?
> But how can I get back from a logical CPU number to the
> thread number?

Use hard_smp_processor_id() in smp.h, which gives you a number
retrieved from the device tree and used to start the thread.

>
> Thanks for reviewing this.
>
Your welcome.

milton




More information about the Linuxppc64-dev mailing list