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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1A4D6EB64DD for ; Sun, 16 Jul 2023 20:17:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbjGPURl (ORCPT ); Sun, 16 Jul 2023 16:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231681AbjGPURk (ORCPT ); Sun, 16 Jul 2023 16:17:40 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 173C090 for ; Sun, 16 Jul 2023 13:17:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7376560EB0 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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