From patchwork Sun Feb 17 12:31:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Danzberger X-Patchwork-Id: 1043650 X-Patchwork-Delegate: ynezz@true.cz Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=dd-wrt.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="KDNvlTUl"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=dd-wrt.com header.i=@dd-wrt.com header.b="MHqYq689"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 442RFc1rjyz9sD4 for ; Sun, 17 Feb 2019 23:31:48 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=mcuvFR56AcTSFb5oscDJN0ZdfVCJqUyh38GXmgAxi1s=; b=KDNvlTUlrKlJHC XgEVfwGaygvlkvaEp+vQWksn1cbN6QrTPyToMBl7KKbJAWT0/KUB8ddW2nBVn09Ip7HN6AXWNNQZV wghc5ru/ZTZdnK3MPnsd47IzT9ugIAVWyXYIwCcEQjiK3Ykqsw05BL8QUD4KdMQXSQHUCt+IaJMlL eUUdiscowlsZd7jLUKzCzakGfBGAgljin1Gl+H4ufkYlrbPTtrKgTb1ihTUT88k71X3+murr6J/MF H/6NtuWZ5x6q+MkdQ38uPcVM3SBzMYYlOnYbW9OVMoPvY1qohgF5ij8nQdMnt7SUBq/LvPTHG2668 I+YdGNERKabCysTDX2Fg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gvLbW-00048V-1Z; Sun, 17 Feb 2019 12:31:30 +0000 Received: from smtps.newmedia-net.de ([2a05:a1c0:0:de::167] helo=webmail.newmedia-net.de) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gvLbR-000480-F1 for openwrt-devel@lists.openwrt.org; Sun, 17 Feb 2019 12:31:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dd-wrt.com; s=mikd; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To:From; bh=FUMidETFpv5f+T+rhE940HPQXKD+7PPZrX+R6y4W/68=; b=MHqYq6893UD6NSIpS4nCgzqVhxIrB1sd6gElyIiTtToOI3x9NoxU8h1JZm2Z/hrzUlAuhcUpJ2EvsKobuRVsY0jZIG98xyPrmzuEDtaHIjH0HKGbt10h8DFkJQG3HRiHToCz4rNRyd0CC3FYQCHakH63ED3PZUzypf1VeRbIChM=; From: Daniel Danzberger To: openwrt-devel@lists.openwrt.org Date: Sun, 17 Feb 2019 13:31:04 +0100 Message-Id: <20190217123104.11376-1-daniel@dd-wrt.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a02:908:2614:35c:180:7a89:59ae:e75e X-SA-Exim-Mail-From: daniel@dd-wrt.com X-Spam-Checker-Version: SpamAssassin 3.1.9 (2007-02-13) on webmail.newmedia-net.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=4.0 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.1.9, No X-SA-Exim-Version: 4.2.1 (built Thu, 26 May 2011 15:22:33 +0200) X-SA-Exim-Scanned: Yes (on webmail.newmedia-net.de) X-NMN-MailScanner-Information: Please contact the ISP for more information X-NMN-MailScanner-ID: 1gvLbG-0000Bo-Kq X-NMN-MailScanner: Found to be clean X-NMN-MailScanner-From: daniel@dd-wrt.com X-Received: from [2a02:908:2614:35c:180:7a89:59ae:e75e] (helo=localhost.localdomain) by webmail.newmedia-net.de with esmtpa (Exim 4.72) (envelope-from ) id 1gvLbG-0000Bo-Kq; Sun, 17 Feb 2019 13:31:15 +0100 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190217_043126_146796_22B4ADFF X-CRM114-Status: UNSURE ( 9.65 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain Subject: [OpenWrt-Devel] [PATCH] mt7621: add kexec smp shutdown patch. X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Danzberger Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This patch shuts down all secondary cpus before executing machine_kexec. This avoids paging errors and random hangups when doing kexec. Signed-off-by: Daniel Danzberger --- .../120-mt7621-kexec-smp-shutdown.patch | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 target/linux/ramips/patches-4.14/120-mt7621-kexec-smp-shutdown.patch diff --git a/target/linux/ramips/patches-4.14/120-mt7621-kexec-smp-shutdown.patch b/target/linux/ramips/patches-4.14/120-mt7621-kexec-smp-shutdown.patch new file mode 100644 index 0000000000..a4c0e59521 --- /dev/null +++ b/target/linux/ramips/patches-4.14/120-mt7621-kexec-smp-shutdown.patch @@ -0,0 +1,65 @@ +From 17288381dfc3e920d81cfd4e63e33e3630d54a58 Mon Sep 17 00:00:00 2001 +From: Daniel Danzberger +Date: Sat, 22 Dec 2018 22:20:37 +0100 +Subject: [PATCH] mt7621: kexec: shutdown secondary cpus + +Signed-off-by: Daniel Danzberger +--- + arch/mips/ralink/mt7621.c | 20 ++++++++++++++++++++ + 1 file changed, 20 insertions(+) + +diff --git a/arch/mips/ralink/mt7621.c b/arch/mips/ralink/mt7621.c +index 801edf9..34dced6 100644 +--- a/arch/mips/ralink/mt7621.c ++++ b/arch/mips/ralink/mt7621.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include + + #include +@@ -23,6 +24,7 @@ + #include + #include + #include ++#include + + #include + +@@ -271,6 +273,21 @@ static int udelay_recal(void) + } + device_initcall(udelay_recal); + ++#ifdef CONFIG_KEXEC ++static void mt7621_kexec_shutdown(void) ++{ ++ int reboot_cpu = 0; ++ int cpu; ++ ++ for_each_online_cpu(cpu) { ++ if (cpu != reboot_cpu) ++ cpu_down(cpu); ++ } ++ cpu_hotplug_disable(); ++} ++#endif ++ ++ + void prom_soc_init(struct ralink_soc_info *soc_info) + { + void __iomem *sysc = (void __iomem *) KSEG1ADDR(MT7621_SYSC_BASE); +@@ -325,6 +342,9 @@ void prom_soc_init(struct ralink_soc_info *soc_info) + + rt2880_pinmux_data = mt7621_pinmux_data; + ++#ifdef CONFIG_KEXEC ++ _machine_kexec_shutdown = mt7621_kexec_shutdown; ++#endif + + if (!register_cps_smp_ops()) + return; +-- +2.11.0 +