Message ID | 20230609075049.2651723-4-songshuaishuai@tinylab.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp785550vqr; Fri, 9 Jun 2023 01:07:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6UoLn6UUStu95ylfRA5wVfVhJ7vK0I0rDfZ4nsXasmSA3v8czEeEX8OyctU8qw/Nl9x9Gz X-Received: by 2002:a05:6a20:4403:b0:103:b585:b587 with SMTP id ce3-20020a056a20440300b00103b585b587mr1349298pzb.13.1686298028837; Fri, 09 Jun 2023 01:07:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298028; cv=none; d=google.com; s=arc-20160816; b=aiZxU2Rf/BAnWZbL/X1E0rW+Uz1bSQEw4lan2f1en4ON6lKiY9sC7qZaLe0bSdBCUb vivCOnYyph9xmdnnmUkcsjcNA0NFl25iN0/W9y8PhLzqSCEvtgZb7dgwTOpUBLC8jkyT /LIKbvNmTynnv4GFIAS1q1UtQq4/t2bt+kwY+MEEAqUcmg6dMZ7RuEeBsO9zZWzurnWn xG2/fc65uE6eVTnunpuU1sAc6Hgg1A8NDpRybREGg6/4XPzuZshywWtr3wCDo4rKVhVN /Uy4jUEENl+DA3ikzmYX8ZbujR8ZAOIHhFVITAm2zQzRcCXe45eOxATd1gwGHt91G4yW 6dWQ== 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=LSq2huYFiL+Jeb28UiLXaPg8oSbTAymigPOLt/9OuPw=; b=k4iA2f2G+5c4Snc0csl1zcYicslCdmtDWaU/2z/osUZiCl9WePqxELdhz3qPq9cH0F EIj9adRuH3qKvmvhkirPdSprLdYHGiVJxEZN7pQ0a1bhREMxXNjz3pdu7VLGHFr1mk9K ReXo1miVw16t9ZdJyyOScbL/0kAmQ9bmoQ1ThW/5/yY/h+WvfS8T/GUmZBxLXrWfCURS lbEFYeloe6ImiK6Fc4xq0JWMwFQF00rEEMmSCZEZ9xkfdC0BmnYvTbasnCmsldAwWOpu FxhDitTpJJwbpsJ8+3THUz8VN7G4c8lsjEWt7vM8bnI+31uEh0hzLx0Foo3Yv5HSGLQn HKJw== 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 q22-20020aa79616000000b0065ba0464407si2115662pfg.116.2023.06.09.01.06.54; Fri, 09 Jun 2023 01:07:08 -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 S238757AbjFIH7Y (ORCPT <rfc822;liningstudo@gmail.com> + 99 others); Fri, 9 Jun 2023 03:59:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238935AbjFIH61 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 9 Jun 2023 03:58:27 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26BF23ABC for <linux-kernel@vger.kernel.org>; Fri, 9 Jun 2023 00:57:17 -0700 (PDT) X-QQ-mid: bizesmtp75t1686297192tngrrsv3 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 09 Jun 2023 15:53:11 +0800 (CST) X-QQ-SSF: 01200000000000908000000A0000000 X-QQ-FEAT: 3M0okmaRx3ggkGfYbCwXKFcJVxYo7gx8Sd8QId2cLz94QTT20Ue9kVFXfH7mk XRXlTwTPdy4vaDs5QViLJiCIfTnjIdM9r0mNkM/Lo3tRdqRvMoViq+uW6suj/6O70CZSodZ yBkndruclxcfHizm+Fcgr3DrJVwpcAoftfoXGn+7GgsyQkty+8LJ4UE1s3/3RBGpPMOHVeK ATBQplGoG5mPSJPc3SB14N13nmWOdlD/iBdWVzvi5FYQ2rgb/sK7huHvdmi2+iOBgjNj3p+ efTBedwnRLQ+FO9VOscQFfyuQWNvAHv9gArJiuKQYS+RslHMEsQxfCrZNFCY3pvsv1MQX35 Zk6sV93P4gpMhJFjQp1Zd3fFu6+4uY89VJEcQV3S3Cg0AvEvqQ8ahkzsyLvhQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 10720794791275635707 From: Song Shuai <songshuaishuai@tinylab.org> 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, leyfoon.tan@starfivetech.com, mason.huo@starfivetech.com, jeeheng.sia@starfivetech.com, conor.dooley@microchip.com, ajones@ventanamicro.com Cc: linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH V2 3/4] riscv: hibernate: remove WARN_ON in save_processor_state Date: Fri, 9 Jun 2023 15:50:48 +0800 Message-Id: <20230609075049.2651723-4-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20230609075049.2651723-1-songshuaishuai@tinylab.org> References: <20230609075049.2651723-1-songshuaishuai@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768211641869363103?= X-GMAIL-MSGID: =?utf-8?q?1768211641869363103?= |
Series |
Remove WARN_ON in save_processor_state
|
|
Commit Message
Song Shuai
June 9, 2023, 7:50 a.m. UTC
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 <songshuaishuai@tinylab.org>
---
arch/riscv/kernel/hibernate.c | 1 -
1 file changed, 1 deletion(-)
Comments
On Fri, Jun 09, 2023 at 03:50:48PM +0800, Song Shuai wrote: > 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. In the future, please write function with a () in commit messages, so freeze_secondary_cpus() etc. Otherwise, Reviewed-by: Conor Dooley <conor.dooley@microchip.com> Thanks, Conor. > > Fixes: c0317210012e ("RISC-V: Add arch functions to support hibernation/suspend-to-disk") > Signed-off-by: Song Shuai <songshuaishuai@tinylab.org> > --- > 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) > -- > 2.20.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv
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)