From: Conor Dooley <conor@kernel.org>
To: Song Shuai <songshuaishuai@tinylab.org>
Cc: catalin.marinas@arm.com, will@kernel.org,
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 3/4] riscv: hibernate: remove WARN_ON in save_processor_state
Date: Sat, 10 Jun 2023 16:39:59 +0100 [thread overview]
Message-ID: <20230610-immerse-stained-e07fa52fa978@spud> (raw)
In-Reply-To: <20230609075049.2651723-4-songshuaishuai@tinylab.org>
[-- Attachment #1.1: Type: text/plain, Size: 1600 bytes --]
On Fri, Jun 09, 2023 at 03:50:48PM +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.
In the future, please write function with a () in commit
messages, so freeze_secondary_cpus() etc.
Otherwise,
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Thanks,
Conor.
>
> Fixes: c0317210012e ("RISC-V: Add arch functions to support hibernation/suspend-to-disk")
> Signed-off-by: Song Shuai <songshuaishuai@tinylab.org>
> ---
> arch/riscv/kernel/hibernate.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/riscv/kernel/hibernate.c b/arch/riscv/kernel/hibernate.c
> index 395f835f067c..86f1c9ab6b0b 100644
> --- a/arch/riscv/kernel/hibernate.c
> +++ b/arch/riscv/kernel/hibernate.c
> @@ -119,7 +119,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
>
>
> _______________________________________________
> linux-riscv mailing list
> linux-riscv@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2023-06-10 15:40 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-09 7:50 [PATCH V2 0/4] Remove WARN_ON in save_processor_state Song Shuai
2023-06-09 7:50 ` [PATCH V2 1/4] ARM: hibernate: remove " Song Shuai
2023-06-09 7:50 ` [PATCH V2 2/4] arm64: " Song Shuai
2023-06-09 10:23 ` Will Deacon
2023-06-09 7:50 ` [PATCH V2 3/4] riscv: " Song Shuai
2023-06-10 15:39 ` Conor Dooley [this message]
2023-06-09 7:50 ` [PATCH V2 4/4] xtensa: " Song Shuai
2023-06-21 15:51 ` (subset) [PATCH V2 0/4] Remove " Catalin Marinas
2023-06-22 18:28 ` Palmer Dabbelt
2023-06-25 23:17 ` Palmer Dabbelt
2023-06-25 23:20 ` patchwork-bot+linux-riscv
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230610-immerse-stained-e07fa52fa978@spud \
--to=conor@kernel.org \
--cc=ajones@ventanamicro.com \
--cc=aou@eecs.berkeley.edu \
--cc=catalin.marinas@arm.com \
--cc=chris@zankel.net \
--cc=conor.dooley@microchip.com \
--cc=jcmvbkbc@gmail.com \
--cc=jeeheng.sia@starfivetech.com \
--cc=leyfoon.tan@starfivetech.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=mason.huo@starfivetech.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=songshuaishuai@tinylab.org \
--cc=steven.price@arm.com \
--cc=vincenzo.frascino@arm.com \
--cc=will@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).