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: 105359 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp785821vqr; Fri, 9 Jun 2023 01:07:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7O8dgvsS5/4OcFlrJ1sp2ughZdzFTH1VXxWTIuJnuTnd0WJDae4+zv7xQPSxWYvi663ipw X-Received: by 2002:a05:6a21:6808:b0:118:b2e1:9adb with SMTP id wr8-20020a056a21680800b00118b2e19adbmr542557pzb.61.1686298064672; Fri, 09 Jun 2023 01:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298064; cv=none; d=google.com; s=arc-20160816; b=u3CS8D62vDEwZINr0g5m3JcELgawNnPlgZEmaTN6bPvCwEJ+f6gJENy5VRs6to9fCo RoEyPvlmYpnlP9GVLTjx55pSBHt7PB/LSOQFTMmHQ/ZhB/+pKuVbuBHQeLAjWWCyZDMu uKj8/Bsr+5lpZ+hhKzE6QNCiEvmKTC2BeDZneunaccauWXxzob12JvekX7emO3tw14oF hYZU/CVJln0wDrVDNuTiZJq5xW8ScUES9GjBlJpS80FBI/dPf3cysD7NbSQFcLssjNQF v55CmZorjhxUktgwQj9+5jsalYSnp/97YwRXFF6n79trkrZpKu1XTtTDoI2hl22Wdz/S /Atw== 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=cOXELgq6k6BiKMNNgntEHlGDk878F8pFtCnjlYmy8qw=; b=zoCfuGOs/DnAYGGT0r/W2C7uoLstAITpiUdPlnX6aIZu7z/UodYdIqc7ZfI8ewwVgE BjY3p1g3C58JLfsRv9exG0FEkXap0GjATdlCYcas4S+T38E11bRAsV7ITMzUkJr7/2aL szSeap0bhXCa75Mv1aaU4QwHwRrcWLDc+71B6lh/r4x6hz95xUwQERfxoMT5z8Tq4qky OhSRCE1aLqXC+cZk8pm88GOo37RqMmj12q7vd6w+FGrItmIJXVXWsoSpm5eWkXxkjimK O3N/7LlOgtKLFdlQrkZpUdtmeNNOWs3PhZdrj/bmQZPuspt2Z9EhzFi4KPXIHWJJZNJq av+g== 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 k11-20020a637b4b000000b00543f6a35a43si2363799pgn.306.2023.06.09.01.07.30; Fri, 09 Jun 2023 01:07:44 -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 S238268AbjFIHzm (ORCPT + 99 others); Fri, 9 Jun 2023 03:55:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239848AbjFIHzN (ORCPT ); Fri, 9 Jun 2023 03:55:13 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.155.65.254]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B9B33AB2 for ; Fri, 9 Jun 2023 00:54:53 -0700 (PDT) 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-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?1768211679628475805?= X-GMAIL-MSGID: =?utf-8?q?1768211679628475805?= 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)