Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2725982imj; Mon, 11 Feb 2019 07:34:05 -0800 (PST) X-Google-Smtp-Source: AHgI3IbBQDa2uMhtLZnHsJhBuNcFYGb5JkjBYCfM9HmIXvYb4U3OsQekSKklrFFO+n0m54oYrj8C X-Received: by 2002:a65:624c:: with SMTP id q12mr34216398pgv.379.1549899245811; Mon, 11 Feb 2019 07:34:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549899245; cv=none; d=google.com; s=arc-20160816; b=OahhVyy+NRHn5fnsl80vPJCoX4glpVrOHcC5mrcRhbM5pk09eSpbhsHNVvJfUgFbLO rYPOIzIMzuvLOX93o89F8lm8z4DcsvypHGp0HXN12ZkY524vXDjdEQ/kX7Cya3X4PPDR xRfqv/yV91I5v5A4lY7shkswxT6pkS2K4TdlO1YI2qq+2oriMpvNkVGfuSkAOtSzVmbA JqNCDPdTYPauKMimJU04XBSohCMc8MAz0EA0/n+vPdcAf2kdqJYWzxMSnStvs+pFA9QE OrEwa/YiV4jtBpKP0IGVL0WxiUD08FDRW2SE01udVP34vs++2xxCAfOwkF7qLkRR8/3z STAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=eQlVlnjZjulgoB+QrKDF2Ezu+7gqEZQ3qkOBP2UDGMQ=; b=l9GSDgrfPtAsePLZl57D4SP1PYPtyiQ6NK5/RrKJU2RToKa7K9dU1oh+ttakGg9NZu sAz9xHcQzEA5E9rZRZjL9wnMKXBcGYYmGZ6LvEV12m+iTTJ1T1cwr4Or7ILm8vRJQv82 wVLD0j1iFLjhDb/pjOJnl4STzdviobRIcHBJEmbZfn7VK+91sigHURUbN1PwsN8VYeID V78AEZrp6SYxzy94dq95M5qE9aEluTQb5DBU9IH6OWIcWTd8YXmSRzdgEuDMxIIZhUDM 9UOnXIl40diio7wmhRO3/jHJ+VZvww4vHNW+JtIJybUZ/ofroUwSqGzjz1Yk4B/AwmX7 jJrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FZ31kWqc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h17si9961308pgh.495.2019.02.11.07.33.50; Mon, 11 Feb 2019 07:34:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FZ31kWqc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388803AbfBKOyT (ORCPT + 99 others); Mon, 11 Feb 2019 09:54:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:40956 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388790AbfBKOyQ (ORCPT ); Mon, 11 Feb 2019 09:54:16 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD4C9222A1; Mon, 11 Feb 2019 14:54:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896856; bh=0xFQuxfEdK0hWFPHRWIDKlNxTH4ufCsvsamriwvkL4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FZ31kWqciWgiPPF7TWSZQScr4Ps3wSus8Jpw+rFt9FsfNFkwxHydpwA8Ca36d36xt p1Nx/GuSgAIxChVeSf6IThv8Qv81M4J0ZxnQI9nGsnGx5Z/NXP3Pny11ZiVh8M4z5P Us97fq1wsOgyqstj8mpGcAE6QvdLmZbH/eTCJMyI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yufen Wang , Russell King , Sasha Levin Subject: [PATCH 4.14 011/205] ARM: 8808/1: kexec:offline panic_smp_self_stop CPU Date: Mon, 11 Feb 2019 15:16:49 +0100 Message-Id: <20190211141827.896745597@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 82c08c3e7f171aa7f579b231d0abbc1d62e91974 ] In case panic() and panic() called at the same time on different CPUS. For example: CPU 0: panic() __crash_kexec machine_crash_shutdown crash_smp_send_stop machine_kexec BUG_ON(num_online_cpus() > 1); CPU 1: panic() local_irq_disable panic_smp_self_stop If CPU 1 calls panic_smp_self_stop() before crash_smp_send_stop(), kdump fails. CPU1 can't receive the ipi irq, CPU1 will be always online. To fix this problem, this patch split out the panic_smp_self_stop() and add set_cpu_online(smp_processor_id(), false). Signed-off-by: Yufen Wang Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/kernel/smp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c index e61af0600133..5e31c62127a0 100644 --- a/arch/arm/kernel/smp.c +++ b/arch/arm/kernel/smp.c @@ -691,6 +691,21 @@ void smp_send_stop(void) pr_warn("SMP: failed to stop secondary CPUs\n"); } +/* In case panic() and panic() called at the same time on CPU1 and CPU2, + * and CPU 1 calls panic_smp_self_stop() before crash_smp_send_stop() + * CPU1 can't receive the ipi irqs from CPU2, CPU1 will be always online, + * kdump fails. So split out the panic_smp_self_stop() and add + * set_cpu_online(smp_processor_id(), false). + */ +void panic_smp_self_stop(void) +{ + pr_debug("CPU %u will stop doing anything useful since another CPU has paniced\n", + smp_processor_id()); + set_cpu_online(smp_processor_id(), false); + while (1) + cpu_relax(); +} + /* * not supported here */ -- 2.19.1