From: msalter@redhat.com (Mark Salter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: fix handling of nr_cpus
Date: Tue, 18 Oct 2011 09:16:43 -0400 [thread overview]
Message-ID: <1318943804.2346.15.camel@deneb.redhat.com> (raw)
In-Reply-To: <20111013151004.GF21648@n2100.arm.linux.org.uk>
On Thu, 2011-10-13 at 16:10 +0100, Russell King - ARM Linux wrote:
> I still wonder if doing this wouldn't be easier though - it results in
> a consistent message across all platforms, which is important if we're
> going to be checking against a user-passed value.
>
> arch/arm/mach-exynos4/platsmp.c | 10 ++++------
> arch/arm/mach-omap2/omap-smp.c | 10 ++++------
> arch/arm/mach-realview/platsmp.c | 10 ++++------
> arch/arm/mach-tegra/platsmp.c | 8 ++++----
> arch/arm/mach-ux500/platsmp.c | 10 ++++------
> 5 files changed, 20 insertions(+), 28 deletions(-)
>
> diff --git a/arch/arm/mach-exynos4/platsmp.c
> b/arch/arm/mach-exynos4/platsmp.c
> index df6ef1b..7381f56 100644
> --- a/arch/arm/mach-exynos4/platsmp.c
> +++ b/arch/arm/mach-exynos4/platsmp.c
> @@ -193,12 +193,10 @@ void __init smp_init_cpus(void)
> ncores = scu_base ? scu_get_core_count(scu_base) : 1;
>
> /* sanity check */
> - if (ncores > NR_CPUS) {
> - printk(KERN_WARNING
> - "EXYNOS4: no. of cores (%d) greater than configured "
> - "maximum of %d - clipping\n",
> - ncores, NR_CPUS);
> - ncores = NR_CPUS;
> + if (ncores > nr_cpu_ids) {
> + pr_warn("EXYNOS4: %u cores greater than maximum (%u), clipping\n",
> + ncores, nr_cpu_ids);
> + ncores = nr_cpu_ids;
> }
>
> for (i = 0; i < ncores; i++)
...
That's fine by me. mach-msm, mach-shmobile, and mach-vexpress also need
patching. They currently don't clip against NR_CPUS.
--Mark
next prev parent reply other threads:[~2011-10-18 13:16 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-11 13:31 [PATCH] arm: fix handling of nr_cpus Mark Salter
2011-10-12 17:26 ` Russell King - ARM Linux
2011-10-13 12:17 ` Mark Salter
2011-10-13 15:10 ` Russell King - ARM Linux
2011-10-18 13:16 ` Mark Salter [this message]
2011-10-20 11:25 ` Russell King - ARM Linux
2011-10-20 13:02 ` Mark Salter
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=1318943804.2346.15.camel@deneb.redhat.com \
--to=msalter@redhat.com \
--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).