From patchwork Sat Nov 18 09:12:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leo Yan X-Patchwork-Id: 119244 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1513237qgn; Sat, 18 Nov 2017 01:14:42 -0800 (PST) X-Google-Smtp-Source: AGs4zMbmgzmyCkcZS3+v6XuDOeMUKB0Q4MV0PIR2wYoGjzjHHLvEn9NsbvCqmKUPvxoP2Z6Nn4lG X-Received: by 10.84.234.135 with SMTP id n7mr7535154plk.298.1510996482894; Sat, 18 Nov 2017 01:14:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510996482; cv=none; d=google.com; s=arc-20160816; b=E0XEP3hiT0e25u+sbbbsYyi0Jq1tscUPXYYmJjsdQJ7wrKbrsMYchLDsWHBtJW2DxW gHOccXc3VOFZn6q0RKCd4BeLvPr4Uec6rG8E9i+xy3et9cecRf15ZjO5E8JOvLIdJ6S+ Av3X/9bTSh94qrlaQ5gxoIvh/DQH110EtlmTLpI1epytqJFiUA2jRZvwrThSFJxoYUkh Cptnk4T8S1HSlWFWqIzgHwqauHeC8TfY0x8Jk9cs0yApWVXnn78CiVL1684zsNZkmfEG 0DU0wSeZ+2p4ptpw3El0W5i8bruC7+8fL7og+5+wXn8IFxa0J8Mx/gn5s8HQRhUH7yFd LQ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9np7sSbcKwXJ+5bSH965VqkPeB0hIR1Hh6ewyCXNWSI=; b=q2Imic+qpotDNndYcCFD1g/YaOT2sQ781VJZMz4et9E6KhbMCgmWbNOuN+61Bgu+0+ qModCtc+Nb718Ia2083/sjfGIzFmUN7LB1bVar9Sck5Ka35CKOPnRjDxfcBZay0Gs2/E tErw8IMCJLhW97aXW5YYex0yLhGotsnqe6ZAVjKpdf0TzTiZIUbkSIafwsJTXyO7j9oh xXG1AcfbbeHyCCOccFSNNMPN9uGT05ndCc8mFjWS88zPnPEa0UNYp0pFv8u1I1qFECws Mk+i5wwpRXioQaNpqD7a3FlGjoLfJecl8OxycuYAFHr0x5HwjDh63Y6q+6hakpE5bfOP Wklw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jcyFU5qW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s16si4211944plp.187.2017.11.18.01.14.42; Sat, 18 Nov 2017 01:14:42 -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=@linaro.org header.s=google header.b=jcyFU5qW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946502AbdKRJOi (ORCPT + 28 others); Sat, 18 Nov 2017 04:14:38 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:37194 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946076AbdKRJMs (ORCPT ); Sat, 18 Nov 2017 04:12:48 -0500 Received: by mail-wm0-f67.google.com with SMTP id v186so10356150wma.2 for ; Sat, 18 Nov 2017 01:12:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=9np7sSbcKwXJ+5bSH965VqkPeB0hIR1Hh6ewyCXNWSI=; b=jcyFU5qWQMy6P4dVXbK5MSnxTP+vqOp8WYtOU7a4JDOqAvQtxD4eVZUrE0JMmcBQFI Wrf3rvdqI5sJBoWcpHY1VhjHam8GjjMBEw3+AB9JTU50zutjGjBMzqKOIlX4ATVJzL2B HSTZhMEcyWKZ3pcg5UTJISMGc+pICVWTYNrLU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=9np7sSbcKwXJ+5bSH965VqkPeB0hIR1Hh6ewyCXNWSI=; b=krxTEVMxx2TCzLTaTYUJpKcUF9YyRqWL4b9kyg5n9TQ0ysorMUCBLcobeYYP/A3nx/ FklYKc7mrBepLMdEB7ZuTR92kkis99M6f4GvXjNDR3w94m8ljcMcg6tUwo6Sa7nrEItL hVS9kvLh5J8e51lplfU7XZyXxgYZOjMheoewJkb4A6K5X26/nkgvvvfl52eU/TVtmNps vhBmq5EeUA0pBBM6LkFwAj8ub/eI/4icoFc4Cnim2qSJkhdApJB/Nldc9AHLtytAdcJ7 JbM4aTDjYCjh391o9gaxglC7X/V0/i3dz04mIeFp/mesGlLe2IPgoRzEwFBykPJzBucE r8BA== X-Gm-Message-State: AJaThX7ja1YxFQDJupt15zVK1UflIjkolhxVvVyX5fWv7mJYZOZUn6Zl 2YvPho6jGPxPQsy2jGBu5Q/dxw== X-Received: by 10.28.14.195 with SMTP id 186mr5833544wmo.56.1510996366634; Sat, 18 Nov 2017 01:12:46 -0800 (PST) Received: from localhost.localdomain (li1530-42.members.linode.com. [139.162.245.42]) by smtp.gmail.com with ESMTPSA id p79sm4963984wmf.43.2017.11.18.01.12.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Nov 2017 01:12:45 -0800 (PST) From: Leo Yan To: Catalin Marinas , Will Deacon , Mark Rutland , AKASHI Takahiro , Mathieu Poirier , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Leo Yan , James Morse Subject: [PATCH v2] arm64: kdump: Avoid to power off nonpanic CPUs Date: Sat, 18 Nov 2017 17:12:32 +0800 Message-Id: <1510996352-16684-1-git-send-email-leo.yan@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org commit a88ce63b642c ("arm64: kexec: have own crash_smp_send_stop() for crash dump for nonpanic cores") introduces ARM64 architecture function crash_smp_send_stop() to replace the weak function, this results in the nonpanic CPUs to be hot-plugged out and CPUs are placed into low power state on ARM64 platforms with the flow: Panic CPU: machine_crash_shutdown() crash_smp_send_stop() smp_cross_call(&mask, IPI_CPU_CRASH_STOP) Nonpanic CPUs: handle_IPI() ipi_cpu_crash_stop() cpu_ops[cpu]->cpu_die() The upper patch has no issue if enabled crash dump only; but if enabled crash dump and Coresight debug module for panic dumping at the meantime, nonpanic CPUs are powered off in crash dump flow, later this may introduce conflicts with the Coresight debug module because Coresight debug registers dumping requires the CPU must be powered on for some platforms (e.g. Hi6220 on Hikey board). If we cannot keep the CPUs powered on, we can see the hardware lockup issue when access Coresight debug registers. To fix this issue, this commit bypasses CPU hotplug operation in func crash_smp_send_stop() when coresight CPU debug module has been enabled and let CPUs to run into WFE/WFI states so CPUs can still be powered on after crash dump. This finally is more safe for Coresight debug module to dump registers and avoid hardware lockup. Cc: Catalin Marinas Cc: James Morse Cc: Mark Rutland Cc: Mathieu Poirier Cc: Will Deacon Signed-off-by: Leo Yan --- arch/arm64/kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 9f7195a..31dab1f 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -856,7 +856,7 @@ static void ipi_cpu_crash_stop(unsigned int cpu, struct pt_regs *regs) local_irq_disable(); -#ifdef CONFIG_HOTPLUG_CPU +#if defined(CONFIG_HOTPLUG_CPU) && !defined(CONFIG_CORESIGHT_CPU_DEBUG) if (cpu_ops[cpu]->cpu_die) cpu_ops[cpu]->cpu_die(cpu); #endif