diff mbox series

[06/19] xen/arm: Freeze domains on suspend and thaw them on resume

Message ID 4cbdda3b5c6cce54724a505da14ce968010d0958.1665137247.git.mykyta_poturai@epam.com (mailing list archive)
State New, archived
Headers show
Series [01/19] xen/arm: Implement PSCI system suspend | expand

Commit Message

Mykyta Poturai Oct. 7, 2022, 10:32 a.m. UTC
From: Mirela Simonovic <mirela.simonovic@aggios.com>

Freeze and thaw of domains is reused as implemented for x86. In
addition, system_state variable is updated to represent the actual
state of the system.

Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
Signed-off-by: Saeed Nowshadi <saeed.nowshadi@xilinx.com>
---
 xen/arch/arm/suspend.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Julien Grall Dec. 6, 2022, 8:47 p.m. UTC | #1
Hi,

On 07/10/2022 11:32, Mykyta Poturai wrote:
> From: Mirela Simonovic <mirela.simonovic@aggios.com>
> 
> Freeze and thaw of domains is reused as implemented for x86. In
> addition, system_state variable is updated to represent the actual
> state of the system.
> 
> Signed-off-by: Mirela Simonovic <mirela.simonovic@aggios.com>
> Signed-off-by: Saeed Nowshadi <saeed.nowshadi@xilinx.com>

Your signed-off-by is missing.

> ---
>   xen/arch/arm/suspend.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/xen/arch/arm/suspend.c b/xen/arch/arm/suspend.c
> index b09bf319d0..2b94816b63 100644
> --- a/xen/arch/arm/suspend.c
> +++ b/xen/arch/arm/suspend.c
> @@ -137,6 +137,14 @@ static long system_suspend(void *data)

So this is something I already hinted in the original series. But I will 
repeat here.

I find quite difficult to review the code in system_suspend() when this 
introduced in piece meal. For instance, patch #8 is fixing a bug 
introduced by patch #7.

Patch #7 adds barrier after code your added here...

So I would much prefer if we introduce the helpers in a few patches and 
then have one patch that will in system_suspend().

Cheers,
diff mbox series

Patch

diff --git a/xen/arch/arm/suspend.c b/xen/arch/arm/suspend.c
index b09bf319d0..2b94816b63 100644
--- a/xen/arch/arm/suspend.c
+++ b/xen/arch/arm/suspend.c
@@ -137,6 +137,14 @@  static long system_suspend(void *data)
 {
     BUG_ON(system_state != SYS_STATE_active);
 
+    system_state = SYS_STATE_suspend;
+    freeze_domains();
+
+    system_state = SYS_STATE_resume;
+
+    thaw_domains();
+    system_state = SYS_STATE_active;
+
     return -ENOSYS;
 }