From patchwork Thu May 25 02:55:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 98762 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp83880vqr; Wed, 24 May 2023 20:27:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4MiOae0CcXoTc8eB6TVy3lT3xQn8PZJ0n98sHwfQLXPmkHhlFTRipld2qlbXliQ6OAZJl2 X-Received: by 2002:a05:6a20:3944:b0:10c:2c30:4765 with SMTP id r4-20020a056a20394400b0010c2c304765mr1819670pzg.1.1684985254054; Wed, 24 May 2023 20:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684985254; cv=none; d=google.com; s=arc-20160816; b=SiKw4okuQBGAOwbfda9vxlzGo7CA43+TdUJAjNG8KUghrZ8kdJgYpfSUa16QVk4peI 4LYXtK9ivl7thIbhHBIRdWjHqIpqy6kZJ5CFig4p/CUL61AoAYDma7e6aIBwcAHhneFJ 5wFnp6WqpkqZ4TV9YxS2zsTpSXKqLBO6c28TRxHhfJdsJDkw3FhlAcsfJIeaHFF6bG7J mqlrw/wLAAeGsijRTGpGDCGGow/VtpjzI+ekgAph22qJbSJUUtKc9h7k0sbi0URfzz59 lofU/r4jZFaLWq644I/4QhmYgH77ml/+lPpo9pjzf1vjMliq94PwzKvemAOwA7QYXkwI ZvpQ== 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=9F3xaYC/dc3OagaIyClonfectf0gFZ+19BU7W78bB10=; b=Z3hCUYz50OqZdmPK/R+czPaXb2Tm1ePSaTz1krBZbxj0zM7sXzfw/rH8DIMDkyg9+4 tJPhBw/bnwQ1HEpjsj9uTZd/jDKu4kD+38I/B45KO4BhNQaJ0Aa3kqCV1zd/V7nM4O5h eZuhv9LyqAkxICpTpkoNXHRAAXT0SnkROMbjnAqk5g1bRktr5NgrjQ+vl+V2X7cpiXyy 3NIU0rCQMgDDtTIgqh15gTh3uRhWfk1PqOIRg4kjxjJ2Yus8CzwPgdB2yl5Ylxrhbeum eTo21I2isUsV8Hiy7nEKpOI+BcYzRDjddcBTib6wS5hcTizyTyIU9JVQNjXJ0+Wt0OQt 14Iw== 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 a9-20020aa78e89000000b0064d44f6fd24si483829pfr.56.2023.05.24.20.27.21; Wed, 24 May 2023 20:27:34 -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 S237807AbjEYC54 (ORCPT + 99 others); Wed, 24 May 2023 22:57:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbjEYC5s (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 46B1C139 for ; Wed, 24 May 2023 19:57:44 -0700 (PDT) X-QQ-mid: bizesmtp63t1684983425tx9azvf6 Received: from localhost.localdomain ( [221.226.144.218]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 25 May 2023 10:57:03 +0800 (CST) X-QQ-SSF: 01200000000000303000000A0000000 X-QQ-FEAT: jXjag1m6xl7WyIELRssET5EuttbKJzokSNielpVbJR2OiTpJeAJqTrFwO96YQ tokwilre7FqbTP0hnGE/ppzEy4bGUXKgRio2t+VIoMM2VWauzbUnGHa+Sipa1RrbyDuNOKx tqcxBrmnAFQ73StoonTBlSrKXKjl2PLQBKsga30zCSInjh0TED/zIWvq4tMsNQNAnCpkJ2b +LvFTNStGcpt/ubUt0VFOLUKlIk15QK9A6SIzGrTD+Bb5fa5C0POkIA6UXLqL4PbE4H4BGq tOb3wYkj0Rdial2N4ncNiCkaWFc0j00Ympqcu8Vo4UNBJiJsNZUxhCfOk3pEyLldJqjsgn2 wZqYEqOCnSmEcXUyeWpuM2qnQwOAUhUxLO5sjkUPYvR0+BKt1ZNLxG/7LKvYg== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 6696857243706674612 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 1/4] ARM: hibernate: remove WARN_ON in save_processor_state Date: Thu, 25 May 2023 10:55:52 +0800 Message-Id: <20230525025555.24104-2-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?1766835098093773327?= X-GMAIL-MSGID: =?utf-8?q?1766835098093773327?= 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/arm/kernel/hibernate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm/kernel/hibernate.c b/arch/arm/kernel/hibernate.c index 2373020af965..84abccf3221a 100644 --- a/arch/arm/kernel/hibernate.c +++ b/arch/arm/kernel/hibernate.c @@ -33,7 +33,6 @@ int pfn_is_nosave(unsigned long pfn) void notrace save_processor_state(void) { - WARN_ON(num_online_cpus() != 1); local_fiq_disable(); } From patchwork Thu May 25 02:55:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 98756 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp73324vqr; Wed, 24 May 2023 19:58:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mNgEee3PxmDTQHG6xaGrZ1lnMcC3Cy7VqvefhTJxbAPjvZxDOaKj99Uhc8m42r8ER/ZGy X-Received: by 2002:a17:903:230f:b0:1af:a03:8d82 with SMTP id d15-20020a170903230f00b001af0a038d82mr43470plh.57.1684983510820; Wed, 24 May 2023 19:58:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684983510; cv=none; d=google.com; s=arc-20160816; b=whXMu7vkER55d90rIYIyXBLrDl/2brQYRMrUn+z6Go3YKQZV8Ern55VSf1RD+2E7W5 RA0YJhOq1t+WlhTqBLhr2BscqOIM9dbnm208pRd8seqz5/slNz2QRkKetZ2EDS3u0De/ ZmBxPjhbi3v+yanIQihzMSboLJqBbi8dsg8c7I6k8QaKVB3Wz35O/1XMkyjCepm8mmKb szQwqbRmMwIotaQ30Mbovuh1tR4swHR172oMoBwpSdKCrVUJ7Hnms10yym5dTLnhfZkR MbdJ6TMk7UWT5iTj5mg3qXK21IGg7l+Xl/b8B7Wo+nsYP8m4BnxfRwsLJKHK8vkJ/ZLN SeyA== 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=c6PZZmRlbY7pi4pQluO9dk4A2LvkMJhZOfQ0wEhbjc0=; b=ZnhSS0SEtBih4fbBqn5SQ8pJothtGCr9bcY9o5LeokJx0bRhxGwnZ16qD5KmVfW7B8 P5b59rny9OdigJu8pNZ0ABux/BY4XCGM8Z+Tqj32IMYqFPjEAlCGNDSwnmXaUYrXMpns QC16vtFcSlErjEq5rN8bds2JFMruWKSdPNpWRcJI2T/fubGyFRSxaFy4MEU5XJHgoRgM prVyAvuge5XLEYfUNPKliRgOX+Nv7JrM63PcYwjqjW/rXm6Z/ywttvtys3VO6ErqFQ52 V0nKxI52dCb01sbYD5/yZwdHq3EtAfLW38y/b6PrneNr0c7iv+cNxDVmn57zWfEPX5vB LGlQ== 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 a5-20020a170902ecc500b001ac84f87b0fsi160662plh.339.2023.05.24.19.58.16; Wed, 24 May 2023 19:58:30 -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 S234199AbjEYC5u (ORCPT + 99 others); Wed, 24 May 2023 22:57:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjEYC5r (ORCPT ); Wed, 24 May 2023 22:57:47 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43354135 for ; Wed, 24 May 2023 19:57:43 -0700 (PDT) X-QQ-mid: bizesmtp63t1684983430tny3hp8d Received: from localhost.localdomain ( [221.226.144.218]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 25 May 2023 10:57:08 +0800 (CST) X-QQ-SSF: 01200000000000303000000A0000000 X-QQ-FEAT: Q40xx9djesRnvDjNn8FEKK30CJtqMZLJIor2xKhK5CaxBB9mt0DXuMlLPYqPB XwU+t+ZR2ppVV1gWFz/3tdYgXvOqNyx2sj1tDRvmvPJSxWf9mmIV9/kKzgpyLRFF6pAKMpv dB0eKB2SSKXJh3FTbdTch41OWKYEWPRex1/kKW7pZjOibMJK72PzfbAwoYu0dNrdZKe15AK dTMzuKSl3z/YxPs5jNKNOm7HuebEE7nCnLbDXy5qf6ij3OKz81p/au9NFgD8Zl6iWkiPEDq GcW6VwoPGDF1TVFO2o+HzRuvCW71F1mCYe/bYfS8TJHE/z7e4lhSzEBaQvPwUFBEwu87AX9 fT3d27frdI1M3q8tgGm3Jw0nwmLKBJdf6njsyPLQRlj+Yw3Q4gHY9U0yQCyzavwq1c5rNIA X-QQ-GoodBg: 0 X-BIZMAIL-ID: 4042248179779979880 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 2/4] arm64: hibernate: remove WARN_ON in save_processor_state Date: Thu, 25 May 2023 10:55:53 +0800 Message-Id: <20230525025555.24104-3-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?1766833269630679166?= X-GMAIL-MSGID: =?utf-8?q?1766833269630679166?= 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/arm64/kernel/hibernate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/arm64/kernel/hibernate.c b/arch/arm64/kernel/hibernate.c index 788597a6b6a2..02870beb271e 100644 --- a/arch/arm64/kernel/hibernate.c +++ b/arch/arm64/kernel/hibernate.c @@ -99,7 +99,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) 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) From patchwork Thu May 25 02:55:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 98758 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp74043vqr; Wed, 24 May 2023 20:00:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5aziXjvtInycIOd2NuMJCuQ690fwOCnFryn3lc2kTZYa1BorWRbtickUAp+SAof+FSVCWb X-Received: by 2002:a05:6a00:14c4:b0:646:2e83:6b2e with SMTP id w4-20020a056a0014c400b006462e836b2emr5665825pfu.31.1684983632818; Wed, 24 May 2023 20:00:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684983632; cv=none; d=google.com; s=arc-20160816; b=I/xdTndm1Ljkt5ev0Nmy5FcjW+9ye2cIVdhvwqHLEoBDiOxsAM7BYrtJv56Hatco4A t7tgQGF9BuT6bd3dhMUGooKKzH+abeee74zExFAnVnQj4itOr9AQZRXe5HfGselouT93 Zc+nw66mjnL7s+uG1fX1F8pyXNKAPiA/Mra2ZRGi2zlFZAPH9Be810vqGo5l6NSBb/QC o/3rFPIgqm50Gx/0uFVBqoX5VPg8ry7IwmCcDobSMqs2Z+a/CCTv9x5TI1k55UvcgO6X Vw2bslcsgMSPhywI4voUIptSzy1r/KqUQ3fnIGQaN2A/ZyFYwnCcfQqdQaXS+GCEVb8b 2T/A== 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=WwHZqt0k3Zh2JwFmmpn7iRUEAdRzcsXjkPtpw3GP9c8=; b=ZoI7R8k0ILNl25cqjXurkv6uc8SzcHtZPnvjYyqmUOeeeztwd2uC84hyfbZp1cEswp w1AKN79vUnH9hlSOjD088RKp78yZBjevdMkXNLFsJnjJ63BQ5WJp+OEDMaYWGRhQgN3T rYDwg0l71ZjfqtJ0g+X9A4xoTLEf95g9M1emG+JKiEzzEkdoyUC6m5tMtrmoZ5QVia2Y Wtls2n2kIwMzgE6/lHbygqj7iHHOhZw8TwXPmimfR2MQ5BEGO7llq7ZvjIM9zdrQjfQ/ DwsztxL9pPEmk8acSImU8YynkN6VfHQRsAL4UMJdPPhv6zuKEyB23o2fBXa40pulMW9L 8nVA== 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 s132-20020a63778a000000b00538d00a0799si7030pgc.792.2023.05.24.20.00.16; Wed, 24 May 2023 20:00:32 -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 S237956AbjEYC57 (ORCPT + 99 others); Wed, 24 May 2023 22:57:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51710 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233257AbjEYC5t (ORCPT ); Wed, 24 May 2023 22:57:49 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4D77183 for ; Wed, 24 May 2023 19:57:47 -0700 (PDT) X-QQ-mid: bizesmtp63t1684983441tzej1xdq Received: from localhost.localdomain ( [221.226.144.218]) by bizesmtp.qq.com (ESMTP) with id ; Thu, 25 May 2023 10:57:19 +0800 (CST) X-QQ-SSF: 01200000000000303000000A0000000 X-QQ-FEAT: X3kNTHUrKMRJlZyT+2O5RdJGnxa2VEocmY9T2Ec5y4fHeQHbTKNAZHig3qVRw ugOfN+JUwaPDLD5af5iOZUA1gZW0bTB+xogyUz+29+XMpMp/y4kkGtYkNMmSkqAankJ89tN 7rgEUUJ0S9TNc6bW7ZlBlE9bhf0lPjRcvNwD9pygpsAGuM8Ad6FRxbZX584iCgA6tMj9jXF YlfaPcuPTXBBlSzNvxE5t7dWdzrB9dTSJ9QMQDuirSJ2rD6501e7T61GKiZI67m+vt2wS1n VjK12Xz12c87qvD9joA+8u4n3BOR84XIQPfGK6v+6Pe3CpKtgheeMeLjGb6A1/XtJfFe6iF uDRqZyUxoZQDgVORNOxbTtMN4GKhH08Y/8WJp9YyHLgm2ZEcMq6KJoi9GDRC/PWoD/vIVob X-QQ-GoodBg: 0 X-BIZMAIL-ID: 11307094136493837363 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 4/4] xtensa: hibernate: remove WARN_ON in save_processor_state Date: Thu, 25 May 2023 10:55:55 +0800 Message-Id: <20230525025555.24104-5-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?1766833397698163456?= X-GMAIL-MSGID: =?utf-8?q?1766833397698163456?= 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/xtensa/kernel/hibernate.c | 1 - 1 file changed, 1 deletion(-) diff --git a/arch/xtensa/kernel/hibernate.c b/arch/xtensa/kernel/hibernate.c index 06984327d6e2..314602bbf431 100644 --- a/arch/xtensa/kernel/hibernate.c +++ b/arch/xtensa/kernel/hibernate.c @@ -14,7 +14,6 @@ int pfn_is_nosave(unsigned long pfn) void notrace save_processor_state(void) { - WARN_ON(num_online_cpus() != 1); #if XTENSA_HAVE_COPROCESSORS local_coprocessors_flush_release_all(); #endif