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()); } /*