From: Huacai Chen <chenhuacai@gmail.com>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: "open list:MIPS" <linux-mips@vger.kernel.org>,
Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH V2] MIPS: CPU#0 is not hotpluggable
Date: Sat, 25 Jul 2020 14:37:52 +0800 [thread overview]
Message-ID: <CAAhV-H4QH-cyabcfYyNJv89LpOdpsXN+dpZBYy0gNKmSnsUsKA@mail.gmail.com> (raw)
In-Reply-To: <1594896024-16624-1-git-send-email-chenhc@lemote.com>
Hi, Thomas,
What do you think about this patch? Other archs also do the same thing
except those support hotplug CPU#0.
grep hotpluggable arch -rwI
arch/riscv/kernel/setup.c: cpu->hotpluggable = cpu_has_hotplug(i);
arch/powerpc/kernel/sysfs.c: BUG_ON(!c->hotpluggable);
arch/powerpc/kernel/sysfs.c: c->hotpluggable = 1;
arch/powerpc/kernel/sysfs.c: if (cpu_online(cpu) || c->hotpluggable) {
arch/arm/kernel/setup.c: cpuinfo->cpu.hotpluggable =
platform_can_hotplug_cpu(cpu);
arch/sh/kernel/topology.c: c->hotpluggable = 1;
arch/ia64/kernel/topology.c: * CPEI target, then it is hotpluggable
arch/ia64/kernel/topology.c: sysfs_cpus[num].cpu.hotpluggable = 1;
arch/xtensa/kernel/setup.c: cpu->hotpluggable = !!i;
arch/s390/kernel/smp.c: c->hotpluggable = 1;
arch/mips/kernel/topology.c: c->hotpluggable = 1;
arch/arm64/kernel/cpuinfo.c: * In case the boot CPU is hotpluggable,
we record its initial state and
arch/arm64/kernel/setup.c: cpu->hotpluggable = cpu_can_disable(i);
arch/x86/kernel/topology.c: per_cpu(cpu_devices,
num).cpu.hotpluggable = 1;
On Thu, Jul 16, 2020 at 6:38 PM Huacai Chen <chenhc@lemote.com> wrote:
>
> Now CPU#0 is not hotpluggable on MIPS, so prevent to create /sys/devices
> /system/cpu/cpu0/online which confuses some user-space tools.
>
> Cc: stable@vger.kernel.org
> Signed-off-by: Huacai Chen <chenhc@lemote.com>
> ---
> arch/mips/kernel/topology.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/kernel/topology.c b/arch/mips/kernel/topology.c
> index cd3e1f8..08ad637 100644
> --- a/arch/mips/kernel/topology.c
> +++ b/arch/mips/kernel/topology.c
> @@ -20,7 +20,7 @@ static int __init topology_init(void)
> for_each_present_cpu(i) {
> struct cpu *c = &per_cpu(cpu_devices, i);
>
> - c->hotpluggable = 1;
> + c->hotpluggable = !!i;
> ret = register_cpu(c, i);
> if (ret)
> printk(KERN_WARNING "topology_init: register_cpu %d "
> --
> 2.7.0
>
next prev parent reply other threads:[~2020-07-25 6:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-16 10:40 [PATCH V2] MIPS: CPU#0 is not hotpluggable Huacai Chen
2020-07-25 6:37 ` Huacai Chen [this message]
2020-07-25 6:49 ` Greg KH
2020-07-25 6:57 ` Huacai Chen
2020-07-25 7:45 ` Greg KH
2020-07-25 8:29 ` Huacai Chen
2020-07-25 8:57 ` Greg KH
2020-07-26 2:17 ` Jiaxun Yang
2020-07-26 8:25 ` Thomas Bogendoerfer
2020-07-26 11:30 ` Jiaxun Yang
2020-07-26 8:25 ` Thomas Bogendoerfer
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=CAAhV-H4QH-cyabcfYyNJv89LpOdpsXN+dpZBYy0gNKmSnsUsKA@mail.gmail.com \
--to=chenhuacai@gmail.com \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-mips@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=tsbogend@alpha.franken.de \
--cc=wuzhangjin@gmail.com \
--cc=zhangfx@lemote.com \
/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).