From patchwork Fri Jun 9 07:50:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 13273346 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D817C7EE29 for ; Fri, 9 Jun 2023 07:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0+FZq6G2F+fBSWRvOAG3+3pAnt792+k0mxVezEzZ434=; b=o+7mnw4jMH2kMF ea++UNHuN/2H1EOFUZ1NawGfrsq2M0orXJfjjqKkU8caCM20P4amnrHDaHspPthRdO823i2I+p99j +GXHVgALEnmL0H0lruIeXRQt6ulQuWdqkOHV258o1/rucusbnJx3GQsXbzjNDGpCvhRTIAtlBU0Nj E2XkwUZI9QkyHqy00w6LudwvEF75uTmD2U82vzMO4Ypy2BAODkCLTx38mZ2AZunqnSs8almlOkhg4 HCEQQFCqRo6/Yrk04bUmZDUm2HJbdnEBdNLzFcxbe5ul3dtsDYdQ8hM1Z6jo8/9EXoV8BLqwLbDJ/ ZiSumr7l0gughb4S+2wA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7Wxe-00C7xa-1G; Fri, 09 Jun 2023 07:55:06 +0000 Received: from bg4.exmail.qq.com ([43.154.221.58]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7Wxa-00C7vm-3A for linux-riscv@lists.infradead.org; Fri, 09 Jun 2023 07:55:04 +0000 X-QQ-mid: bizesmtp75t1686297183t5b49ol1 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 09 Jun 2023 15:53:01 +0800 (CST) X-QQ-SSF: 01200000000000908000000A0000000 X-QQ-FEAT: LE7C6P2vL8Slpzrm1XqX/NSEq4Gh8yu/0CJVEhG8vffk67PxM+PX5fPKMAlLY cgVx+LApeHIIP4dPRnWhGhFCTTNr3/nY1V9COFfHlHFW3kufcVYPY5wQiaID8SLjuxaLa2E uNUE3Nl33XPXZcR1sazoJ3lDRQ30XwbCdCW4r+ZJucfFTDmZpCIP74QOunzFYPg6xcoXQyE r5zlMKRlUYcxQxsQYmrteRd1dE/L1azUwb5i68qYa04kwxAB2Aq+olALF7hzEyQk9Jvky04 BjIzBrbmsS/uJOC516TK+B+lockpx9YGn5dcNW7fLP+YGmzayoXwCx7bchmeld3f3gBgVRC j6WpjWtsSXld/DrLKqb6MjXzfXcYREx6UdmcvNfMW7tFSSThGRKJJoUOie62w== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 15822184315123759459 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, 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 1/4] ARM: hibernate: remove WARN_ON in save_processor_state Date: Fri, 9 Jun 2023 15:50:46 +0800 Message-Id: <20230609075049.2651723-2-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 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_005503_345915_BA47866B X-CRM114-Status: UNSURE ( 7.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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. 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 Fri Jun 9 07:50:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 13273347 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A97DC7EE29 for ; Fri, 9 Jun 2023 07:55:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=neDsHFm+JQ/5m/weXyHSrynGvI/AllbM9pcZcrD2cUU=; b=tsFiutvxItTcYm Xy0WXh97ZrtFiAOFsB/3ZaSjRwFOr6CErFzbkwHNRjih6s0MiWBnHsDFMDtBR9Azbele1upIfaXHM aiWukjm3vUFqm+C3UWAYj9olkR4t6VOesTuSu/pJ/YjZGDKEv9pgGmBZatF3XMnh6hpbCWFQUYQQp 1jWjnK1cuEGZsKaVE1QGWTd3CPEMZRtTEuE2GLZ7Sygmwj1GXY1uTHSvZG5gHVDmpjqJxYMSMlHMz xjTr2XfnzSIkkhlYFlczlPRlfLE9gtgQtnswnZiKFecxX8RLN4kKIv+JYVlL5NHIdcLUqSJVSXW6u Is0P7FHfRYZCGB9unsGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7Wxt-00C851-1B; Fri, 09 Jun 2023 07:55:21 +0000 Received: from bg4.exmail.qq.com ([43.155.67.158]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7Wxq-00C82J-17 for linux-riscv@lists.infradead.org; Fri, 09 Jun 2023 07:55:19 +0000 X-QQ-mid: bizesmtp75t1686297188t6m0bx24 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 09 Jun 2023 15:53:05 +0800 (CST) X-QQ-SSF: 01200000000000908000000A0000000 X-QQ-FEAT: UMQM+3VOEYsTPC6jMH0yzyXH1849klDsTAUlAptToZKS6J3/4lSimAAJC/4Gj WEUddFwIUU/2iF8bNZxbaQuHxqLUg5SxFyhEmhcPQC534imMFNhOcwHDyehWwvHQii490Zr cnCZorPfAhuqS4hv4C3m/udby3n0mIAvc5zXEG/oeEmxLYGywlgqwxeD0xRGvWfw77lbRKV Vu1L/Fe5f+BRDZPeTPFPWK33uLeuc9WQHaUcuJn8VUUGtDiWWO/JbsTAnVsRta3kqtiGwqe jA1gbcit/YVp+S79o12TSH6qmlBAnmXWtCrNSplYOBBWlUdNVfYES64zkcDROxPzNplA+zD d7eptdHA752wVCXgT2bSBhpDPTXeAiPDt448w1sOQRbijVWdOpLDcg/G0wjKQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 18318848536038158331 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, 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 2/4] arm64: hibernate: remove WARN_ON in save_processor_state Date: Fri, 9 Jun 2023 15:50:47 +0800 Message-Id: <20230609075049.2651723-3-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 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_005518_705291_A5F9BAD6 X-CRM114-Status: UNSURE ( 7.45 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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. Signed-off-by: Song Shuai Acked-by: Will Deacon --- 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 Fri Jun 9 07:50:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 13273348 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3BB08C7EE2F for ; Fri, 9 Jun 2023 07:55:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Zj1pDy2Ui2ykD3qjgfL75rSrXtrJdLxnYyEcbF867as=; b=jqZ3A5Jq1X2/uw FBIrYQOHbDvWENGO6+OFgf1G7WjYZ6fQQWK2cIwZleJ3RUqhwE2OA8ssolZxITE0VAblGSy8zmSHb RYBmJ4g+0yyPz42zXF+Xz/zIG5CZwIEH8dbJ0rQfijEkB9pu5eDodBpMFqwVEmL70/VBTGGDCQEhL WuAXByygtmypb6Kk9Bz2EtMc43cOViOqdzYOaOv8oXhETryqqWAqNlpgDP/kNJcy2yn4KEzrmt6jr SgfKuUU58+H9P7jcz4KkK15q/R6tOE90gGtH/S55J6dRuKCMcBVsjQAkIPaHfsB4EFKqMw5cZi7TX EFiIE88/L9lL4+oItRhg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7WyP-00C8J8-1K; Fri, 09 Jun 2023 07:55:53 +0000 Received: from bg4.exmail.qq.com ([43.154.221.58]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7WyL-00C8Gy-2P for linux-riscv@lists.infradead.org; Fri, 09 Jun 2023 07:55:51 +0000 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 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 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_005550_103961_EC1F58E1 X-CRM114-Status: UNSURE ( 7.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 --- 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 Fri Jun 9 07:50:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 13273349 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83E06C7EE29 for ; Fri, 9 Jun 2023 07:55:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=xTUNCNHjjryf/+afpSWTWDrEHFFfTxNBH5WZsf7XxtE=; b=PWqCiCtro2/Orv 43yFL+Xo86Rtm0yvRexdmUalsuCzN+Nd//eWtn9uSJ4NzBsP90CXNFJiYfs8Cv3cAU7fuPwdZ5epz Sw/bLebyBBtxMojwtw5W6Wf9171nKecJY5kY4eyaaHzMscvgi4P3nPloE2qOC9luy3Xya6N94YXJR 8lbq05ft0AjhHAKJf0rILXAJ+6LUJZK0slzU6dELyYoQXWEEaAiieXyzMkNHEwWWIBul6wQMqXx5m WWeXELA3Q8t3ncxy9ZA1LAm8DzoW2SswgrIFLqQKXjiVsQRTzJ9MEEDdzs94+VftjZGb7enXFoMN6 t6r+9N/IA3eFtvlLJJAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7WyS-00C8Kj-01; Fri, 09 Jun 2023 07:55:56 +0000 Received: from bg4.exmail.qq.com ([43.155.67.158]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7WyP-00C8J2-2H for linux-riscv@lists.infradead.org; Fri, 09 Jun 2023 07:55:55 +0000 X-QQ-mid: bizesmtp75t1686297197t84smj5p Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 09 Jun 2023 15:53:16 +0800 (CST) X-QQ-SSF: 01200000000000908000000A0000000 X-QQ-FEAT: eSZ1CZgv+JDrzqJXUyJ/mcu057NGxL1xBlezD+yoPQqZOp/XEym+SAkiqR8mP y/mpdUlUsr3GccK7aytaQDnPMxaiHL0++ERM3P1l+Z/Ht3BibeLCrNg1poYm/nD5zSwsdMD x72PQm0lIBAV69smXv3fYf+3+HlF6GoJyEZQNabbUaICIzb/E+0kXyTuI+T+To9yodHmBDi lHBYo3hnlIeaXt+2+yLenDhJTnsQ2nxYthPnKi+X7qAPucOcklQ2F4jIZVhOcufgT5JU8AT Y+xJXmSZCBgWSYe/O0u0TIksw1pW0bqCG4b+661yftYmZawpM3HxK5RHa0LJQUgbugjwNuR WIICypWsMDvDee8ZyVamLyn6/2XgGOU6joVIrGjkqnxJHXfJbmwurL5VSNFuQ== X-QQ-GoodBg: 0 X-BIZMAIL-ID: 2352795355600838194 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, 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 4/4] xtensa: hibernate: remove WARN_ON in save_processor_state Date: Fri, 9 Jun 2023 15:50:49 +0800 Message-Id: <20230609075049.2651723-5-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 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz5a-3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_005554_064968_8D8C231C X-CRM114-Status: UNSURE ( 7.22 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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. 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