From nobody Mon Jun 8 19:57:17 2026 Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 024EA28E0F for ; Wed, 27 May 2026 03:17:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779851881; cv=none; b=hNM4UBO/Jji779s27XyWNLJU7uEcwe5sSdPPnfivwQA2D9KY/gGRj0UywakBdHbIp72Ud4SABnuMrVfbzmeycRQjRFzlVvN21lTTaLbcMQ/UatWkLJdelPiZFMeqKhKFldvRh4GtEdxSPjQdGc48Q2l6lzMz867UbrZ4+R488yU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779851881; c=relaxed/simple; bh=u4rjEnq7/UjcA9sf48x+V1iQ11zT2h74Zh8geYsT3yk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=ABXT+S4P+QHqK35b2LMZhk+mr+ndOpSN1VbPHjvTjyoLANywlGmfddpqECguwWhQtXrbvtekgN9e8OEnQQzldL4rRvzxZ76cw7XCTbFidxxACOEJ4fR3qGtzi4BBrmh04bjNvfYXSrOBpxP2Dw2bcD1yR4YWqDwEHiq2lNUKjjk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=jDR2hL2b; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="jDR2hL2b" Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id B06C62C0241; Wed, 27 May 2026 15:17:50 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1779851870; bh=MhqdYPGYS8b9T6wCn1CL5QB2FD4/fXd6hMuIvJxe5qo=; h=From:To:Cc:Subject:Date:From; b=jDR2hL2b6IPUT76zUF8c7vcuXB80GEa9ESKD6VJlhSmObMLBrXMI+Elk3ZJU6nEIV reshOZlUXO92+UMoHYb2s5FyRhvMEUtw5AdLTHPMxWlO1yGthBejQ4dErdrS9+X1RM yddwlkeDkfDUR0qURDb+h2NdW8gLCUd2JKN5VO9wj5HKafR+REGdY2V9RiaY/U0GsH Qr2W/RzUHg7yOAn7OY1onkW+amOn0NCAetKiiv7sd3wPCdFVxQX2ifW3IY/GzmYnYZ 51MZdT1PWL4WApjGVvIoZCR/5o1FHLyJgfkD73f98cM42ILKL2IS6O6xIEO9fUz33q vuIk8tgsOPKuQ== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Wed, 27 May 2026 15:17:50 +1200 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.30]) by pat.atlnz.lc (Postfix) with ESMTP id 829D713EDE9; Wed, 27 May 2026 15:17:50 +1200 (NZST) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 7B6F3406AE; Wed, 27 May 2026 15:17:50 +1200 (NZST) From: Mark Tomlinson To: Madhavan Srinivasan , Thomas Gleixner Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Mark Tomlinson Subject: [PATCH] smp: prevent soft lockup in smp_call_function_many_cond Date: Wed, 27 May 2026 15:16:18 +1200 Message-ID: <20260527031618.2940365-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.54.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SEG-SpamProfiler-Analysis: v=2.4 cv=Es1xrjcA c=1 sm=1 tr=0 ts=6a16625e a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=NGcC8JguVDcA:10 a=2LgRR1xebQ5gNK1IvtAA:9 a=3ZKOabzyN94A:10 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Content-Type: text/plain; charset="utf-8" Using the PowerPC P2040 (e500mc) CPU, soft lockups can occasionally be seen in smp_call_function_many_cond(). The conclusion is that this CPU does not process the doorbell interrupt while in a data-storage (MMU) exception. If more than one CPU in a multi core environment is calling this function at the same time, it is possible for a deadlock to occur. The fix for this is to call flush_smp_call_function_queue() before waiting for responses from other CPUs. If there is something in the queue, this is a good time to process it before busy-waiting on other CPUs. On other architectures this call will quickly do nothing, as the queue will be empty. Signed-off-by: Mark Tomlinson Reviewed-by: Rik van Riel --- kernel/smp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/smp.c b/kernel/smp.c index a0bb56bd8dda..3c4467654ab0 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -884,6 +884,8 @@ static void smp_call_function_many_cond(const struct cp= umask *mask, local_irq_restore(flags); } =20 + flush_smp_call_function_queue(); + if (run_remote && wait) { for_each_cpu(cpu, cfd->cpumask) { call_single_data_t *csd; --=20 2.54.0