From: Song Shuai <songshuaishuai@tinylab.org>
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 3/4] riscv: hibernate: remove WARN_ON in save_processor_state
Date: Fri, 9 Jun 2023 15:50:48 +0800 [thread overview]
Message-ID: <20230609075049.2651723-4-songshuaishuai@tinylab.org> (raw)
In-Reply-To: <20230609075049.2651723-1-songshuaishuai@tinylab.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.
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-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: Song Shuai <songshuaishuai@tinylab.org>
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 3/4] riscv: hibernate: remove WARN_ON in save_processor_state
Date: Fri, 9 Jun 2023 15:50:48 +0800 [thread overview]
Message-ID: <20230609075049.2651723-4-songshuaishuai@tinylab.org> (raw)
In-Reply-To: <20230609075049.2651723-1-songshuaishuai@tinylab.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.
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
WARNING: multiple messages have this Message-ID (diff)
From: Song Shuai <songshuaishuai@tinylab.org>
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 3/4] riscv: hibernate: remove WARN_ON in save_processor_state
Date: Fri, 9 Jun 2023 15:50:48 +0800 [thread overview]
Message-ID: <20230609075049.2651723-4-songshuaishuai@tinylab.org> (raw)
In-Reply-To: <20230609075049.2651723-1-songshuaishuai@tinylab.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.
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
next prev parent reply other threads:[~2023-06-09 7:54 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
2023-06-09 10:23 ` Will Deacon
2023-06-09 10:23 ` Will Deacon
2023-06-09 7:50 ` Song Shuai [this message]
2023-06-09 7:50 ` [PATCH V2 3/4] riscv: " 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=20230609075049.2651723-4-songshuaishuai@tinylab.org \
--to=songshuaishuai@tinylab.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=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 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.