From patchwork Thu May 25 02:55:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 98759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp77653vqr; Wed, 24 May 2023 20:09:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4q300baOvk7/ESro+yOcBKf1bdZ3krLWJVOxd0zcdLuak0oPWubi5ixjFu0iGdcMs3x7GM X-Received: by 2002:a05:6a00:14d0:b0:639:a518:3842 with SMTP id w16-20020a056a0014d000b00639a5183842mr7249725pfu.7.1684984157442; Wed, 24 May 2023 20:09:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684984157; cv=none; d=google.com; s=arc-20160816; b=BZ9Vw3v/cqQRJfcyolP5afZiDpm3860vChrGqGKFTHEEOzvSiY7XIXMvFDtR2IMrJk Gt2ewyEJjdVkPBBng2v2jMz6oNn9cR3fQVOoCTbR+/7q4kRpLfpPVXjWsVVWgZM2R0o5 xIhlGGfw2AS5+8P14qkm8gTIdi1ZBLOtlApgB3qIwlTIemRVquPmgZk9vw4eiXH2yfrt YrpfWHNUmiwErDmcGYFP1+cThRAJEneU36YSO3HIHbeAGsbyvfMlv+/3TdizT2YGjqpp DxS2smqTBT9+JP3R7N1/MOFpLW0MXA/wwNwYzcmxH/9E6z2ulUzEEJTkqAoQ7VNk4Pwe Jn6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=NqEgROKhIId25jciV0KYeL698WJ2Bx1g+2+V53o2bY4=; b=fbYXw482Twb42KK4S2TKFBUFdzSSR4EGta3PcWblHELXc3LUnStFuKIcliVCto42Xu vUpQPVN6AZlPvYRB+Yih/+XzNmu1ZZ8FqNxcU5YdXk8X6dHck3J9KHlRCa6MQe8c3lKR Yqc9mpxpStmG/F2QRjS/hMWHKxGewOmeRrJjpPQuHoNnhQP5gRnJjK4gzhivDgqfC5kY iiAQMQvLOwaQfjP1saHP0s5hkD2IHPvCtVh6jzWw9kSFLHsP+DOilcJqoPtCfZjULV2A QBfK9CjHG+fCzqE7Qv418jLC2RcEuwYYrxFu209gWPt7NQX6iiZ/AAny4XdtCIkwX+mm Wsng== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c192-20020a6335c9000000b0050c0305bcc3si23449pga.872.2023.05.24.20.09.03; Wed, 24 May 2023 20:09:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237227AbjEYC5x (ORCPT + 99 others); Wed, 24 May 2023 22:57:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbjEYC5s (ORCPT ); Wed, 24 May 2023 22:57:48 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4724213A for ; Wed, 24 May 2023 19:57:44 -0700 (PDT) X-QQ-mid: bizesmtp63t1684983436tc4md4by Received: from localhost.localdomain ( [221.226.144.218]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 25 May 2023 10:57:13 +0800 (CST) X-QQ-SSF: 01200000000000303000000A0000000 X-QQ-FEAT: jXjag1m6xl5ZXRPvlfx7FOzns583Qa4+KA3B6kg49g6czQo1AbT32d+KPrxfJ cmTlBr1DnsRyQbPDfKLGciMk4B+ylpOzsOX9RctduYLeEuAlmq3E4sKqYDVfFaw3cfqE12o gVQCC2bD77/rUkQERGv3c8q3Pdpmr/Re0hCdHFBb8aoXMeALLHzg1HGymZHQ4pyy9AiadRT GzJtw8hLQcWzaK8WWd4Jrebu8d3OZaVHCQWP3TEYqZ/NpQ/3Ca8xG5DZSdH3vd7cTEGx5tA 68Lr6WidVIkVvna98ZlnltddOPkyhLIU7kqoI+O+w+yDmu5sv4ksyG2yTbgofNf3x1CuPZs wKRROMB8p3ftAGiD+3zDxXtcb7o7DR3omGM25n6AWxR9d/vzsFxxjG13oeWybHUksvhorRL X-QQ-GoodBg: 0 X-BIZMAIL-ID: 13095273285713463459 From: Song Shuai To: catalin.marinas@arm.com, will@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, chris@zankel.net, jcmvbkbc@gmail.com, songshuaishuai@tinylab.org, steven.price@arm.com, vincenzo.frascino@arm.com, pcc@google.com, wangxiang@cdjrlc.com, ajones@ventanamicro.com, conor.dooley@microchip.com, jeeheng.sia@starfivetech.com, leyfoon.tan@starfivetech.com Cc: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH 3/4] riscv: hibernate: remove WARN_ON in save_processor_state Date: Thu, 25 May 2023 10:55:54 +0800 Message-Id: <20230525025555.24104-4-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230525025555.24104-1-songshuaishuai@tinylab.org> References: <20230525025555.24104-1-songshuaishuai@tinylab.org> MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766833947854657483?= X-GMAIL-MSGID: =?utf-8?q?1766833947854657483?= 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. So remove the unnecessary checking in save_processor_state. Signed-off-by: Song Shuai --- 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 395f835f067c..86f1c9ab6b0b 100644 --- a/arch/riscv/kernel/hibernate.c +++ b/arch/riscv/kernel/hibernate.c @@ -119,7 +119,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)