Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
From: Cristian Marussi <cristian.marussi@arm.com>
To: linux-kernel@vger.kernel.org
Cc: linux-arch@vger.kernel.org, mark.rutland@arm.com,
	sparclinux@vger.kernel.org, dzickus@redhat.com,
	ehabkost@redhat.com, peterz@infradead.org,
	catalin.marinas@arm.com, x86@kernel.org, linux@armlinux.org.uk,
	davem@davemloft.net, hch@infradead.org,
	takahiro.akashi@linaro.org, mingo@redhat.com,
	james.morse@arm.com, hidehiro.kawai.ez@hitachi.com,
	tglx@linutronix.de, will@kernel.org, dave.martin@arm.com,
	linux-arm-kernel@lists.infradead.org
Subject: [RFC PATCH v2 12/12] sparc64: smp: use generic SMP stop common code
Date: Fri, 13 Sep 2019 19:19:53 +0100
Message-ID: <20190913181953.45748-13-cristian.marussi@arm.com> (raw)
In-Reply-To: <20190913181953.45748-1-cristian.marussi@arm.com>

Make sparc64 use the generic SMP-stop logic provided by common code
unified smp_send_stop() function.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 arch/sparc/Kconfig         |  1 +
 arch/sparc/kernel/smp_64.c | 15 ++++++++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig
index 7926a2e11bdc..67d8bb741378 100644
--- a/arch/sparc/Kconfig
+++ b/arch/sparc/Kconfig
@@ -95,6 +95,7 @@ config SPARC64
 	select ARCH_HAS_PTE_SPECIAL
 	select PCI_DOMAINS if PCI
 	select ARCH_HAS_GIGANTIC_PAGE
+	select ARCH_USE_COMMON_SMP_STOP
 
 config ARCH_DEFCONFIG
 	string
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index a8275fea4b70..759e5fd867c5 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1537,7 +1537,12 @@ static void stop_this_cpu(void *dummy)
 	prom_stopself();
 }
 
-void smp_send_stop(void)
+void arch_smp_cpus_stop_complete(void)
+{
+	smp_call_function(stop_this_cpu, NULL, 0);
+}
+
+void arch_smp_stop_call(cpumask_t *cpus, unsigned int __unused)
 {
 	int cpu;
 
@@ -1546,10 +1551,7 @@ void smp_send_stop(void)
 #ifdef CONFIG_SERIAL_SUNHV
 		sunhv_migrate_hvcons_irq(this_cpu);
 #endif
-		for_each_online_cpu(cpu) {
-			if (cpu == this_cpu)
-				continue;
-
+		for_each_cpu(cpu, cpus) {
 			set_cpu_online(cpu, false);
 #ifdef CONFIG_SUN_LDOMS
 			if (ldom_domaining_enabled) {
@@ -1562,8 +1564,7 @@ void smp_send_stop(void)
 #endif
 				prom_stopcpu_cpuid(cpu);
 		}
-	} else
-		smp_call_function(stop_this_cpu, NULL, 0);
+	}
 }
 
 /**
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply index

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-13 18:19 [RFC PATCH v2 00/12] Unify SMP stop generic logic to " Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 01/12] smp: add generic SMP-stop support " Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 02/12] smp: unify crash_ and smp_send_stop() logic Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 03/12] smp: coordinate concurrent crash/smp stop calls Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 04/12] smp: address races of starting CPUs while stopping Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 05/12] arm64: smp: use generic SMP stop common code Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 06/12] arm64: smp: use SMP crash-stop " Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 07/12] arm64: smp: add arch specific cpu parking helper Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 08/12] x86: smp: use generic SMP stop common code Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 09/12] x86: smp: use SMP crash-stop " Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 10/12] arm: smp: use generic SMP stop " Cristian Marussi
2019-09-13 18:19 ` [RFC PATCH v2 11/12] arm: smp: use SMP crash-stop " Cristian Marussi
2019-09-13 18:19 ` Cristian Marussi [this message]
2019-09-13 18:27 ` [RFC PATCH v2 00/12] Unify SMP stop generic logic to " Russell King - ARM Linux admin

Reply instructions:

You may reply publically 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=20190913181953.45748-13-cristian.marussi@arm.com \
    --to=cristian.marussi@arm.com \
    --cc=catalin.marinas@arm.com \
    --cc=dave.martin@arm.com \
    --cc=davem@davemloft.net \
    --cc=dzickus@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=hch@infradead.org \
    --cc=hidehiro.kawai.ez@hitachi.com \
    --cc=james.morse@arm.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sparclinux@vger.kernel.org \
    --cc=takahiro.akashi@linaro.org \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    --cc=x86@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

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox