All of lore.kernel.org
 help / color / mirror / Atom feed
From: Will Deacon <will@kernel.org>
To: Song Shuai <songshuaishuai@tinylab.org>
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
Date: Fri, 9 Jun 2023 11:23:16 +0100	[thread overview]
Message-ID: <20230609102315.GA3847@willie-the-truck> (raw)
In-Reply-To: <20230609075049.2651723-3-songshuaishuai@tinylab.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 <songshuaishuai@tinylab.org>
> ---
>  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 <will@kernel.org>

Thanks!

Will

_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Song Shuai <songshuaishuai@tinylab.org>
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
Date: Fri, 9 Jun 2023 11:23:16 +0100	[thread overview]
Message-ID: <20230609102315.GA3847@willie-the-truck> (raw)
In-Reply-To: <20230609075049.2651723-3-songshuaishuai@tinylab.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 <songshuaishuai@tinylab.org>
> ---
>  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 <will@kernel.org>

Thanks!

Will

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will@kernel.org>
To: Song Shuai <songshuaishuai@tinylab.org>
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
Date: Fri, 9 Jun 2023 11:23:16 +0100	[thread overview]
Message-ID: <20230609102315.GA3847@willie-the-truck> (raw)
In-Reply-To: <20230609075049.2651723-3-songshuaishuai@tinylab.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 <songshuaishuai@tinylab.org>
> ---
>  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 <will@kernel.org>

Thanks!

Will

  reply	other threads:[~2023-06-09 10:23 UTC|newest]

Thread overview: 32+ 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 ` Song Shuai
2023-06-09  7:50 ` Song Shuai
2023-06-09  7:50 ` [PATCH V2 1/4] ARM: hibernate: remove " Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-09  7:50 ` [PATCH V2 2/4] arm64: " Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-09 10:23   ` Will Deacon [this message]
2023-06-09 10:23     ` Will Deacon
2023-06-09 10:23     ` Will Deacon
2023-06-09  7:50 ` [PATCH V2 3/4] riscv: " Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-10 15:39   ` Conor Dooley
2023-06-10 15:39     ` Conor Dooley
2023-06-09  7:50 ` [PATCH V2 4/4] xtensa: " Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-09  7:50   ` Song Shuai
2023-06-21 15:51 ` (subset) [PATCH V2 0/4] Remove " Catalin Marinas
2023-06-21 15:51   ` Catalin Marinas
2023-06-21 15:51   ` Catalin Marinas
2023-06-22 18:28   ` Palmer Dabbelt
2023-06-22 18:28     ` Palmer Dabbelt
2023-06-22 18:28     ` Palmer Dabbelt
2023-06-25 23:17 ` Palmer Dabbelt
2023-06-25 23:17   ` Palmer Dabbelt
2023-06-25 23:17   ` Palmer Dabbelt
2023-06-25 23:20 ` patchwork-bot+linux-riscv
2023-06-25 23:20   ` patchwork-bot+linux-riscv
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=20230609102315.GA3847@willie-the-truck \
    --to=will@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 \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.