From patchwork Fri Jan 7 02:05:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12706087 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FA74C433F5 for ; Fri, 7 Jan 2022 02:07:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=915jyS422ynM06WXEk5Ee2T1w97QsblBto53Nly/mVc=; b=PLphDHjs40ijwJ 9xNh4TVGrl4foaYsV4lxEai2eHUKBgez1TQk0qiYafs6d9v5gMjlaY7KMIatLDwpAqNnK7HR4qkWH tplVKBXJKcx3W5uEh6bK3HCENfyX2xfnMA08wnr/9chnPwZCrVrKtSBoYp7rZsBYlrxNlcY2Tw7jy wqv/l16BoyaRWQ1arkQQLTpTnPEWdEugFB7+I6+bEco1QdHJUUNbGzlAtlZ6b+5GtJA48PUnPS9Fo fU0+VShoAtB5TW8seFeIj5NDTC/C96ClxlGTxK43kBQ6LYKnBo8c9xQOCHYfgP/ouxTJCJM44f0eq dlW+IH+jSagA6pbpZZBQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5eeJ-001snF-OK; Fri, 07 Jan 2022 02:06:35 +0000 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5eeF-001smm-TR for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 02:06:33 +0000 Received: by mail-pf1-x42c.google.com with SMTP id 196so3958754pfw.10 for ; Thu, 06 Jan 2022 18:06:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DALDj493YXBU4avmtEVEv1liR0Lcltkika0XkoI3ZLg=; b=SOIg9TBS2pIhdHDbd6gZhjp/9OFXBeiXvOKvT6H8DZUzsXolsJw6xGiEGlGo+87cSZ kKS5K4pmAtrYT26P8kYwyB/uUtBAvuxkQIkS0J7kVgJc4kokiDjUmGHaQwVWJP9ay7z2 v1KqnHcyG/6lHRDpDSD8RfTFRCh6vhgBWlSUoRQdBqpImmGTOqI0I+ISZ9EupwTllvGY EX+DX1IY3NGhrVoXVsojRnSCZSdHcw2jwlhEmG5Ib/p01W6uWmMxWfHdOq/sqlqGs++i fhTBMkx272jD8BUroVR9x4kRgsbVEZgkv0L+E24IJxGngIjRUCDZ//rDn9fAasl7oIgH 7N3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DALDj493YXBU4avmtEVEv1liR0Lcltkika0XkoI3ZLg=; b=wfmqXHjnOEB3fvVcxpbsXnd7SbpQQT8lbl5ybaHLlhhPvOT+1iPuR77+u1RqTrbiuL ooC1uuDyo0NlpKNgxQzdxg0bMEaYBPcriCH/MAJ3yyEjXkahdxK4m2KcmhNJ0QxupIx+ svMd4HotKO1U0kfAEvwJ7085nrxSFk5xJzW8/uFOTRppqXJBkk3gYIUG1fxHxgUfgeZl bta7mZEllcldJOd+raJydjF1OnCP0V4i4yzsH2j0oEYS2Q8cIBgVquYkyFITlSwNb2F/ 1Ef2DjC7x5jHDrIIyWp27klxv/hvNqm09Uvt59lfijNeajcjrcMRno3jtZbk5wcJZ7UY 4+SQ== X-Gm-Message-State: AOAM5313vtZwaYmqfd5RLpBs4gbIv/X/2D0XyRdaOF4Qknj1MHIwLs/I Ut+AcFI0VeZy2QvyFFCmYhBkbO4ruA== X-Google-Smtp-Source: ABdhPJwNFr3JOVaL386EMPcemfcZrRxfsxU4E0mYnPNTuc4D3Q/fYONSjCHzyI8WfAh84+y4rd6CoQ== X-Received: by 2002:a63:f16:: with SMTP id e22mr54735134pgl.221.1641521190989; Thu, 06 Jan 2022 18:06:30 -0800 (PST) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id o1sm3394030pjr.4.2022.01.06.18.06.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:06:30 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Russell King , Guenter Roeck , Arnd Bergmann , Wolfram Sang , Lee Jones Subject: [PATCH 2/3] arm: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus() Date: Fri, 7 Jan 2022 10:05:07 +0800 Message-Id: <20220107020508.9778-2-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220107020508.9778-1-kernelfans@gmail.com> References: <20220107020508.9778-1-kernelfans@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220106_180631_972363_3B8C9D3A X-CRM114-Status: GOOD ( 13.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org kernel_kexec()->migrate_to_reboot_cpu() has already pinned the reboot thread on either reboot_cpu or the first online cpu. So machine_shutdown() should pass smp_processor_id() as the primary cpu to smp_shutdown_nonboot_cpus(). Signed-off-by: Pingfan Liu Cc: Russell King Cc: Guenter Roeck Cc: Arnd Bergmann Cc: Wolfram Sang Cc: Lee Jones To: linux-arm-kernel@lists.infradead.org --- arch/arm/kernel/reboot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kernel/reboot.c b/arch/arm/kernel/reboot.c index 3044fcb8d073..898405682e08 100644 --- a/arch/arm/kernel/reboot.c +++ b/arch/arm/kernel/reboot.c @@ -91,7 +91,7 @@ void soft_restart(unsigned long addr) */ void machine_shutdown(void) { - smp_shutdown_nonboot_cpus(reboot_cpu); + smp_shutdown_nonboot_cpus(smp_processor_id()); } /* From patchwork Fri Jan 7 02:05:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 12706088 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 432CEC433F5 for ; Fri, 7 Jan 2022 02:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LqwfC8StJTk/R0iawJq1JLSkpztnCsd7dYq8e9MrrHM=; b=BhRXHv9YoprRSG pOVt0aJQqJkrUwATZelWEC0A91gegLSvI2y+C/FW/FA454QwsSe/xe9S1mJ4h+/VipIVPlV1E1H/H iD4cv7zKr8w2tfe4q5zUspP+Bo1Q8dQFwT0vh2/fXb/DeEf+gvzlK5687+kvC2APP2NgUhVI68W2L gUwiBYZa5onBDthIXUD5MaE/Ry+buxk/jruEznsnK6fArJ70veuM7FbBwd+56q8UMcziTeeC/mUxP 1y3e4QiU7AaIu8fUtu0TC5IQ16csQyr4/NbuJx2FE4zQNAlya5lOn2oorYsTf+FT8ioTihvG3wZmo ml8YJWWFe+DXHAV8SYnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5eec-001sqH-7I; Fri, 07 Jan 2022 02:06:54 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n5eeY-001spK-O4 for linux-arm-kernel@lists.infradead.org; Fri, 07 Jan 2022 02:06:52 +0000 Received: by mail-pl1-x635.google.com with SMTP id w7so3739073plp.13 for ; Thu, 06 Jan 2022 18:06:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=jszpscv/7nRXxaawYX42mDnlPfVqycpbaRmhU2woN1k=; b=btiUY6usjM771XXagKZTGs9PFwnGfTBtO3skCZUUSnc4duW0wzNiUsE1EPNdBjQHxt OJAF/KFTzItY6J+wbUhKknOO87jsW9FUJhQQ/h1WKp3kisdaW//5cEa0W2vggFBQC3zk sWPIHCIBpq3L/QMw2kJDs+IHmpek2lw9s/ViErZQ9+RHkX/DPTD9GKW101YnvSxvauzk BH5NUb0oHBulZm53HF3s61j7/ietzyrRf8DrWCa4k/+PG6CYaqgbghKAWBihp/nt4+PN cZsdomq43MicGJTTUI9AeISDffvwZRC1MBNv5HoYHpPsGoH0zghjEEnNoDrM1A0jN5P9 tVEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=jszpscv/7nRXxaawYX42mDnlPfVqycpbaRmhU2woN1k=; b=LDRY+jUySfIst0lgUicT7Wi4kKAeKXsB6N5v2OPjD/2/R7Xv+ElmJg2a5Kolk9BkJP hLrc5cOT54mNlY3/XVOn4UyE4MpXw+iWeufxOF+FnJ8++g1tR/AtpQox6/nDugAze3Sf ZCwMTS2d1cy3xl6KC3tatP1RtqiMS+jQ+gVMi0MQNzStzIb8utBywyCobNxbE9LNXnyN NG4LdxrjjYshLuzOk2wqag4WNEJgMARAtC5Li9bK0p7KUeeAAXk9oN/i4hK9bQ+5A9dy 4FeePImlqkATiYFiU03OGnidcrAjOHL12WP72z9Gpk59jlkOfm8ck9XcRy1s1BdsGPAf 22Ww== X-Gm-Message-State: AOAM532SoMBXorGEVxom5BHUjhZ7AaT8ctFr+K5j5M3VnCcZpBaJOrXc 4CykFFCAcMsDCwXcpO49kxPlG9WhfQ== X-Google-Smtp-Source: ABdhPJx8crQW74goFRC18a+rvwtKcl/k/ArUr1OyJd5QwQDOjsAk+fViXJoxWzIQ7R7RKZVxLcbe2w== X-Received: by 2002:a17:90b:3a85:: with SMTP id om5mr13214268pjb.145.1641521209892; Thu, 06 Jan 2022 18:06:49 -0800 (PST) Received: from piliu.users.ipa.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id o1sm3394030pjr.4.2022.01.06.18.06.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jan 2022 18:06:49 -0800 (PST) From: Pingfan Liu To: linux-arm-kernel@lists.infradead.org Cc: Pingfan Liu , Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Peter Collingbourne , Marc Zyngier Subject: [PATCH 3/3] arm64: kexec: fix the primary cpu passed to smp_shutdown_nonboot_cpus() Date: Fri, 7 Jan 2022 10:05:08 +0800 Message-Id: <20220107020508.9778-3-kernelfans@gmail.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220107020508.9778-1-kernelfans@gmail.com> References: <20220107020508.9778-1-kernelfans@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220106_180650_791875_1CB2E68D X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org kernel_kexec()->migrate_to_reboot_cpu() has already pinned the reboot thread on either reboot_cpu or the first online cpu. So machine_shutdown() should pass smp_processor_id() as the primary cpu to smp_shutdown_nonboot_cpus(). Signed-off-by: Pingfan Liu Cc: Catalin Marinas Cc: Will Deacon Cc: Mark Rutland Cc: Peter Zijlstra Cc: Peter Collingbourne Cc: Marc Zyngier To: linux-arm-kernel@lists.infradead.org --- arch/arm64/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index aacf2f5559a8..e1d2179ca845 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -85,7 +85,7 @@ void arch_cpu_idle_dead(void) */ void machine_shutdown(void) { - smp_shutdown_nonboot_cpus(reboot_cpu); + smp_shutdown_nonboot_cpus(smp_processor_id()); } /*