Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1906605rwd; Fri, 9 Jun 2023 04:06:36 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4kq4a4vTW1ry8ExDVDGhY7/Ekwi4UFAUJOSrRD/nnZwqjBhLFTQs+0kCoLi6u60SM8ThUG X-Received: by 2002:a05:6a00:1acb:b0:64d:7002:8316 with SMTP id f11-20020a056a001acb00b0064d70028316mr818596pfv.9.1686308796477; Fri, 09 Jun 2023 04:06:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686308796; cv=none; d=google.com; s=arc-20160816; b=zTeOL9wNLubVQFnMOAJLJpzHEqvc7bOhwkPYFwtPPZvrkR7xzVGzcssjW1YRqMN0s/ QSvGYezMZwNwxgTAMm/y1uQ6KVrT4E9f0tk7ao63sYbe+EMLiaTezMTR/00oXivKbGBg eCkTfmMs0sULLAT+HGU8FIqQ9ISyEG37xCuBxgo7yE5F8Fjvd8y1pFDNC4Q8SDGxaC0/ TqLHAfB9sN5LoHyShGdN92clohym5J8Tv12H5fXREC3NHr+ig6HZkKUmsXZxYhwhY6AF r/t7EoSmTkeS/Ug7+BMaVHTXdJSUhTbo04bSRjJcQj7Ad3uAxTrbvOTepy8jeyITtZPk 1OJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+EyYTqJl3bOikxoZPMdX91N6tafsC0F1LVTPl0zdyto=; b=dOlFrpzLNmKDxSS0Z1yCl8C4p3o5vjsg73mQq8xd7z3QCapmRH3xIiP+D098XUiBSA Z0vt5nkNkslNfRlSfvYvfkXilolPmL30qnaWuwGI8rxS1kaT8oBO31x/IL3AvsEkv04m 9PLq8wI23VB7dInNggokxc/fnv5EHIAKehe06RQRXE0naSB8oOmLUPdtYZw0bN6+C839 PNeaqxVHXafCGk0fRDhkzNcXJ1DjcqskF0SWggfM/1AAuixZL/bYHrMsnYNTLEr7ruRm 8jH4usWbQrbfgoGQlfNkDt4MhVJ+4b1YzzhdrbTwLdDUdEhlAmbObcjiBdQ2YhdxaSS/ jo9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=odWF9ann; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l70-20020a639149000000b00543d32f1d93si2574222pge.657.2023.06.09.04.06.23; Fri, 09 Jun 2023 04:06:36 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=odWF9ann; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241379AbjFIKbq (ORCPT + 99 others); Fri, 9 Jun 2023 06:31:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241143AbjFIKbZ (ORCPT ); Fri, 9 Jun 2023 06:31:25 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C105B5599 for ; Fri, 9 Jun 2023 03:23:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54DA865674 for ; Fri, 9 Jun 2023 10:23:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86858C433EF; Fri, 9 Jun 2023 10:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686306203; bh=jokXRQ/Afrc/Il5mpiYP/ZSsYCJK2XP/mW2BduDXGRo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=odWF9annpoAePCQk9W5fYJzKk1nOlX0qTIzryocOT3UuFvJ2w+ZSn8x51I40zgOrY Gxpifiqr4Xfa5Ux18Vh5m36FfEuWKQreeDyVHZzkrcADV4qsQ5WYukSPVJxjubFuVo Q42LNL7su5ETj3ou9/6QwORZtG/ZQFqAd5TQfEMX9qxpHyXuSPEKt+Li++0BYpTiSY GovVrAF5ilDE77N5q0PaeIUYAJosnK7cmPrGxUIvdTiNd7c0bP5IkgspPb4LTsMC++ 6IZJRAQv+HaNdr/l0JL5JVaNnJ+296JWPgmGzsbiA1f+DZRkyQTmUxfYPNDyEn54pI 3b832VHPcromw== Date: Fri, 9 Jun 2023 11:23:16 +0100 From: Will Deacon To: Song Shuai Cc: catalin.marinas@arm.com, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, chris@zankel.net, jcmvbkbc@gmail.com, 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, linux@armlinux.org.uk, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH V2 2/4] arm64: hibernate: remove WARN_ON in save_processor_state Message-ID: <20230609102315.GA3847@willie-the-truck> References: <20230609075049.2651723-1-songshuaishuai@tinylab.org> <20230609075049.2651723-3-songshuaishuai@tinylab.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230609075049.2651723-3-songshuaishuai@tinylab.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 On Fri, Jun 09, 2023 at 03:50:47PM +0800, Song Shuai wrote: > 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) Acked-by: Will Deacon Thanks! Will