From: Mark Rutland <mark.rutland@arm.com>
To: Kumar Gala <galak@codeaurora.org>
Cc: "linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
Abhimanyu Kapur <abhimany@codeaurora.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"arm@kernel.org" <arm@kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
Catalin Marinas <Catalin.Marinas@arm.com>,
Will Deacon <Will.Deacon@arm.com>
Subject: Re: [RFC PATCH 5/5] arm64: qcom: add cpu operations
Date: Tue, 14 Apr 2015 17:29:53 +0100 [thread overview]
Message-ID: <20150414162953.GL28709@leverpostej> (raw)
In-Reply-To: <1428601031-5366-6-git-send-email-galak@codeaurora.org>
> diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
> index 8b9e0a9..35cabe5 100644
> --- a/Documentation/devicetree/bindings/arm/cpus.txt
> +++ b/Documentation/devicetree/bindings/arm/cpus.txt
> @@ -185,6 +185,8 @@ nodes to be present and contain the properties described below.
> be one of:
> "psci"
> "spin-table"
In the case of these two, there's documentation on what the OS, FW, and
HW are expected to do. There's a PSCI spec, and spin-table is documented
in booting.txt (which is admittedly not fantastic).
> + "qcom,arm-cortex-acc"
However, this has no semantics associated with it. Per the code below
it seems to encompass more than just poking the APSS ACC, so the name
isn't great either.
[...]
> + * Based on arch/arm64/kernel/smp_spin_table.c
This is not a phrase that will ever make me happy.
[...]
> +static DEFINE_RAW_SPINLOCK(boot_lock);
We got rid of this for spin-table. It's pointless.
> +DEFINE_PER_CPU(int, cold_boot_done);
This looks suspicious.
> +#if 0
> +static int cold_boot_flags[] = {
> + 0,
> + QCOM_SCM_FLAG_COLDBOOT_CPU1,
> + QCOM_SCM_FLAG_COLDBOOT_CPU2,
> + QCOM_SCM_FLAG_COLDBOOT_CPU3,
> +};
> +#endif
I take it this shouldn't be here?
[...]
> +static int power_on_l2_msm8916(struct device_node *l2ccc_node, u32 pon_mask,
> + int cpu)
> +{
> + u32 pon_status;
> + void __iomem *l2_base;
> +
> + l2_base = of_iomap(l2ccc_node, 0);
> + if (!l2_base)
> + return -ENOMEM;
I didn't see any mention of an L2 requiring power-up in the rest of the
series...
[...]
> +static void write_pen_release(u64 val)
> +{
> + void *start = (void *)&secondary_holding_pen_release;
> + unsigned long size = sizeof(secondary_holding_pen_release);
> +
> + secondary_holding_pen_release = val;
> + smp_wmb();
> + __flush_dcache_area(start, size);
> +}
> +
> +static int secondary_pen_release(unsigned int cpu)
> +{
> + unsigned long timeout;
> +
> + /*
> + * Set synchronisation state between this boot processor
> + * and the secondary one
> + */
> + raw_spin_lock(&boot_lock);
> + write_pen_release(cpu_logical_map(cpu));
> +
> + timeout = jiffies + (1 * HZ);
> + while (time_before(jiffies, timeout)) {
> + if (secondary_holding_pen_release == INVALID_HWID)
> + break;
> + udelay(10);
> + }
> + raw_spin_unlock(&boot_lock);
> +
> + return secondary_holding_pen_release != INVALID_HWID ? -ENOSYS : 0;
> +}
So you want to share the pen, but duplicate the code for managing it?
> +static int __init msm_cpu_init(struct device_node *dn, unsigned int cpu)
> +{
> + /* Mark CPU0 cold boot flag as done */
> + if (!cpu && !per_cpu(cold_boot_done, cpu))
> + per_cpu(cold_boot_done, cpu) = true;
> +
> + return 0;
> +}
[...]
> +static int msm_cpu_boot(unsigned int cpu)
> +{
> + int ret = 0;
> +
> + if (per_cpu(cold_boot_done, cpu) == false) {
> + ret = msm_unclamp_secondary_arm_cpu(cpu);
> + if (ret)
> + return ret;
> + per_cpu(cold_boot_done, cpu) = true;
> + }
> + return secondary_pen_release(cpu);
> +}
Ah, so cold_boot_done is for pseudo-hotplug. Absolute NAK to that.
The only thing this gives you over spin-table is one-time powering up of
the CPUs that can be performed prior to entry to Linux. If you do that,
you can trivially share the spin-table code by setting each CPU's
enable-method to "spin-table".
That won't give you cpuidle or actual hotplug. For those you'll need
PSCI.
Mark.
WARNING: multiple messages have this Message-ID (diff)
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH 5/5] arm64: qcom: add cpu operations
Date: Tue, 14 Apr 2015 17:29:53 +0100 [thread overview]
Message-ID: <20150414162953.GL28709@leverpostej> (raw)
In-Reply-To: <1428601031-5366-6-git-send-email-galak@codeaurora.org>
> diff --git a/Documentation/devicetree/bindings/arm/cpus.txt b/Documentation/devicetree/bindings/arm/cpus.txt
> index 8b9e0a9..35cabe5 100644
> --- a/Documentation/devicetree/bindings/arm/cpus.txt
> +++ b/Documentation/devicetree/bindings/arm/cpus.txt
> @@ -185,6 +185,8 @@ nodes to be present and contain the properties described below.
> be one of:
> "psci"
> "spin-table"
In the case of these two, there's documentation on what the OS, FW, and
HW are expected to do. There's a PSCI spec, and spin-table is documented
in booting.txt (which is admittedly not fantastic).
> + "qcom,arm-cortex-acc"
However, this has no semantics associated with it. Per the code below
it seems to encompass more than just poking the APSS ACC, so the name
isn't great either.
[...]
> + * Based on arch/arm64/kernel/smp_spin_table.c
This is not a phrase that will ever make me happy.
[...]
> +static DEFINE_RAW_SPINLOCK(boot_lock);
We got rid of this for spin-table. It's pointless.
> +DEFINE_PER_CPU(int, cold_boot_done);
This looks suspicious.
> +#if 0
> +static int cold_boot_flags[] = {
> + 0,
> + QCOM_SCM_FLAG_COLDBOOT_CPU1,
> + QCOM_SCM_FLAG_COLDBOOT_CPU2,
> + QCOM_SCM_FLAG_COLDBOOT_CPU3,
> +};
> +#endif
I take it this shouldn't be here?
[...]
> +static int power_on_l2_msm8916(struct device_node *l2ccc_node, u32 pon_mask,
> + int cpu)
> +{
> + u32 pon_status;
> + void __iomem *l2_base;
> +
> + l2_base = of_iomap(l2ccc_node, 0);
> + if (!l2_base)
> + return -ENOMEM;
I didn't see any mention of an L2 requiring power-up in the rest of the
series...
[...]
> +static void write_pen_release(u64 val)
> +{
> + void *start = (void *)&secondary_holding_pen_release;
> + unsigned long size = sizeof(secondary_holding_pen_release);
> +
> + secondary_holding_pen_release = val;
> + smp_wmb();
> + __flush_dcache_area(start, size);
> +}
> +
> +static int secondary_pen_release(unsigned int cpu)
> +{
> + unsigned long timeout;
> +
> + /*
> + * Set synchronisation state between this boot processor
> + * and the secondary one
> + */
> + raw_spin_lock(&boot_lock);
> + write_pen_release(cpu_logical_map(cpu));
> +
> + timeout = jiffies + (1 * HZ);
> + while (time_before(jiffies, timeout)) {
> + if (secondary_holding_pen_release == INVALID_HWID)
> + break;
> + udelay(10);
> + }
> + raw_spin_unlock(&boot_lock);
> +
> + return secondary_holding_pen_release != INVALID_HWID ? -ENOSYS : 0;
> +}
So you want to share the pen, but duplicate the code for managing it?
> +static int __init msm_cpu_init(struct device_node *dn, unsigned int cpu)
> +{
> + /* Mark CPU0 cold boot flag as done */
> + if (!cpu && !per_cpu(cold_boot_done, cpu))
> + per_cpu(cold_boot_done, cpu) = true;
> +
> + return 0;
> +}
[...]
> +static int msm_cpu_boot(unsigned int cpu)
> +{
> + int ret = 0;
> +
> + if (per_cpu(cold_boot_done, cpu) == false) {
> + ret = msm_unclamp_secondary_arm_cpu(cpu);
> + if (ret)
> + return ret;
> + per_cpu(cold_boot_done, cpu) = true;
> + }
> + return secondary_pen_release(cpu);
> +}
Ah, so cold_boot_done is for pseudo-hotplug. Absolute NAK to that.
The only thing this gives you over spin-table is one-time powering up of
the CPUs that can be performed prior to entry to Linux. If you do that,
you can trivially share the spin-table code by setting each CPU's
enable-method to "spin-table".
That won't give you cpuidle or actual hotplug. For those you'll need
PSCI.
Mark.
next prev parent reply other threads:[~2015-04-14 16:29 UTC|newest]
Thread overview: 109+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 17:37 [RFC PATCH 0/5] Add smp booting support for Qualcomm ARMv8 SoCs Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 17:37 ` [RFC PATCH 1/5] firmware: qcom: scm: Split out 32-bit specific SCM code Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 17:37 ` [RFC PATCH 2/5] firmware: qcom: scm: Add support for ARM64 SoCs Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 17:37 ` [RFC PATCH 3/5] arm64: introduce CPU_OF_TABLES for cpu ops selection Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 21:17 ` Arnd Bergmann
2015-04-09 21:17 ` Arnd Bergmann
2015-04-14 15:52 ` Mark Rutland
2015-04-14 15:52 ` Mark Rutland
2015-04-14 15:52 ` Mark Rutland
2015-04-10 10:28 ` Lorenzo Pieralisi
2015-04-10 10:28 ` Lorenzo Pieralisi
2015-04-09 17:37 ` [RFC PATCH 4/5] arm64: smp: move the pen to a header file Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 21:17 ` Arnd Bergmann
2015-04-09 21:17 ` Arnd Bergmann
2015-04-14 19:41 ` Kumar Gala
2015-04-14 19:41 ` Kumar Gala
2015-04-14 15:59 ` Mark Rutland
2015-04-14 15:59 ` Mark Rutland
2015-04-14 19:40 ` Kumar Gala
2015-04-14 19:40 ` Kumar Gala
[not found] ` <1428601031-5366-1-git-send-email-galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-04-09 17:37 ` [RFC PATCH 5/5] arm64: qcom: add cpu operations Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 17:37 ` Kumar Gala
2015-04-09 21:19 ` Arnd Bergmann
2015-04-09 21:19 ` Arnd Bergmann
2015-04-10 10:08 ` Catalin Marinas
2015-04-10 10:08 ` Catalin Marinas
2015-04-10 10:08 ` Catalin Marinas
2015-04-10 10:39 ` Lorenzo Pieralisi
2015-04-10 10:39 ` Lorenzo Pieralisi
2015-04-14 16:29 ` Mark Rutland [this message]
2015-04-14 16:29 ` Mark Rutland
2015-04-14 20:51 ` Arnd Bergmann
2015-04-14 20:51 ` Arnd Bergmann
2015-04-15 14:46 ` Catalin Marinas
2015-04-15 14:46 ` Catalin Marinas
2015-04-15 14:46 ` Catalin Marinas
2015-04-14 22:52 ` Al Stone
2015-04-14 22:52 ` Al Stone
2015-04-15 9:04 ` Mark Rutland
2015-04-15 9:04 ` Mark Rutland
2015-04-15 14:53 ` Catalin Marinas
2015-04-15 14:53 ` Catalin Marinas
2015-04-15 14:53 ` Catalin Marinas
2015-04-15 16:29 ` Al Stone
2015-04-15 16:29 ` Al Stone
2015-04-10 10:05 ` [RFC PATCH 0/5] Add smp booting support for Qualcomm ARMv8 SoCs Catalin Marinas
2015-04-10 10:05 ` Catalin Marinas
[not found] ` <20150410100529.GA6854-M2fw3Uu6cmfZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2015-04-10 15:24 ` Kumar Gala
2015-04-10 15:24 ` Kumar Gala
2015-04-10 15:24 ` Kumar Gala
[not found] ` <493B15F8-0EBE-4633-9604-671EF403F36E-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-04-10 16:10 ` Catalin Marinas
2015-04-10 16:10 ` Catalin Marinas
2015-04-10 16:10 ` Catalin Marinas
2015-04-10 19:06 ` Kumar Gala
2015-04-10 19:06 ` Kumar Gala
2015-04-13 9:41 ` Catalin Marinas
2015-04-13 9:41 ` Catalin Marinas
2015-04-14 14:21 ` Kumar Gala
2015-04-14 14:21 ` Kumar Gala
2015-04-14 14:21 ` Kumar Gala
2015-04-14 14:44 ` Kumar Gala
2015-04-14 14:44 ` Kumar Gala
2015-04-14 15:45 ` Mark Rutland
2015-04-14 15:45 ` Mark Rutland
2015-04-14 22:32 ` Lorenzo Pieralisi
2015-04-14 22:32 ` Lorenzo Pieralisi
2015-04-15 16:17 ` Lina Iyer
2015-04-15 16:17 ` Lina Iyer
2015-04-15 17:35 ` Lorenzo Pieralisi
2015-04-15 17:35 ` Lorenzo Pieralisi
2015-04-15 14:27 ` Catalin Marinas
2015-04-15 14:27 ` Catalin Marinas
2015-04-14 16:36 ` Mark Rutland
2015-04-14 16:36 ` Mark Rutland
2015-04-14 19:49 ` Kumar Gala
2015-04-14 19:49 ` Kumar Gala
2015-04-14 21:17 ` Catalin Marinas
2015-04-14 21:17 ` Catalin Marinas
2015-04-14 21:48 ` Rob Clark
2015-04-14 21:48 ` Rob Clark
2015-04-14 21:48 ` Rob Clark
[not found] ` <CAF6AEGtoxNrCoxT5n0CXmKMnL-YprJ3DkAuM4Myi87WMxPqBGw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-15 13:34 ` Catalin Marinas
2015-04-15 13:34 ` Catalin Marinas
2015-04-15 13:34 ` Catalin Marinas
2015-04-15 15:01 ` Rob Clark
2015-04-15 15:01 ` Rob Clark
2015-04-16 15:21 ` Catalin Marinas
2015-04-16 15:21 ` Catalin Marinas
[not found] ` <20150416152121.GE819-M2fw3Uu6cmfZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2015-04-16 17:17 ` Rob Clark
2015-04-16 17:17 ` Rob Clark
2015-04-16 17:17 ` Rob Clark
[not found] ` <CAF6AEGt3bf70MUWFU_kqtc8KDR09tMUCkXbqOq0SpOXU44moTg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-16 21:39 ` Catalin Marinas
2015-04-16 21:39 ` Catalin Marinas
2015-04-16 21:39 ` Catalin Marinas
2015-04-16 22:03 ` Matt Sealey
2015-04-16 22:03 ` Matt Sealey
2015-04-10 11:03 ` Lorenzo Pieralisi
2015-04-10 11:03 ` Lorenzo Pieralisi
2015-04-10 15:25 ` Kumar Gala
2015-04-10 15:25 ` Kumar Gala
2015-04-10 16:07 ` Lorenzo Pieralisi
2015-04-10 16:07 ` Lorenzo Pieralisi
2015-04-16 22:08 ` Rob Herring
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=20150414162953.GL28709@leverpostej \
--to=mark.rutland@arm.com \
--cc=Catalin.Marinas@arm.com \
--cc=Will.Deacon@arm.com \
--cc=abhimany@codeaurora.org \
--cc=arm@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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.