linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/6] ARM: smp: set thread_info->cpu to hardware CPU number for boot thread
Date: Mon, 08 Aug 2011 10:33:38 -0700	[thread overview]
Message-ID: <4E401DF2.10801@codeaurora.org> (raw)
In-Reply-To: <1312823424-9654-5-git-send-email-will.deacon@arm.com>

On 08/08/2011 10:10 AM, Will Deacon wrote:
>
>  
> +void __init smp_setup_processor_id(void)
> +{
> +	u32 mpidr;
> +
> +	/* Read the MPIDR to find the hardware ID of the current CPU. */
> +	asm("1:		mrc	p15, 0, %0, c0, c0, 5\n"
> +	    "		.pushsection \".alt.smp.init\", \"a\"\n"
> +	    "		.long	1b\n"
> +	    "		mov	%0, #0\n"
> +	    "		.popsection"
> +	    : "=r" (mpidr));

Would it be a good idea to put this into asm/cputype.h? I suppose the
smp alternatives part would need to be written in C.

    mpidr = is_smp() ? read_cpuid_mpidr() : 0;

>
> +
> +	current_thread_info()->cpu = mpidr & 0xff;
> +	printk("Booting Linux on CPU %d\n", current_thread_info()->cpu);
> +}
> +

Should there be a KERN_INFO there?

-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.

  reply	other threads:[~2011-08-08 17:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08 17:10 [PATCH 0/6] Miscellaneous patches for 3.1 and 3.2 Will Deacon
2011-08-08 17:10 ` [PATCH 1/6] ARM: vexpress: determine active tile site before reading tile ID Will Deacon
2011-08-08 17:10 ` [PATCH 2/6] ARM: realview: ensure visibility of writes during reset Will Deacon
2011-08-08 21:16   ` Rob Herring
2011-08-09  8:32     ` Will Deacon
2011-08-08 17:10 ` [PATCH 3/6] ARM: twd: register clockevents device before enabling PPI Will Deacon
2011-08-08 18:19   ` Marc Zyngier
2011-08-08 17:10 ` [PATCH 4/6] ARM: smp: set thread_info->cpu to hardware CPU number for boot thread Will Deacon
2011-08-08 17:33   ` Stephen Boyd [this message]
2011-08-08 18:14     ` Will Deacon
2011-08-08 20:02       ` Russell King - ARM Linux
2011-08-08 20:25         ` Will Deacon
2011-08-09 11:48   ` Sergei Shtylyov
2011-08-09 12:13     ` Will Deacon
2011-08-08 17:10 ` [PATCH 5/6] ARM: cache: detect VIPT aliasing I-cache on ARMv6 Will Deacon
2011-08-08 17:10 ` [PATCH 6/6] ARM: cache: detect PIPT I-cache using CTR Will Deacon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E401DF2.10801@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).