linux-mips
[Top] [All Lists]

Re: [RFC] mark Netlogic XLR chip as SMT capable

To: Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [RFC] mark Netlogic XLR chip as SMT capable
From: Jayachandran C. <jayachandranc@netlogicmicro.com>
Date: Mon, 3 Oct 2011 16:09:36 +0530
Cc: Hillf Danton <dhillf@gmail.com>, <linux-mips@linux-mips.org>
In-reply-to: <20111003103204.GC6038@linux-mips.org>
References: <CAJd=RBAc8Zv1JZfrAx2Ajj7fdJv=oA+eYHVBLfcFNOoZNyG7fg@mail.gmail.com> <20111002083044.GA23668@jayachandranc.netlogicmicro.com> <CAJd=RBBt0xNgUrz9XnU0TcHo443t3j323zYg8jMPYRjXsV=EHw@mail.gmail.com> <20111003103204.GC6038@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Oct 03, 2011 at 11:32:04AM +0100, Ralf Baechle wrote:
> On Mon, Oct 03, 2011 at 01:46:46PM +0800, Hillf Danton wrote:
> 
> > +   unsigned int cpu, core_id;
> > +
> > +   cpu = smp_processor_id();
> > +   core_id = (cpu >> 2) & 0x7;
> > +   cpu_data[cpu].core = core_id;
> 
> This is going to break in setups where Linux is not being booted on
> what the hardware considers CPU core 0.  Which is not uncommon in embedded
> setups.  You may want to probe the hardware for the core ID rather than
> relying on smp_processor_id() here.

Yes, the function hard_smp_processor_id() from netlogic/mips-extns.h has to
be used here.

This also conflicts with the recent patch-set for XLP support, but I don't
know the status of that yet.

JC.

<Prev in Thread] Current Thread [Next in Thread>