From patchwork Fri Jun 9 07:50:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Song Shuai X-Patchwork-Id: 13273340 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 36A2BC7EE25 for ; Fri, 9 Jun 2023 07:53:55 +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: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:In-Reply-To:References: List-Owner; bh=1hLZ9dUlJMBK05+V3tkYik6HGwU6zIz6eC4AwTQwTzM=; b=mZIKSQgwMZr+Tv g1cuJiSaAMRw7IMJiAEqt1ttZjZthSj7m2Y+WSLEL2knsCJKsMxsZOY47UuVCIm+0MxLR9H1vux+O PRcmphj+CapM06CieuHZcK90V8fCOjuKEbvO2xZLO3xoYhtVi0wJJALMhAOL4EnJe4nVLijMGo4j7 Q2d74vAKcFXgd4KrjqDZ4dQEJJX6XX1SsTNSU5MM/i6MhMPwQTdyGcAZH2jL4kyLY9bnf91a7XMBL jFfSdi4dyvqS2+TWqNDv6kVKfsH26mhNS/y8pTjb/mEEyrkbFGFmywlJ7nHeIltbgsRklZsJ4hCjR 6g09hocfxPxnLw5IQlhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7Ww9-00C7DP-0l; Fri, 09 Jun 2023 07:53:33 +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 1q7Ww2-00C76o-2l for linux-arm-kernel@lists.infradead.org; Fri, 09 Jun 2023 07:53:31 +0000 X-QQ-mid: bizesmtp75t1686297177txpqd2r4 Received: from localhost.localdomain ( [58.240.82.166]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 09 Jun 2023 15:52:55 +0800 (CST) X-QQ-SSF: 01200000000000908000000A0000000 X-QQ-FEAT: +ynUkgUhZJmBFu75q0NPiJ6aTl945nO9gpI8bXNQ/ESzHgPsBD6fTZ5m1288J zUyIKDG/VCQPAvgJv00JVCR58ywZjCK6YjDdv0JYBuzp28QKvYJwqgFmgP0oldjR3hTAGFh PUgfCXEAj9hNkaK1ifnQvqZt2ZVmVlRKFE9S0CwxsXKkjf++zlB6yn+WLwkCpF6nmISkiYO l7FFfKrhTDo2/Gd5+cLEvSf5U2NFe/6FgXmSHV9azmKTFtTXoAbtfmPOnGUr+72hfELjQI2 LQh2KPGArq0GVhIc115bdF+haP9LAbyfiuQuKkruJFA2zoeWVupU+Wjd++LJOVZKaeyn2/k fzwyP1B9I/hfqdM+s03OjYv6W3oVvNP2lpFAA22 X-QQ-GoodBg: 0 X-BIZMAIL-ID: 14437550590923538906 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 0/4] Remove WARN_ON in save_processor_state Date: Fri, 9 Jun 2023 15:50:45 +0800 Message-Id: <20230609075049.2651723-1-songshuaishuai@tinylab.org> X-Mailer: git-send-email 2.20.1 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_005327_228807_70CDE9BA X-CRM114-Status: UNSURE ( 5.79 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=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 for ARM,arm64,riscv,xtensa architechtures. Changes since V1: https://lore.kernel.org/linux-riscv/20230525025555.24104-1-songshuaishuai@tinylab.org/ - supplement the case of CONFIG_PM_SLEEP_SMP=n in commit message as Will suggests Song Shuai (4): ARM: hibernate: remove WARN_ON in save_processor_state arm64: hibernate: remove WARN_ON in save_processor_state riscv: hibernate: remove WARN_ON in save_processor_state xtensa: hibernate: remove WARN_ON in save_processor_state arch/arm/kernel/hibernate.c | 1 - arch/arm64/kernel/hibernate.c | 1 - arch/riscv/kernel/hibernate.c | 1 - arch/xtensa/kernel/hibernate.c | 1 - 4 files changed, 4 deletions(-)