From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Matt Redfearn <matt.redfearn@imgtec.com>,
"Maciej W. Rozycki" <macro@imgtec.com>,
Jiri Slaby <jslaby@suse.cz>,
Paul Gortmaker <paul.gortmaker@windriver.com>,
Chris Metcalf <cmetcalf@mellanox.com>,
Thomas Gleixner <tglx@linutronix.de>,
Qais Yousef <qsyousef@gmail.com>,
James Hogan <james.hogan@imgtec.com>,
Paul Burton <paul.burton@imgtec.com>,
Marcin Nowakowski <marcin.nowakowski@imgtec.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 4.4 41/56] MIPS: SMP: Use a completion event to signal CPU up
Date: Mon, 13 Nov 2017 13:56:05 +0100 [thread overview]
Message-ID: <20171113125602.936050102@linuxfoundation.org> (raw)
In-Reply-To: <20171113125557.613444087@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matt Redfearn <matt.redfearn@imgtec.com>
commit a00eeede507c975087b7b8df8cf2c9f88ba285de upstream.
If a secondary CPU failed to start, for any reason, the CPU requesting
the secondary to start would get stuck in the loop waiting for the
secondary to be present in the cpu_callin_map.
Rather than that, use a completion event to signal that the secondary
CPU has started and is waiting to synchronise counters.
Since the CPU presence will no longer be marked in cpu_callin_map,
remove the redundant test from arch_cpu_idle_dead().
Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
Cc: Maciej W. Rozycki <macro@imgtec.com>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Qais Yousef <qsyousef@gmail.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/14502/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/kernel/process.c | 4 +---
arch/mips/kernel/smp.c | 15 +++++++++------
2 files changed, 10 insertions(+), 9 deletions(-)
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -49,9 +49,7 @@
#ifdef CONFIG_HOTPLUG_CPU
void arch_cpu_idle_dead(void)
{
- /* What the heck is this check doing ? */
- if (!cpumask_test_cpu(smp_processor_id(), &cpu_callin_map))
- play_dead();
+ play_dead();
}
#endif
--- a/arch/mips/kernel/smp.c
+++ b/arch/mips/kernel/smp.c
@@ -64,6 +64,8 @@ EXPORT_SYMBOL(cpu_sibling_map);
cpumask_t cpu_core_map[NR_CPUS] __read_mostly;
EXPORT_SYMBOL(cpu_core_map);
+static DECLARE_COMPLETION(cpu_running);
+
/*
* A logcal cpu mask containing only one VPE per core to
* reduce the number of IPIs on large MT systems.
@@ -174,7 +176,7 @@ asmlinkage void start_secondary(void)
cpumask_set_cpu(cpu, &cpu_coherent_mask);
notify_cpu_starting(cpu);
- cpumask_set_cpu(cpu, &cpu_callin_map);
+ complete(&cpu_running);
synchronise_count_slave(cpu);
set_cpu_online(cpu, true);
@@ -242,7 +244,6 @@ void smp_prepare_boot_cpu(void)
{
set_cpu_possible(0, true);
set_cpu_online(0, true);
- cpumask_set_cpu(0, &cpu_callin_map);
}
int __cpu_up(unsigned int cpu, struct task_struct *tidle)
@@ -250,11 +251,13 @@ int __cpu_up(unsigned int cpu, struct ta
mp_ops->boot_secondary(cpu, tidle);
/*
- * Trust is futile. We should really have timeouts ...
+ * We must check for timeout here, as the CPU will not be marked
+ * online until the counters are synchronised.
*/
- while (!cpumask_test_cpu(cpu, &cpu_callin_map)) {
- udelay(100);
- schedule();
+ if (!wait_for_completion_timeout(&cpu_running,
+ msecs_to_jiffies(1000))) {
+ pr_crit("CPU%u: failed to start\n", cpu);
+ return -EIO;
}
synchronise_count_master(cpu);
next prev parent reply other threads:[~2017-11-13 12:59 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-13 12:55 [PATCH 4.4 00/56] 4.4.98-stable review Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 02/56] video: fbdev: pmag-ba-fb: Remove bad `__init annotation Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 03/56] PCI: mvebu: Handle changes to the bridge windows while enabled Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 04/56] xen/netback: set default upper limit of tx/rx queues to 8 Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 05/56] ARM: dts: imx53-qsb-common: fix FEC pinmux config Greg Kroah-Hartman
2017-11-14 15:44 ` Ben Hutchings
2017-11-15 4:03 ` Patrick Brünn
2017-11-15 15:15 ` Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 06/56] dt-bindings: clockgen: Add compatible string for LS1012A Greg Kroah-Hartman
2017-11-14 15:46 ` Ben Hutchings
2017-11-15 15:16 ` Greg Kroah-Hartman
2017-11-15 15:19 ` Ben Hutchings
2017-11-15 15:51 ` Greg Kroah-Hartman
2017-11-15 15:25 ` Bhaskar Upadhaya
2017-11-15 15:52 ` Greg Kroah-Hartman
2017-11-15 15:55 ` Harninder Rai
2017-11-15 16:08 ` Greg Kroah-Hartman
2017-11-15 16:22 ` Harninder Rai
2017-11-17 5:57 ` Harninder Rai
2017-11-17 7:55 ` Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 08/56] KVM: PPC: Book 3S: XICS: correct the real mode ICP rejecting counter Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 09/56] iommu/arm-smmu-v3: Clear prior settings when updating STEs Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 10/56] powerpc/corenet: explicitly disable the SDHC controller on kmcoge4 Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 11/56] ARM: omap2plus_defconfig: Fix probe errors on UARTs 5 and 6 Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 12/56] crypto: vmx - disable preemption to enable vsx in aes_ctr.c Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 13/56] iio: trigger: free trigger resource correctly Greg Kroah-Hartman
2017-11-14 20:14 ` Ben Hutchings
2017-11-15 16:11 ` Greg Kroah-Hartman
2017-11-18 15:04 ` Jonathan Cameron
2017-11-13 12:55 ` [PATCH 4.4 14/56] dt-bindings: Add LEGO MINDSTORMS EV3 compatible specification Greg Kroah-Hartman
2017-11-14 20:15 ` Ben Hutchings
2017-11-15 15:08 ` Greg Kroah-Hartman
2017-11-15 15:14 ` Ben Hutchings
2017-11-15 15:50 ` Greg Kroah-Hartman
2017-11-15 16:29 ` alexander.levin
2017-11-13 12:55 ` [PATCH 4.4 15/56] dt-bindings: Add vendor prefix for LEGO Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 17/56] serial: sh-sci: Fix register offsets for the IRDA serial port Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 18/56] usb: hcd: initialize hcd->flags to 0 when rm hcd Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 19/56] netfilter: nft_meta: deal with PACKET_LOOPBACK in netdev family Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 20/56] IPsec: do not ignore crypto err in ah4 input Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 21/56] Input: mpr121 - handle multiple bits change of status register Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 22/56] Input: mpr121 - set missing event capability Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 23/56] IB/ipoib: Change list_del to list_del_init in the tx object Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 24/56] s390/qeth: issue STARTLAN as first IPA command Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 25/56] net: dsa: select NET_SWITCHDEV Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 28/56] KEYS: trusted: sanitize all key material Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 29/56] KEYS: trusted: fix writing past end of buffer in trusted_read() Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 32/56] x86/uaccess, sched/preempt: Verify access_ok() context Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 33/56] workqueue: Fix NULL pointer dereference Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 34/56] crypto: x86/sha1-mb - fix panic due to unaligned access Greg Kroah-Hartman
2017-11-13 12:55 ` [PATCH 4.4 35/56] KEYS: fix NULL pointer dereference during ASN.1 parsing [ver #2] Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 36/56] ARM: 8720/1: ensure dump_instr() checks addr_limit Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 37/56] ALSA: seq: Fix OSS sysex delivery in OSS emulation Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 38/56] ALSA: seq: Avoid invalid lockdep class warning Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 39/56] MIPS: microMIPS: Fix incorrect mask in insn_table_MM Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 40/56] MIPS: Fix CM region target definitions Greg Kroah-Hartman
2017-11-13 12:56 ` Greg Kroah-Hartman [this message]
2017-11-13 12:56 ` [PATCH 4.4 42/56] MIPS: Fix race on setting and getting cpu_online_mask Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 43/56] MIPS: SMP: Fix deadlock & online race Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 44/56] test: firmware_class: report errors properly on failure Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 45/56] selftests: firmware: add empty string and async tests Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 46/56] selftests: firmware: send expected errors to /dev/null Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 47/56] tools: firmware: check for distro fallback udev cancel rule Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 48/56] MIPS: AR7: Defer registration of GPIO Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 49/56] MIPS: AR7: Ensure that serial ports are properly set up Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 50/56] Input: elan_i2c - add ELAN060C to the ACPI table Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 51/56] drm/vmwgfx: Fix Ubuntu 17.10 Wayland black screen issue Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 52/56] rbd: use GFP_NOIO for parent stat and data requests Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 53/56] can: sun4i: handle overrun in RX FIFO Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 55/56] x86/oprofile/ppro: Do not use __this_cpu*() in preemptible context Greg Kroah-Hartman
2017-11-13 12:56 ` [PATCH 4.4 56/56] PKCS#7: fix unitialized boolean want Greg Kroah-Hartman
2017-11-13 21:51 ` [PATCH 4.4 00/56] 4.4.98-stable review Shuah Khan
2017-11-13 22:28 ` Guenter Roeck
2017-11-14 21:31 ` Tom Gall
2017-11-15 8:59 ` Greg Kroah-Hartman
2017-11-15 10:14 ` Milosz Wasilewski
2017-11-15 12:15 ` Naresh Kamboju
2017-11-15 15:17 ` Greg Kroah-Hartman
2017-11-15 16:22 ` Guenter Roeck
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=20171113125602.936050102@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=cmetcalf@mellanox.com \
--cc=james.hogan@imgtec.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=macro@imgtec.com \
--cc=marcin.nowakowski@imgtec.com \
--cc=matt.redfearn@imgtec.com \
--cc=paul.burton@imgtec.com \
--cc=paul.gortmaker@windriver.com \
--cc=qsyousef@gmail.com \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
/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).