diff mbox series

[SRU,jammy/linux-aws,kinetic/linux-aws,17/20] UBUNTU: SAUCE: xen: restore pirqs on resume from hibernation.

Message ID 20220817085150.2078055-22-gerald.yang@canonical.com
State New
Headers show
Series UBUNTU: SAUCE: PM: Hibernate: Enable Hibernation for Xen Based Instance Types | expand

Commit Message

Gerald Yang Aug. 17, 2022, 8:51 a.m. UTC
From: Frank van der Linden <fllinden@amazon.com>

BugLink: https://bugs.launchpad.net/bugs/1968062

The hibernation code unlinks event channels from these (legacy) IRQs, so they
must be reinitialized on wakeup, much like in the Xen suspend/resume case.

Signed-off-by: Frank van der Linden <fllinden@amazon.com>
Reviewed-by: Cristian Gafton <gafton@amazon.com>
Reviewed-by: Anchal Agarwal <anchalag@amazon.com>
Reviewed-by: Alakesh Haloi <alakeshh@amazon.com>

CR: https://code.amazon.com/reviews/CR-3702953/
(cherry picked from commit 5ac2dbdedcf419c726f323cd4c2f93ff652b46b4 amazon-5.15.y/mainline)
Signed-off-by: Gerald Yang <gerald.yang@canonical.com>
Signed-off-by: Matthew Ruffell <matthew.ruffell@canonical.com>
---
 arch/x86/xen/suspend.c           | 2 ++
 drivers/xen/events/events_base.c | 5 +++++
 include/xen/events.h             | 1 +
 3 files changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c
index affa63d4b6bd..39644923b623 100644
--- a/arch/x86/xen/suspend.c
+++ b/arch/x86/xen/suspend.c
@@ -132,6 +132,8 @@  static void xen_syscore_resume(void)
 	xen_restore_steal_clock(smp_processor_id());
 
 	gnttab_resume();
+
+	xen_restore_pirqs();
 }
 
 /*
diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
index 5883320002d0..0249e34104ac 100644
--- a/drivers/xen/events/events_base.c
+++ b/drivers/xen/events/events_base.c
@@ -2145,6 +2145,11 @@  void xen_shutdown_pirqs(void)
 	}
 }
 
+void xen_restore_pirqs(void)
+{
+	restore_pirqs();
+}
+
 static struct irq_chip xen_dynamic_chip __read_mostly = {
 	.name			= "xen-dyn",
 
diff --git a/include/xen/events.h b/include/xen/events.h
index 7f30459489d7..72fb0167eb2e 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -87,6 +87,7 @@  void notify_remote_via_irq(int irq);
 
 void xen_irq_resume(void);
 void xen_shutdown_pirqs(void);
+void xen_restore_pirqs(void);
 
 /* Clear an irq's pending state, in preparation for polling on it */
 void xen_clear_irq_pending(int irq);