Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1737385rwd; Fri, 9 Jun 2023 01:07:11 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5QhweSBjzNFS1UQmaG84WyXi+1b/QhWXGfLV/P5lXzbGMngeXxtzctChnl6fxYqG9Zmkp+ X-Received: by 2002:a05:6a21:3986:b0:117:1ffb:a14 with SMTP id ad6-20020a056a21398600b001171ffb0a14mr648252pzc.13.1686298031362; Fri, 09 Jun 2023 01:07:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298031; cv=none; d=google.com; s=arc-20160816; b=qTM6K1Ah45bT23NBj8B+uyHrGJo08plBX/c5C2TRnCFg4QS0A2VITo1YrOgkHq214s xtui+FnoqcZKZ8vkTVFY/2EpGv0TbL9Ly8pYiCkzbY6CDVwD3CXwlbGxLGhUoOn/bzI/ 1+X/Co9ZENFeASc0jnu/+rDBxvT5fW4K1lX5Gex734v/hWsZrOgRkKrxOrr9psTdYkte /v5A51nJmeOSSKAIZnQPj6xtZsHrfo7cZly/JUDlES25xe4HjkvWls2oJtRRRfNAFoO5 jDZJoc2ZA+Ctd0idLrX2Nca9qePpjndFBFMBtg+A80N3aK+w4RfCQxH3ZQmpUNj2Kaaq VAlA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h21-20020aa796d5000000b0064d3e651979si2116427pfq.233.2023.06.09.01.06.57; Fri, 09 Jun 2023 01:07:11 -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 S238648AbjFIHzk (ORCPT + 99 others); Fri, 9 Jun 2023 03:55:40 -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 Content-Transfer-Encoding: 8bit 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 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/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) -- 2.20.1