From mboxrd@z Thu Jan 1 00:00:00 1970 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 722C7C3ABBC for ; Tue, 6 May 2025 04:13:45 +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=0q7G2mh5xkkSG9wY6x7F+06w0gjTR/NTs0F8s2vljws=; b=iEUmN/iracvcHJ fjEeTvhlTlkjm9Bmu5eAa85QDjOvDASQzyFN03LGLrK9q0fcH7MMkMv2oqJpvoyNmz8SOFxdVhh/m H/HD+jYRREsf8KuC2B+z7cgtKI86aJaYLBjMaTZ+SJZJ64Pst5VHijg8qgotoVHHELRX6T0Tj4Lkk h8DRz8EmrSURJpmJ9Qbf6L81BseS1SP19ErkmvvDpFkY40knUVzf5Y9zOKqDfK7X9ER6XBW7TBwU/ UzrjASTZw4IE9OLSWHZepIJlbib9+kkcKV0Y3CAD67jJ24lN+2k2PVgipjJTkaoabCOQbTi71hSWC IvnaIT8UAy/KhkNnmYnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC9gY-0000000AA0l-3hHG; Tue, 06 May 2025 04:13:38 +0000 Received: from sea.source.kernel.org ([2600:3c0a:e001:78e:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1uC50u-00000008zSX-2sJZ for linux-riscv@lists.infradead.org; Mon, 05 May 2025 23:14:21 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id B175743CFA; Mon, 5 May 2025 23:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03528C4CEED; Mon, 5 May 2025 23:14:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1746486860; bh=B4/AFmH4EzCm+/gzXspUOA/ZQOae4G4h8zpgvZNFaUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MO7eDF7Nx1f0WrpHwAd5nrTmkCoVhkCad9iJKRLOSUPrF8/Dj/l2zDdoeEXV7pbIV fOC8Yu/aBpxQ1Fbku/aWZzhNabiljJx9Ff+X53QehDPTrxomdpwTfTs/FSa1QeNA8z k/L0Mxpw8V+E0fUnOBp9yfi+fA397lJW8ZSl8M0qzGf2UFmWs3k4t1XVKV0xYUQVpt 0YTbkeXBU/6pEarqk45oOnbMzV1nWMOfCwIPlV9d9FNKAGcwrpQ9e7Nspjc7fwPHNO oexFm7i8eeR/0Vtxi7CiQrvnwFhRMvBbBJE6bAJp++HDaoFlKYe75gD8Tz45vJ3xPY jMyudL0nB8nHw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Nick Hu , Anup Patel , Daniel Lezcano , Alexandre Ghiti , Sasha Levin , tglx@linutronix.de, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org Subject: [PATCH AUTOSEL 5.15 030/153] clocksource/drivers/timer-riscv: Stop stimecmp when cpu hotplug Date: Mon, 5 May 2025 19:11:17 -0400 Message-Id: <20250505231320.2695319-30-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250505231320.2695319-1-sashal@kernel.org> References: <20250505231320.2695319-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.15.181 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250505_161420_742768_881C86BC X-CRM114-Status: UNSURE ( 9.26 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org From: Nick Hu [ Upstream commit 70c93b026ed07078e933583591aa9ca6701cd9da ] Stop the timer when the cpu is going to be offline otherwise the timer interrupt may be pending while performing power-down. Suggested-by: Anup Patel Link: https://lore.kernel.org/lkml/20240829033904.477200-3-nick.hu@sifive.com/T/#u Signed-off-by: Nick Hu Reviewed-by: Anup Patel Acked-by: Daniel Lezcano Link: https://lore.kernel.org/r/20250219114135.27764-3-nick.hu@sifive.com Signed-off-by: Alexandre Ghiti Signed-off-by: Sasha Levin --- drivers/clocksource/timer-riscv.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c index c51c5ed15aa75..427c92dd048c4 100644 --- a/drivers/clocksource/timer-riscv.c +++ b/drivers/clocksource/timer-riscv.c @@ -75,7 +75,13 @@ static int riscv_timer_starting_cpu(unsigned int cpu) static int riscv_timer_dying_cpu(unsigned int cpu) { + /* + * Stop the timer when the cpu is going to be offline otherwise + * the timer interrupt may be pending while performing power-down. + */ + riscv_clock_event_stop(); disable_percpu_irq(riscv_clock_event_irq); + return 0; } -- 2.39.5 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv