All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2] ARM: smp: Only expose /sys/.../cpuX/online if hotpluggable
Date: Fri, 13 Feb 2015 20:59:50 +0000	[thread overview]
Message-ID: <54DE65C6.8000304@codeaurora.org> (raw)
In-Reply-To: <CANqRtoSOBf3ZCKdKYta-P2q==ZMHk=VZgfEztPJ+uaKQtkBWjg@mail.gmail.com>

On 02/13/15 12:54, Magnus Damm wrote:
> Hi Stephen,
>
> On Fri, Feb 13, 2015 at 8:23 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> On 02/13/15 12:20, Simon Horman wrote:
>>> Hi Stephen,
>>>
>>> On Fri, Feb 13, 2015 at 10:06:39AM -0800, Stephen Boyd wrote:
>>>> diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> index 3f761f839043..b45206f93ddf 100644
>>>> --- a/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> +++ b/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> @@ -124,19 +124,12 @@ static int r8a7779_cpu_kill(unsigned int cpu)
>>>>
>>>>      return 0;
>>>>  }
>>>> -
>>>> -static int r8a7779_cpu_disable(unsigned int cpu)
>>>> -{
>>>> -    /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */
>>>> -    return cpu = 0 ? -EPERM : 0;
>>>> -}
>>>>  #endif /* CONFIG_HOTPLUG_CPU */
>>>>
>>>>  struct smp_operations r8a7779_smp_ops  __initdata = {
>>>>      .smp_prepare_cpus       = r8a7779_smp_prepare_cpus,
>>>>      .smp_boot_secondary     = r8a7779_boot_secondary,
>>>>  #ifdef CONFIG_HOTPLUG_CPU
>>>> -    .cpu_disable            = r8a7779_cpu_disable,
>>>>      .cpu_die                = shmobile_smp_scu_cpu_die,
>>>>      .cpu_kill               = r8a7779_cpu_kill,
>>>>  #endif
>>> Its not clear to me why r8a7779_cpu_disable() has been
>>> removed rather than replaced by r8a7779_cpu_can_disable()
>> By default ARM's smp.c assumes that CPU0 can't be hotplugged. The
>> function is redundant. I guess I should have mentioned that in the
>> commit text.
> Thanks for your efforts. Can you please tell me where that limitation
> is located? I'm quite sure I've brought CPU cores up and down
> including CPU0, but maybe something is missing?
>
>

The assumption is made if there isn't a cpu_disable (now
cpu_can_disable) op. See platform_cpu_disable() in
arch/arm/kernel/smp.c. If there isn't such a limitation on a particular
platform, the platform needs to set the cpu_disable/cpu_can_disable op
and indicate that there isn't a limitation (by returning 1 for example).

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] ARM: smp: Only expose /sys/.../cpuX/online if hotpluggable
Date: Fri, 13 Feb 2015 12:59:50 -0800	[thread overview]
Message-ID: <54DE65C6.8000304@codeaurora.org> (raw)
In-Reply-To: <CANqRtoSOBf3ZCKdKYta-P2q==ZMHk=VZgfEztPJ+uaKQtkBWjg@mail.gmail.com>

On 02/13/15 12:54, Magnus Damm wrote:
> Hi Stephen,
>
> On Fri, Feb 13, 2015 at 8:23 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> On 02/13/15 12:20, Simon Horman wrote:
>>> Hi Stephen,
>>>
>>> On Fri, Feb 13, 2015 at 10:06:39AM -0800, Stephen Boyd wrote:
>>>> diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> index 3f761f839043..b45206f93ddf 100644
>>>> --- a/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> +++ b/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> @@ -124,19 +124,12 @@ static int r8a7779_cpu_kill(unsigned int cpu)
>>>>
>>>>      return 0;
>>>>  }
>>>> -
>>>> -static int r8a7779_cpu_disable(unsigned int cpu)
>>>> -{
>>>> -    /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */
>>>> -    return cpu == 0 ? -EPERM : 0;
>>>> -}
>>>>  #endif /* CONFIG_HOTPLUG_CPU */
>>>>
>>>>  struct smp_operations r8a7779_smp_ops  __initdata = {
>>>>      .smp_prepare_cpus       = r8a7779_smp_prepare_cpus,
>>>>      .smp_boot_secondary     = r8a7779_boot_secondary,
>>>>  #ifdef CONFIG_HOTPLUG_CPU
>>>> -    .cpu_disable            = r8a7779_cpu_disable,
>>>>      .cpu_die                = shmobile_smp_scu_cpu_die,
>>>>      .cpu_kill               = r8a7779_cpu_kill,
>>>>  #endif
>>> Its not clear to me why r8a7779_cpu_disable() has been
>>> removed rather than replaced by r8a7779_cpu_can_disable()
>> By default ARM's smp.c assumes that CPU0 can't be hotplugged. The
>> function is redundant. I guess I should have mentioned that in the
>> commit text.
> Thanks for your efforts. Can you please tell me where that limitation
> is located? I'm quite sure I've brought CPU cores up and down
> including CPU0, but maybe something is missing?
>
>

The assumption is made if there isn't a cpu_disable (now
cpu_can_disable) op. See platform_cpu_disable() in
arch/arm/kernel/smp.c. If there isn't such a limitation on a particular
platform, the platform needs to set the cpu_disable/cpu_can_disable op
and indicate that there isn't a limitation (by returning 1 for example).

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <sboyd@codeaurora.org>
To: Magnus Damm <magnus.damm@gmail.com>
Cc: Simon Horman <horms@verge.net.au>,
	Russell King <linux@arm.linux.org.uk>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	Mark Rutland <mark.rutland@arm.com>,
	Nicolas Pitre <nico@linaro.org>,
	Dave Martin <Dave.Martin@arm.com>,
	SH-Linux <linux-sh@vger.kernel.org>
