[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 16/19] xen/arm: Suspend/resume console on Xen suspend/resume


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Mykyta Poturai <Mykyta_Poturai@xxxxxxxx>
  • Date: Fri, 7 Oct 2022 10:32:50 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=l/O4J5C7W0TXxhhwyyXIZrFFLgHA9mzwFIl98tctyyM=; b=JAH1/Bf9hBO1EmYjWG96fVbWUs+nTMXc+529YFhxZGTvTgW0DMJuIXCg8MlsnO7TJnHXJP3VTDpGYm/dDzz0ph0xsmdLY7MCMP0qa0Kv0bwXeOpwoDL4uD6fqLauzl4vhrQ74iZCpNaPAMeZgX4Pj/FoFeyvf/iILe2BL3Fmg2nzZdJc0uNRR+Y9cUY4b1eeadln25T7m+aAzJS9jgj8sm4Oe+B+2BYzRCHwgiFizCcsNAirFVuGsfS2Eep/ol/CGBvGf459Q1YjvdrhYeeKzTeI8+Ai1Mfnz58Hzh9sGQ01uu9Lor24wRZDDJmnIFEXtw+EOFCJkyb0RWRZmjws3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=luFEI+qQMoIWiYFBrabotg1JzwDYEbP3HlDTqs0Bsfs3D3yPzeT88AmvMgejj+QjaVOGJHAJhe/jGHHgs4WD6S44VlmwHM3zMMJxB9kqUFCeQiOy5yT36rFvMNzXylr/KI23NhUak5dnowduj92vQqVsY6/dgTIQn/P4Xhw8d0ZFzFFNJlRXzUMKCRBi4jnilLoxaTNjzVUADUunImNBYBx90Q9BsLDX3lRt4GOpP44kAHLWS98cZh9ft84Zryhd+ODww+6vDbZQBHVkehd7a8phbCf1rMFhfQ+Y2RMii+uWIbYQkyMLYcXikhvR7bsFx6EjG9Q7A00WTZBrx9X5bQ==
  • Cc: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Saeed Nowshadi <saeed.nowshadi@xxxxxxxxxx>
  • Delivery-date: Fri, 07 Oct 2022 10:33:16 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHY2jgmltStcpUKEUSAkPaRlzuavQ==
  • Thread-topic: [PATCH 16/19] xen/arm: Suspend/resume console on Xen suspend/resume

From: Mirela Simonovic <mirela.simonovic@xxxxxxxxxx>

This is done using generic console_suspend/resume functions that cause
uart driver specific suspend/resume handlers to be called for each
initialized port (if the port has suspend/resume driver handlers
implemented).

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

diff --git a/xen/arch/arm/suspend.c b/xen/arch/arm/suspend.c
index 4a690eac3b..cf3aab0099 100644
--- a/xen/arch/arm/suspend.c
+++ b/xen/arch/arm/suspend.c
@@ -14,6 +14,7 @@
 
 #include <xen/sched.h>
 #include <xen/cpu.h>
+#include <xen/console.h>
 #include <asm/cpufeature.h>
 #include <asm/event.h>
 #include <asm/psci.h>
@@ -166,6 +167,15 @@ static long system_suspend(void *data)
         goto resume_irqs;
     }
 
+    dprintk(XENLOG_DEBUG, "Suspend\n");
+    status = console_suspend();
+    if ( status )
+    {
+        dprintk(XENLOG_ERR, "Failed to suspend the console, err=%d\n", status);
+        system_state = SYS_STATE_resume;
+        goto resume_console;
+    }
+
     if ( hyp_suspend(&cpu_context) )
     {
         status = call_psci_system_suspend();
@@ -192,6 +202,10 @@ static long system_suspend(void *data)
      */
     mmu_init_secondary_cpu();
 
+resume_console:
+    console_resume();
+    dprintk(XENLOG_DEBUG, "Resume\n");
+
     gic_resume();
 
 resume_irqs:
-- 
2.37.1



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.