linux-mips
[Top] [All Lists]

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

To: Hillf Danton <dhillf@gmail.com>
Subject: Re: [RFC] mark Netlogic XLR chip as SMT capable
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 3 Oct 2011 11:32:04 +0100
Cc: "Jayachandran C." <jayachandranc@netlogicmicro.com>, linux-mips@linux-mips.org
In-reply-to: <CAJd=RBBt0xNgUrz9XnU0TcHo443t3j323zYg8jMPYRjXsV=EHw@mail.gmail.com>
References: <CAJd=RBAc8Zv1JZfrAx2Ajj7fdJv=oA+eYHVBLfcFNOoZNyG7fg@mail.gmail.com> <20111002083044.GA23668@jayachandranc.netlogicmicro.com> <CAJd=RBBt0xNgUrz9XnU0TcHo443t3j323zYg8jMPYRjXsV=EHw@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
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.

  Ralf

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