Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp383326rwd; Tue, 16 May 2023 02:20:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4174a+QynFmjm8mAKuryTZRNdqjY+TkkkH+J+5ZYhBhiZsa+g1ibdBMR/D2aPQLR8wv58Q X-Received: by 2002:a05:6a21:6d90:b0:102:7c37:aef2 with SMTP id wl16-20020a056a216d9000b001027c37aef2mr28218412pzb.58.1684228854888; Tue, 16 May 2023 02:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684228854; cv=none; d=google.com; s=arc-20160816; b=TwSRdqbUMGaO7smL7VaRTlJGXkE+owwIpVsyMSlwTZKiMrTjt6IaWmMnD7diOroQS+ nKN13EVbO6yBwZLOiYvCE18r3risVDLIn2JlY8BgBQPzoWNcNgbteQZCm3rSg/hqlgXN bv42tkuka8izOdltXIlDDjonio5abwvW0sGOxZwN2kpRc5r0qUEcMOkBL40W/HehID+6 ZfEZGS+NCkebnoJwng0lXFtqFAP6e9kfd6MxHdBaDhrlQ/IDRtKzOYT7jMkWS8MyTpCu K7F6np66bHEOSqMEiamz0Vt3A054gy78g/abEZVewXI4bhggMt1vXG0kevz5p24wK8IB Gehg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=7Sa2180BiRObjiZ9fPuEKFG9tozXWYnkG/1s3K005DQ=; b=O4wOOXCA+R8AfwKyHCU/CeKdA9kOjx0pu3aKWK6+TtL537uzR3pGjnYfCASLw+SmKG kR2TfI4/oDa2wvVLwLb70TP4MWjTrEriyzbRoaiOjolHrXqbWLYse0U0FBP6QtutBQo2 Rd8b6h38Frog2skQtl8s0WFUawFuZaSlyzsEnxskV+5v6eCQ5Kc5zeP4zFyTXeiOjedW 1qG4xXwyhahPPxUACPJ8aCSaU38Gy4BeqDH5aDS93vIhslBOvbyMuCRgi3dy9Ut9Znlr 4j53nr45V0uy3Qxtk413xHOtV6rQnbeQP2STFtHjX9y2DtOWfPKO2lZeP4+QKPA2+WGB 1DXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Wy1slCFW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=bCZ6Bqhm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p30-20020a63951e000000b005289d0633e0si18234119pgd.229.2023.05.16.02.20.42; Tue, 16 May 2023 02:20:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Wy1slCFW; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=bCZ6Bqhm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231939AbjEPJKj (ORCPT + 99 others); Tue, 16 May 2023 05:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231800AbjEPJKE (ORCPT ); Tue, 16 May 2023 05:10:04 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 299034C0A; Tue, 16 May 2023 02:10:01 -0700 (PDT) Date: Tue, 16 May 2023 09:09:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1684228196; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Sa2180BiRObjiZ9fPuEKFG9tozXWYnkG/1s3K005DQ=; b=Wy1slCFWqaJOyltK4VSAOqxwaTu74jz+ru2WI57GeW+kTZTVfzjVMWU63+Lqg49Cy2CLp5 b5u31OYOPMvhp6Cvt4tYzCayopeS1+ZrL90Jg3tDjuN/CbRDesT1U4hfbS22EAiuF7U0aH +8oxM2uBXMnBJ+/Rveu3GbRnB0kUa88oMsGjnjHsD5oC+VpAUym8/d8j2Eot91uMklTc96 qTpu2peR0tdtZW/Km8HYnZIaW74RObTcN3Hy83O+ZGMswtVBfufPvPF/BxAr+7WjnO6VfG bbZhpKLxNL1Bcauhklq2uuZEFA7Pf3G+dmabpDE63gO9JOibx5cJxVrHpXBufg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1684228196; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7Sa2180BiRObjiZ9fPuEKFG9tozXWYnkG/1s3K005DQ=; b=bCZ6BqhmUQpbR8Nq+2Mm16yt5eX3dDmfCa7LQA6YWryzW9i6kEP5TUe4obO6WAvgWFQNIB 5QFT4Ye5EIahnGCg== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: smp/core] riscv: Switch to hotplug core state synchronization Cc: Thomas Gleixner , "Peter Zijlstra (Intel)" , Palmer Dabbelt , Michael Kelley , Oleksandr Natalenko , Helge Deller , "Guilherme G. Piccoli" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230512205256.916055844@linutronix.de> References: <20230512205256.916055844@linutronix.de> MIME-Version: 1.0 Message-ID: <168422819629.404.6986084551117973584.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the smp/core branch of tip: Commit-ID: 72b11aa7f8f93449141544cecb21b2963416902d Gitweb: https://git.kernel.org/tip/72b11aa7f8f93449141544cecb21b2963416902d Author: Thomas Gleixner AuthorDate: Fri, 12 May 2023 23:07:40 +02:00 Committer: Peter Zijlstra CommitterDate: Mon, 15 May 2023 13:44:59 +02:00 riscv: Switch to hotplug core state synchronization Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Signed-off-by: Peter Zijlstra (Intel) Acked-by: Palmer Dabbelt Tested-by: Michael Kelley Tested-by: Oleksandr Natalenko Tested-by: Helge Deller # parisc Tested-by: Guilherme G. Piccoli # Steam Deck Link: https://lore.kernel.org/r/20230512205256.916055844@linutronix.de --- arch/riscv/Kconfig | 1 + arch/riscv/include/asm/smp.h | 2 +- arch/riscv/kernel/cpu-hotplug.c | 14 +++++++------- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 348c0fa..13f0584 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -122,6 +122,7 @@ config RISCV select HAVE_RSEQ select HAVE_STACKPROTECTOR select HAVE_SYSCALL_TRACEPOINTS + select HOTPLUG_CORE_SYNC_DEAD if HOTPLUG_CPU select IRQ_DOMAIN select IRQ_FORCED_THREADING select KASAN_VMALLOC if KASAN diff --git a/arch/riscv/include/asm/smp.h b/arch/riscv/include/asm/smp.h index c4b7701..0d55584 100644 --- a/arch/riscv/include/asm/smp.h +++ b/arch/riscv/include/asm/smp.h @@ -70,7 +70,7 @@ asmlinkage void smp_callin(void); #if defined CONFIG_HOTPLUG_CPU int __cpu_disable(void); -void __cpu_die(unsigned int cpu); +static inline void __cpu_die(unsigned int cpu) { } #endif /* CONFIG_HOTPLUG_CPU */ #else diff --git a/arch/riscv/kernel/cpu-hotplug.c b/arch/riscv/kernel/cpu-hotplug.c index a941adc..457a18e 100644 --- a/arch/riscv/kernel/cpu-hotplug.c +++ b/arch/riscv/kernel/cpu-hotplug.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -49,17 +50,15 @@ int __cpu_disable(void) return ret; } +#ifdef CONFIG_HOTPLUG_CPU /* - * Called on the thread which is asking for a CPU to be shutdown. + * Called on the thread which is asking for a CPU to be shutdown, if the + * CPU reported dead to the hotplug core. */ -void __cpu_die(unsigned int cpu) +void arch_cpuhp_cleanup_dead_cpu(unsigned int cpu) { int ret = 0; - if (!cpu_wait_death(cpu, 5)) { - pr_err("CPU %u: didn't die\n", cpu); - return; - } pr_notice("CPU%u: off\n", cpu); /* Verify from the firmware if the cpu is really stopped*/ @@ -76,9 +75,10 @@ void __noreturn arch_cpu_idle_dead(void) { idle_task_exit(); - (void)cpu_report_death(); + cpuhp_ap_report_dead(); cpu_ops[smp_processor_id()]->cpu_stop(); /* It should never reach here */ BUG(); } +#endif