Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1745779rwd; Fri, 9 Jun 2023 01:15:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4D9KtWc4y5xuYk9so6eWhaJbqSFqyA+8mNcu4URyUR6hFwAbdXISOjikdQ9GyVMuXnrHNx X-Received: by 2002:a9d:7993:0:b0:6af:6f82:1e27 with SMTP id h19-20020a9d7993000000b006af6f821e27mr853087otm.3.1686298534672; Fri, 09 Jun 2023 01:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686298534; cv=none; d=google.com; s=arc-20160816; b=ZAXk9PTZcwJJOdhmdyVOzn1bgtD6gb5Ec+qJ4Y1jFhmgbGjkeZgLxY7Ok/V0Lcvl7u TWHTLviL+SX0meO6tCJWYGcoMkKXkATOlDy+BFl8pHP4GieSaHxBLk+cUYJKuOx74FZj TAbsBR11oz8h6t6ZAbPP+ILLCfKK2fGnEKUC7wXFz8M8yr+rXSLw9kLTlX36bxcrJ7DZ nASW3XnP7Y+AWOQ5PDFqiPBipCRjVeoVkSkvIuACce+1qPGWjFoHioD0iYTShF2aIYTa HAZ81308Vu6nEeuoooiJ70v5bmYuS7c2hZIGEnM50xWbpK2B1celOWrBJaSu/LtKvVAd RUKA== 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:message-id:date:subject:cc:to:from; bh=IHtYVr+59Hsu5Ph7y/njzjvM6KvzFrWOWNh33NGpsg0=; b=MCmqew/0x3hcQbJ+4YHyR4hfcAOIFjkCFsWy3AcqK8lxkMJgerI58zEC35a5hmaI6V 4lVWcn5fbcxYuCxjU99ceXSj7UQz9xkmvqh0w8RNdDLqEhfkoAzMkMunV/qCmJojJ4+3 +yrsC8cf+SYijreZ+prYB6WeAlv7YCmb3iRtFym6ZqXnXICcck5GUyh0QqhcZE9ZXPld 4GJZ7pHvaT+fhIk1naZHYsJixZ1nT/GoP/4O+JHON07QrNQnW8QfxmvOYY9ka4QtrnQI HMWQYdJ3RoBqA67qZnJr9qwDRzlfKvedb1L7Haojn6cTfzwgx5uTHfVRlAkfajf+CrxI qiZg== 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 g19-20020a633753000000b004fb8abdd188si2347904pgn.115.2023.06.09.01.15.17; Fri, 09 Jun 2023 01:15:34 -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 S239761AbjFIICi (ORCPT + 99 others); Fri, 9 Jun 2023 04:02:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239467AbjFIICR (ORCPT ); Fri, 9 Jun 2023 04:02:17 -0400 Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.54.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D953149F6 for ; Fri, 9 Jun 2023 01:00:23 -0700 (PDT) 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 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_MSPIKE_H3, 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 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(-) -- 2.20.1