All of lore.kernel.org
 help / color / mirror / Atom feed
From: hanjun.guo@linaro.org (Hanjun Guo)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/6] arm64: Add asm/cpu.h
Date: Thu, 12 Dec 2013 14:50:27 +0800	[thread overview]
Message-ID: <52A95CB3.2030805@linaro.org> (raw)
In-Reply-To: <20131211142705.GE596@darko.cambridge.arm.com>

On 2013-12-11 22:27, Catalin Marinas wrote:
> On Wed, Dec 11, 2013 at 02:23:08PM +0000, Mark Brown wrote:
>> On Wed, Dec 11, 2013 at 02:10:19PM +0000, Catalin Marinas wrote:
>>> On Wed, Dec 11, 2013 at 01:13:21PM +0000, Mark Brown wrote:
>>
>>>> +struct cpuinfo_arm {
>>>> +	struct cpu	cpu;
>>>> +	u64		cpuid;
>>>> +#ifdef CONFIG_SMP
>>>> +	unsigned int	loops_per_jiffy;
>>>> +#endif
>>>> +};
>>
>>> How is this structure used? I haven't seen the ACPI code doing anything
>>> with struct cpu (though I haven't dug deep enough). Also loops_per_jiffy
>>> is useless, that's related to the delay loop based on the generic timer.
>>
>> Now I look again we can probably drop this for the toplogy work - it had
>> been pulled in as part of pulling things in from pre-v8 and the cpuid
>> was used in the code while I was working on it but isn't any more unless
>> I'm misreading the code.  
>>
>> I don't know what the ACPI guys are doing wtih it, I just saw they added
>> the same thing.
> 
> It looked to me that for ACPI and empty asm/cpu.h file would do for now.
> There are a couple of prototypes for CPU hotplug I think but haven't
> seen the structure used (not even the x86_cpu one).

In ACPI code, only struct cpu is used for ACPI based CPU hotplug, here
is the code will send to upstream when the ACPI core for ARM is ready.

---
 arch/arm64/include/asm/cpu.h |    5 +++++
 arch/arm64/kernel/topology.c |   26 ++++++++++++++++++++++++++
 2 files changed, 31 insertions(+)

diff --git a/arch/arm64/include/asm/cpu.h b/arch/arm64/include/asm/cpu.h
index dbeb98d..5613e09 100644
--- a/arch/arm64/include/asm/cpu.h
+++ b/arch/arm64/include/asm/cpu.h
@@ -20,6 +20,11 @@ struct cpuinfo_arm {
 #endif
 };

+#ifdef CONFIG_HOTPLUG_CPU
+extern int arch_register_cpu(int cpu);
+extern void arch_unregister_cpu(int cpu);
+#endif
+
 DECLARE_PER_CPU(struct cpuinfo_arm, cpu_data);

 #endif
diff --git a/arch/arm64/kernel/topology.c b/arch/arm64/kernel/topology.c
index cb548f1..5c8e69c 100644
--- a/arch/arm64/kernel/topology.c
+++ b/arch/arm64/kernel/topology.c
@@ -18,3 +18,29 @@ void arch_fix_phys_package_id(int num, u32 slot)
 }
 EXPORT_SYMBOL_GPL(arch_fix_phys_package_id);

+#ifdef CONFIG_HOTPLUG_CPU
+int __ref arch_register_cpu(int cpu)
+{
+       struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu);
+
+       /* BSP cann't be taken down on arm */
+       if (cpu)
+               cpuinfo->cpu.hotpluggable = 1;
+
+       return register_cpu(&cpuinfo->cpu, cpu);
+}
+EXPORT_SYMBOL(arch_register_cpu);
+
+void arch_unregister_cpu(int cpu)
+{
+       unregister_cpu(&per_cpu(cpu_data, cpu).cpu);
+}
+EXPORT_SYMBOL(arch_unregister_cpu);
+#else /* CONFIG_HOTPLUG_CPU */
+
+static int __init arch_register_cpu(int cpu)
+{
+       return register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu);
+}
+#endif /* CONFIG_HOTPLUG_CPU */
+

  reply	other threads:[~2013-12-12  6:50 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 13:13 [PATCH 1/6] arm64: Add asm/cpu.h Mark Brown
2013-12-11 13:13 ` [PATCH 2/6] arm64: dts: Add a virtio disk to the RTSM motherboard Mark Brown
2013-12-11 13:13 ` [PATCH 3/6] arm64: dts: Add a devicetree for the ARMv8 4xA53 4xA57 FVP Mark Brown
2013-12-11 13:55   ` Mark Rutland
2013-12-11 14:11     ` Mark Brown
2013-12-11 15:04       ` Mark Rutland
2013-12-11 16:00         ` Mark Brown
2013-12-11 16:08         ` Jon Medhurst (Tixy)
2013-12-11 16:41           ` Ryan Harkin
2013-12-11 17:09             ` Mark Rutland
2013-12-11 17:50               ` Mark Brown
2013-12-11 13:13 ` [PATCH 4/6] arm64: topology: Implement basic CPU topology support Mark Brown
2013-12-11 14:12   ` Will Deacon
2013-12-11 14:15     ` Mark Brown
2013-12-11 14:24       ` Catalin Marinas
2013-12-11 14:30         ` Mark Brown
2013-12-11 14:49           ` Catalin Marinas
2013-12-11 16:13             ` Mark Brown
2013-12-12  6:59         ` Hanjun Guo
2013-12-12 10:27           ` Mark Brown
2013-12-12 11:22             ` Hanjun Guo
2013-12-16 10:57   ` Lorenzo Pieralisi
2013-12-16 11:33     ` Mark Brown
2013-12-16 12:29     ` Mark Brown
2013-12-16 14:46       ` Lorenzo Pieralisi
2013-12-16 15:12         ` Mark Brown
2013-12-17 11:47           ` Catalin Marinas
2013-12-17 12:17             ` Mark Brown
2013-12-16 14:45   ` Alex Shi
2013-12-16 15:22     ` Mark Brown
2013-12-17  7:19       ` Alex Shi
2013-12-17 12:02         ` Mark Brown
2013-12-11 13:13 ` [PATCH 5/6] arm64: topology: Tell the scheduler about the relative power of cores Mark Brown
2013-12-11 14:47   ` Catalin Marinas
2013-12-11 17:31     ` Mark Brown
2013-12-11 19:27       ` Nicolas Pitre
2013-12-12 11:56         ` Morten Rasmussen
2013-12-12 12:22           ` Mark Brown
2013-12-12 13:42             ` Morten Rasmussen
2013-12-12 14:26           ` Vincent Guittot
2013-12-11 13:13 ` [PATCH 6/6] arm64: dts: Add CPU topology properties for ARMv8 4xA53 4xA57 FVP Mark Brown
2013-12-11 14:10 ` [PATCH 1/6] arm64: Add asm/cpu.h Catalin Marinas
2013-12-11 14:23   ` Mark Brown
2013-12-11 14:27     ` Catalin Marinas
2013-12-12  6:50       ` Hanjun Guo [this message]
2013-12-12 10:36         ` Mark Rutland
2013-12-12 11:20           ` Hanjun Guo

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=52A95CB3.2030805@linaro.org \
    --to=hanjun.guo@linaro.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.