From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0A384C7EE29 for ; Fri, 9 Jun 2023 10:23:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RXKxxK9DVUUZSzpqMYhgo1eq2INghzDLxsWCeZnKY1Y=; b=lhZuo6CoHA3qXw avY/wBMlLYBR0bw6d3OK0ZPmje9Rkhn0mjipQA4wezqmixJRwsLoLGiNsSa65TucFF4yNwStX3wS5 16cp9DDXbxVV+JaaS1xRv/+/6FTVCWSOniKk7XsiUleMJ9svf73UNuG3rdwTTCtptSzZQs+JkqWJp 2cvZlMzTbu9vvcEqNpOWnlboSf2yFH/Z9KcNEwUJzUtBeTtQ82gWHGrTx7D3jF34Xg14VE0m74QDG faUR3jA+UyP6jpKqfxAWQRYtp8dGwvMVRndHZB+54hpWTYcTKpgA4U6eoigPEH2UbXcyhZnVolNQV 2Q0Pn+Q8qSIzvDQiepdQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q7ZHE-00CXeN-1N; Fri, 09 Jun 2023 10:23:28 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q7ZHB-00CXcc-14; Fri, 09 Jun 2023 10:23:26 +0000 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 4D4A6651E7; 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-Disposition: inline In-Reply-To: <20230609075049.2651723-3-songshuaishuai@tinylab.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230609_032325_455516_CB46CD4E X-CRM114-Status: GOOD ( 18.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel