[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230914124025.00006396@Huawei.com>
Date: Thu, 14 Sep 2023 12:40:25 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: James Morse <james.morse@....com>
CC: <linux-pm@...r.kernel.org>, <loongarch@...ts.linux.dev>,
<linux-acpi@...r.kernel.org>, <linux-arch@...r.kernel.org>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-riscv@...ts.infradead.org>, <kvmarm@...ts.linux.dev>,
<x86@...nel.org>, Salil Mehta <salil.mehta@...wei.com>,
Russell King <linux@...linux.org.uk>,
Jean-Philippe Brucker <jean-philippe@...aro.org>,
<jianyong.wu@....com>, <justin.he@....com>
Subject: Re: [RFC PATCH v2 08/35] x86/topology: Switch over to
GENERIC_CPU_DEVICES
On Wed, 13 Sep 2023 16:37:56 +0000
James Morse <james.morse@....com> wrote:
> Now that GENERIC_CPU_DEVICES calls arch_register_cpu(), which can be
> overridden by the arch code, switch over to this to allow common code
> to choose when the register_cpu() call is made.
>
> x86's struct cpus come from struct x86_cpu, which has no other members
> or users. Remove this and use the version defined by common code.
>
> This is an intermediate step to the logic being moved to drivers/acpi,
> where GENERIC_CPU_DEVICES will do the work when booting with acpi=off.
>
> Signed-off-by: James Morse <james.morse@....com>
> ----
> Changes since RFC:
> * Fixed the second copy of arch_register_cpu() used for non-hotplug
Hi James,
See below for comment on this. Upshot - I think you can delete that
function instead and rely on the weak version.
If you can't because of a later change, useful to call that out
in this patch description for those like me who read an review
in a linear fashion!
...
> EXPORT_SYMBOL(arch_unregister_cpu);
> #else /* CONFIG_HOTPLUG_CPU */
>
> -int __init arch_register_cpu(int num)
> +int arch_register_cpu(int num)
> {
> - return register_cpu(&per_cpu(cpu_devices, num).cpu, num);
> + return register_cpu(&per_cpu(cpu_devices, num), num);
> }
Looks like the weak version introduced in patch 3. Can this
implementation go away and fallback to that?
> #endif /* CONFIG_HOTPLUG_CPU */
> -
> -static int __init topology_init(void)
> -{
> - int i;
> -
> - for_each_present_cpu(i)
> - arch_register_cpu(i);
> -
> - return 0;
> -}
> -subsys_initcall(topology_init);
Powered by blists - more mailing lists