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: 105383 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp792081vqr; Fri, 9 Jun 2023 01:23:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6bmdMFd/fj8OCybZiNDrRQcnwseQ+APJ2KJMr1sfVldT1ltqgQ8xRehzyo/iQ8eJHRYKh/ X-Received: by 2002:a17:90b:1b50:b0:24d:fbaf:e0b1 with SMTP id nv16-20020a17090b1b5000b0024dfbafe0b1mr453738pjb.19.1686298983764; Fri, 09 Jun 2023 01:23:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298983; cv=none; d=google.com; s=arc-20160816; b=L827VvYFcNx421mbtX4UOOslUpHqcx9OUeShCRG6peNgjkQgVNXXblsMKimSZ3Y4LK PPeeh0qP6iUxugWzqHzzCys/K2OuyERh+sUuZwRZpbBVOUlkzBXDytr2bQRNx/Ha/gq2 rS38ED+vRogi65YroYyKCOO5tRcGZ8Ft0wWWk8TxJw8nyfrXUu7dNhB9h9fX6tB/Jx12 qEvi1JEaVfAMH7R8mUTeT6DCsJHKHC8LXzp82XZMq/GH1VoudXCXTKpmywTDtHWT62IW Sz7KigauQIIkU35BoJ8eDdUlZLfouFTYEMe/sfnkBYe9tCVFyW24PGg1Unovpy3yoE6H AlKg== 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=IlrabuExy81wa2jjbNsw5UztXDKHt/aFUCH3BK9QAik=; b=hSB1KAgpRgCjERKDS3ekKRML1jyqWrtQ7MO+9ZqSiSIKzHo6+QAEchJMtmFoTff0Dt JVI5ccPQymNz7C05nSKOSOZMcK+zfz+HAa0rwUSSEQWfLoYmnjtiNP7rbwfq6udpQBdY pdn76JC4vwyJ6cJgoD8xUwTi6yntmqEk06PiCfZ60xkU7QILejIgSXjCRxKft0gZ/SNJ 4qg00dEWZ+3OC/H7au/BDHe20Agsw9xb62zumGaZya5txuKcS/KrLeg4ODOlkNPo1aUt yT/dZKArfUF0oTRYeKkxDVISf3GCdhUlZGUDdK6Bw2lRCS95yfMQKdIfBgReqRi3A/n9 wIaA== 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 lk2-20020a17090b33c200b00259609d53cesi4201170pjb.68.2023.06.09.01.22.49; Fri, 09 Jun 2023 01:23:03 -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 S240057AbjFIIDi (ORCPT + 99 others); Fri, 9 Jun 2023 04:03:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230334AbjFIIDJ (ORCPT ); Fri, 9 Jun 2023 04:03:09 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 154354EFD for ; Fri, 9 Jun 2023 01:01:31 -0700 (PDT) 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-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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768212643181665690?= X-GMAIL-MSGID: =?utf-8?q?1768212643181665690?= 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(); }