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

Gerald Yang gerald.yang at canonical.com
Wed Aug 17 08:51:47 UTC 2022


From: Frank van der Linden <fllinden at 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 at amazon.com>
Reviewed-by: Cristian Gafton <gafton at amazon.com>
Reviewed-by: Anchal Agarwal <anchalag at amazon.com>
Reviewed-by: Alakesh Haloi <alakeshh at 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 at canonical.com>
Signed-off-by: Matthew Ruffell <matthew.ruffell at 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 --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);
-- 
2.34.1




More information about the kernel-team mailing list