mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Pitre <nicolas.pitre@linaro.org>
To: James King <james.king@linaro.org>
Cc: grant.likely@linaro.org, rob.herring@calxeda.com,
	rob@landley.net,
	Russell King - ARM Linux <linux@arm.linux.org.uk>,
	lorenzo.pieralisi@arm.com, vincent.guittot@linaro.org,
	namhyung@kernel.org, a.p.zijlstra@chello.nl,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, patches@linaro.org,
	linaro-kernel@lists.linaro.org
Subject: Re: [PATCH] arm/dt: Don't add disabled CPUs to system topology
Date: Thu, 6 Jun 2013 13:35:31 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.03.1306061334250.18597@syhkavp.arg> (raw)
In-Reply-To: <1370538685-22386-1-git-send-email-james.king@linaro.org>

On Thu, 6 Jun 2013, James King wrote:

> If CPUs are marked as disabled in the devicetree, make sure they do
> not exist in the system CPU information and CPU topology information.
> In this case these CPUs will not be able to be added to the system later
> using hot-plug. This allows a single chip with many CPUs to be easily
> used in a variety of hardware devices where they may have different
> actual processing requirements (eg for thermal/cost reasons).
> 
> - Change devicetree.c to ignore any cpu nodes marked as disabled,
>   this effectively limits the number of active cpu cores so no need
>   for the max_cpus=x in the chosen node.
> - Change topology.c to ignore any cpu nodes marked as disabled, this
>   is where the scheduler would learn about big/LITTLE cores so this
>   effectively keeps the scheduler in sync.
> 
> Signed-off-by: James King <james.king@linaro.org>

Acked-by: Nicolas Pitre <nico@linaro.org>


> ---
>  Documentation/devicetree/bindings/arm/cpus.txt | 5 +++++
>  arch/arm/kernel/devtree.c                      | 6 ++++++
>  arch/arm/kernel/topology.c                     | 4 ++++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
> index f32494d..9fbcbc5 100644
> --- a/Documentation/devicetree/bindings/arm/cpus.txt
> +++ b/Documentation/devicetree/bindings/arm/cpus.txt
> @@ -45,6 +45,10 @@ For the ARM architecture every CPU node must contain the following properties:
>  		"marvell,xsc3"
>  		"marvell,xscale"
>  
> +And optionally set the following properties:
> +
> +- status:	can be set to "disabled" to remove that CPU from the system CPU topology
> +
>  Example:
>  
>  	cpus {
> @@ -73,5 +77,6 @@ Example:
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a7";
>  			reg = <0x101>;
> +			status = "disabled";
>  		};
>  	};
> diff --git a/arch/arm/kernel/devtree.c b/arch/arm/kernel/devtree.c
> index 5af04f6..f4ba8ee 100644
> --- a/arch/arm/kernel/devtree.c
> +++ b/arch/arm/kernel/devtree.c
> @@ -112,6 +112,12 @@ void __init arm_dt_init_cpu_maps(void)
>  			return;
>  
>  		/*
> +		 * Check if the cpu is marked as "disabled", if so ignore.
> +		 */
> +		if (!of_device_is_available(cpu))
> +			continue;
> +
> +		/*
>  		 * Duplicate MPIDRs are a recipe for disaster.
>  		 * Scan all initialized entries and check for
>  		 * duplicates. If any is found just bail out.
> diff --git a/arch/arm/kernel/topology.c b/arch/arm/kernel/topology.c
> index f10316b..90f8fb3 100644
> --- a/arch/arm/kernel/topology.c
> +++ b/arch/arm/kernel/topology.c
> @@ -116,6 +116,10 @@ static void __init parse_dt_topology(void)
>  		if (cpu_eff->compatible == NULL)
>  			continue;
>  
> +		/* Check if the cpu is marked as "disabled", if so ignore. */
> +		if (!of_device_is_available(cn))
> +			continue;
> +
>  		rate = of_get_property(cn, "clock-frequency", &len);
>  		if (!rate || len != 4) {
>  			pr_err("%s missing clock-frequency property\n",
> -- 
> 1.8.1.2
> 

  reply	other threads:[~2013-06-06 17:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-06 17:11 James King
2013-06-06 17:35 ` Nicolas Pitre [this message]
2013-06-07 10:23 ` Lorenzo Pieralisi
2013-06-07 11:48   ` James King
2013-06-07 16:41     ` Lorenzo Pieralisi
2013-06-10 10:48       ` James King
2013-06-07 14:20   ` Rob Herring
2013-06-07 16:13     ` Lorenzo Pieralisi

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=alpine.LFD.2.03.1306061334250.18597@syhkavp.arg \
    --to=nicolas.pitre@linaro.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@linaro.org \
    --cc=james.king@linaro.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=namhyung@kernel.org \
    --cc=patches@linaro.org \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    --cc=vincent.guittot@linaro.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

all inboxes | Powered by JetHome®