Subject: Re: [PATCH v2] ARM: smp: Only expose /sys/.../cpuX/online if hotpluggable
Date: Fri, 13 Feb 2015 12:59:50 -0800	[thread overview]
Message-ID: <54DE65C6.8000304@codeaurora.org> (raw)
In-Reply-To: <CANqRtoSOBf3ZCKdKYta-P2q==ZMHk=VZgfEztPJ+uaKQtkBWjg@mail.gmail.com>

On 02/13/15 12:54, Magnus Damm wrote:
> Hi Stephen,
>
> On Fri, Feb 13, 2015 at 8:23 PM, Stephen Boyd <sboyd@codeaurora.org> wrote:
>> On 02/13/15 12:20, Simon Horman wrote:
>>> Hi Stephen,
>>>
>>> On Fri, Feb 13, 2015 at 10:06:39AM -0800, Stephen Boyd wrote:
>>>> diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> index 3f761f839043..b45206f93ddf 100644
>>>> --- a/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> +++ b/arch/arm/mach-shmobile/smp-r8a7779.c
>>>> @@ -124,19 +124,12 @@ static int r8a7779_cpu_kill(unsigned int cpu)
>>>>
>>>>      return 0;
>>>>  }
>>>> -
>>>> -static int r8a7779_cpu_disable(unsigned int cpu)
>>>> -{
>>>> -    /* only CPU1->3 have power domains, do not allow hotplug of CPU0 */
>>>> -    return cpu == 0 ? -EPERM : 0;
>>>> -}
>>>>  #endif /* CONFIG_HOTPLUG_CPU */
>>>>
>>>>  struct smp_operations r8a7779_smp_ops  __initdata = {
>>>>      .smp_prepare_cpus       = r8a7779_smp_prepare_cpus,
>>>>      .smp_boot_secondary     = r8a7779_boot_secondary,
>>>>  #ifdef CONFIG_HOTPLUG_CPU
>>>> -    .cpu_disable            = r8a7779_cpu_disable,
>>>>      .cpu_die                = shmobile_smp_scu_cpu_die,
>>>>      .cpu_kill               = r8a7779_cpu_kill,
>>>>  #endif
>>> Its not clear to me why r8a7779_cpu_disable() has been
>>> removed rather than replaced by r8a7779_cpu_can_disable()
>> By default ARM's smp.c assumes that CPU0 can't be hotplugged. The
>> function is redundant. I guess I should have mentioned that in the
>> commit text.
> Thanks for your efforts. Can you please tell me where that limitation
> is located? I'm quite sure I've brought CPU cores up and down
> including CPU0, but maybe something is missing?
>
>

The assumption is made if there isn't a cpu_disable (now
cpu_can_disable) op. See platform_cpu_disable() in
arch/arm/kernel/smp.c. If there isn't such a limitation on a particular
platform, the platform needs to set the cpu_disable/cpu_can_disable op
and indicate that there isn't a limitation (by returning 1 for example).

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project


  reply	other threads:[~2015-02-13 20:59 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 18:06 [PATCH v2] ARM: smp: Only expose /sys/.../cpuX/online if hotpluggable Stephen Boyd
2015-02-13 18:06 ` Stephen Boyd
2015-02-13 18:06 ` Stephen Boyd
2015-02-13 20:20 ` Simon Horman
2015-02-13 20:20   ` Simon Horman
2015-02-13 20:20   ` Simon Horman
2015-02-13 20:23   ` Stephen Boyd
2015-02-13 20:23     ` Stephen Boyd
2015-02-13 20:23     ` Stephen Boyd
2015-02-13 20:54     ` Magnus Damm
2015-02-13 20:54       ` Magnus Damm
2015-02-13 20:54       ` Magnus Damm
2015-02-13 20:59       ` Stephen Boyd [this message]
2015-02-13 20:59         ` Stephen Boyd
2015-02-13 20:59         ` Stephen Boyd
2015-02-13 21:44         ` Magnus Damm
2015-02-13 21:44           ` Magnus Damm
2015-02-13 21:44           ` Magnus Damm
2015-02-13 23:01           ` Russell King - ARM Linux
2015-02-13 23:01             ` Russell King - ARM Linux
2015-02-13 23:01             ` Russell King - ARM Linux
2015-02-14  0:01             ` Stephen Boyd
2015-02-14  0:01               ` Stephen Boyd
2015-02-14  0:01               ` Stephen Boyd
2015-02-14 10:01             ` Magnus Damm
2015-02-14 10:01               ` Magnus Damm
2015-02-14 10:01               ` Magnus Damm
2015-02-16 15:29             ` Mark Rutland
2015-02-16 15:29               ` Mark Rutland
2015-02-16 15:29               ` Mark Rutland
2015-02-13 22:58       ` Russell King - ARM Linux
2015-02-13 22:58         ` Russell King - ARM Linux
2015-02-13 22:58         ` Russell King - ARM Linux
2015-02-13 22:57   ` Russell King - ARM Linux
2015-02-13 22:57     ` Russell King - ARM Linux
2015-02-13 22:57     ` Russell King - ARM Linux
2015-02-13 23:24     ` Simon Horman
2015-02-13 23:24       ` Simon Horman
2015-02-13 23:24       ` Simon Horman

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=54DE65C6.8000304@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.