From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E5DD8F74 for ; Sun, 16 Jul 2023 20:17:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8041EC433C8; Sun, 16 Jul 2023 20:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689538657; bh=OipVeI1y5XovlqCrkr6fZXqxAuv4xVRiEBCwr9USnuI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I6mjf7aaOUnUovw9GXBP3AB3gDVTnVHkS5HYKHzPp95SCqlzzhXJM5GFHirCJZjOp lzOgzZCgpOBQ2bXACqs1gIydGboJMH4Q+mQtS5rB2QRZ8lWIQy6h8k2BFpdJZWw6j8 LLIzgkf6hnxrwt4q4+OwJ7GR2e7gFBMftU39U+zk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Song Shuai , Conor Dooley , Palmer Dabbelt , Sasha Levin Subject: [PATCH 6.4 494/800] riscv: hibernate: remove WARN_ON in save_processor_state Date: Sun, 16 Jul 2023 21:45:47 +0200 Message-ID: <20230716195000.555452709@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230716194949.099592437@linuxfoundation.org> References: <20230716194949.099592437@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Song Shuai [ Upstream commit 91afbaafd6b1f1846520efd2b158066a25a1a316 ] During hibernation or restoration, freeze_secondary_cpus checks num_online_cpus via BUG_ON, and the subsequent save_processor_state also does the checking with WARN_ON. In the case of CONFIG_PM_SLEEP_SMP=n, freeze_secondary_cpus is not defined, but the sole possible condition to disable CONFIG_PM_SLEEP_SMP is !SMP where num_online_cpus is always 1. We also don't have to check it in save_processor_state. So remove the unnecessary checking in save_processor_state. Fixes: c0317210012e ("RISC-V: Add arch functions to support hibernation/suspend-to-disk") Signed-off-by: Song Shuai Reviewed-by: Conor Dooley Link: https://lore.kernel.org/r/20230609075049.2651723-4-songshuaishuai@tinylab.org Signed-off-by: Palmer Dabbelt Signed-off-by: Sasha Levin --- arch/riscv/kernel/hibernate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/riscv/kernel/hibernate.c b/arch/riscv/kernel/hibernate.c index 264b2dcdd67e3..671b686c01587 100644 --- a/arch/riscv/kernel/hibernate.c +++ b/arch/riscv/kernel/hibernate.c @@ -80,7 +80,6 @@ int pfn_is_nosave(unsigned long pfn) void notrace save_processor_state(void) { - WARN_ON(num_online_cpus() != 1); } void notrace restore_processor_state(void) -- 2.39.2