From: Viresh Kumar <viresh.kumar@linaro.org>
To: Russell King <rmk+kernel@armlinux.org.uk>
Cc: Barry Song <baohua@kernel.org>,
linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org,
Krzysztof Kozlowski <krzk@kernel.org>,
linux-omap@vger.kernel.org, Kukjin Kim <kgene@kernel.org>,
Viresh Kumar <vireshk@kernel.org>,
linux-oxnas@groups.io, linux-soc@vger.kernel.org,
Shiraz Hashim <shiraz.linux.kernel@gmail.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 9/9] ARM: smp: remove arch-provided "pen_release"
Date: Fri, 14 Dec 2018 10:09:23 +0530 [thread overview]
Message-ID: <20181214043923.2gusomvei424vw7m@vireshk-i7> (raw)
In-Reply-To: <E1gXVIY-0008DI-MU@rmk-PC.armlinux.org.uk>
On 13-12-18, 18:01, Russell King wrote:
> diff --git a/arch/arm/mach-spear/generic.h b/arch/arm/mach-spear/generic.h
> index 909b97c0b237..815333fc320c 100644
> --- a/arch/arm/mach-spear/generic.h
> +++ b/arch/arm/mach-spear/generic.h
> @@ -20,6 +20,8 @@
>
> #include <asm/mach/time.h>
>
> +extern volatile int prima2_pen_release;
prima2 ?
I haven't tried but this may cause build regressions as well, I am
surprised on how this passed for you.
> extern void spear13xx_timer_init(void);
> extern void spear3xx_timer_init(void);
> extern struct pl022_ssp_controller pl022_plat_data;
> diff --git a/arch/arm/mach-spear/headsmp.S b/arch/arm/mach-spear/headsmp.S
> index c52192dc3d9f..6e250b6c0aa2 100644
> --- a/arch/arm/mach-spear/headsmp.S
> +++ b/arch/arm/mach-spear/headsmp.S
> @@ -43,5 +43,5 @@ pen: ldr r7, [r6]
>
> .align
> 1: .long .
> - .long pen_release
> + .long spear_pen_release
> ENDPROC(spear13xx_secondary_startup)
> diff --git a/arch/arm/mach-spear/hotplug.c b/arch/arm/mach-spear/hotplug.c
> index 12edd1cf8a12..0dd84f609627 100644
> --- a/arch/arm/mach-spear/hotplug.c
> +++ b/arch/arm/mach-spear/hotplug.c
> @@ -16,6 +16,8 @@
> #include <asm/cp15.h>
> #include <asm/smp_plat.h>
>
> +#include "generic.h"
> +
> static inline void cpu_enter_lowpower(void)
> {
> unsigned int v;
> @@ -57,7 +59,7 @@ static inline void spear13xx_do_lowpower(unsigned int cpu, int *spurious)
> for (;;) {
> wfi();
>
> - if (pen_release == cpu) {
> + if (spear_pen_release == cpu) {
> /*
> * OK, proper wakeup, we're done
> */
> diff --git a/arch/arm/mach-spear/platsmp.c b/arch/arm/mach-spear/platsmp.c
> index 39038a03836a..b1ff4bb86f6d 100644
> --- a/arch/arm/mach-spear/platsmp.c
> +++ b/arch/arm/mach-spear/platsmp.c
> @@ -20,16 +20,21 @@
> #include <mach/spear.h>
> #include "generic.h"
>
> +/* XXX spear_pen_release is cargo culted code - DO NOT COPY XXX */
> +volatile int spear_pen_release = -1;
> +
> /*
> - * Write pen_release in a way that is guaranteed to be visible to all
> - * observers, irrespective of whether they're taking part in coherency
> + * XXX CARGO CULTED CODE - DO NOT COPY XXX
> + *
> + * Write spear_pen_release in a way that is guaranteed to be visible to
> + * all observers, irrespective of whether they're taking part in coherency
> * or not. This is necessary for the hotplug code to work reliably.
> */
> -static void write_pen_release(int val)
> +static void spear_write_pen_release(int val)
> {
> - pen_release = val;
> + spear_pen_release = val;
> smp_wmb();
> - sync_cache_w(&pen_release);
> + sync_cache_w(&spear_pen_release);
> }
>
> static DEFINE_SPINLOCK(boot_lock);
> @@ -42,7 +47,7 @@ static void spear13xx_secondary_init(unsigned int cpu)
> * let the primary processor know we're out of the
> * pen, then head off into the C entry point
> */
> - write_pen_release(-1);
> + spear_write_pen_release(-1);
>
> /*
> * Synchronise with the boot thread.
> @@ -64,17 +69,17 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
> /*
> * The secondary processor is waiting to be released from
> * the holding pen - release it, then wait for it to flag
> - * that it has been released by resetting pen_release.
> + * that it has been released by resetting spear_pen_release.
> *
> - * Note that "pen_release" is the hardware CPU ID, whereas
> + * Note that "spear_pen_release" is the hardware CPU ID, whereas
> * "cpu" is Linux's internal ID.
> */
> - write_pen_release(cpu);
> + spear_write_pen_release(cpu);
>
> timeout = jiffies + (1 * HZ);
> while (time_before(jiffies, timeout)) {
> smp_rmb();
> - if (pen_release == -1)
> + if (spear_pen_release == -1)
> break;
>
> udelay(10);
> @@ -86,7 +91,7 @@ static int spear13xx_boot_secondary(unsigned int cpu, struct task_struct *idle)
> */
> spin_unlock(&boot_lock);
>
> - return pen_release != -1 ? -ENOSYS : 0;
> + return spear_pen_release != -1 ? -ENOSYS : 0;
> }
>
> /*
> --
> 2.7.4
--
viresh
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2018-12-14 4:39 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-13 17:59 [PATCH 0/9] Clean up ARM SMP/CPU hotplug implementations Russell King - ARM Linux
2018-12-13 18:00 ` [PATCH 1/9] ARM: omap2: remove unnecessary boot_lock Russell King
2018-12-13 18:00 ` [PATCH 2/9] ARM: qcom: " Russell King
2019-01-10 12:50 ` Linus Walleij
2019-01-10 20:56 ` Stephen Boyd
2019-01-10 21:47 ` Linus Walleij
2019-01-11 15:09 ` Russell King - ARM Linux
2019-01-13 22:46 ` Linus Walleij
2019-01-10 22:05 ` Stephen Boyd
2018-12-13 18:00 ` [PATCH 3/9] ARM: oxnas: remove CPU hotplug implementation Russell King
2018-12-20 14:03 ` Neil Armstrong
2018-12-13 18:00 ` [PATCH 4/9] ARM: sti: remove pen_release and boot_lock Russell King
2018-12-17 8:22 ` Patrice CHOTARD
2018-12-13 18:01 ` [PATCH 5/9] ARM: actions: remove boot_lock and pen_release Russell King
2018-12-13 18:01 ` [PATCH 6/9] ARM: vexpress/realview: consolidate immitation CPU hotplug Russell King
2018-12-13 18:01 ` [PATCH 7/9] ARM: versatile: convert boot_lock to raw Russell King
2018-12-13 18:01 ` [PATCH 8/9] ARM: versatile: rename and comment SMP implementation Russell King
2018-12-13 18:01 ` [PATCH 9/9] ARM: smp: remove arch-provided "pen_release" Russell King
2018-12-14 4:39 ` Viresh Kumar [this message]
2018-12-14 13:12 ` Russell King - ARM Linux
2018-12-17 6:16 ` Viresh Kumar
2018-12-20 10:10 ` [PATCH 0/9] Clean up ARM SMP/CPU hotplug implementations Russell King - ARM Linux
2018-12-20 10:23 ` Krzysztof Kozlowski
2018-12-20 11:05 ` Russell King - ARM Linux
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=20181214043923.2gusomvei424vw7m@vireshk-i7 \
--to=viresh.kumar@linaro.org \
--cc=baohua@kernel.org \
--cc=kgene@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-oxnas@groups.io \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
--cc=shiraz.linux.kernel@gmail.com \
--cc=vireshk@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 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).