From e272042fc6f7f4a81849bf1cd2b4fbcf2dc731d3 Mon Sep 17 00:00:00 2001 From: Simon Gaiser Date: Mon, 18 Sep 2023 13:00:13 +0200 Subject: [PATCH] Fix wakeup from suspend to idle --- kernel.spec.in | 4 ++ ...vents-Add-wakeup-support-to-xen-pirq.patch | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 xen-events-Add-wakeup-support-to-xen-pirq.patch diff --git a/kernel.spec.in b/kernel.spec.in index afe77669..4fc13538 100644 --- a/kernel.spec.in +++ b/kernel.spec.in @@ -144,6 +144,10 @@ Patch25: 0001-Re-enable-interrupts-before-loading-PNVM.patch Patch26: 0001-sound-Disable-SG-buffer.patch Patch27: 0001-amdgpu-timeout.patch Patch28: 0001-iwlwifi-avoid-writing-to-MSI-X-page-when-MSI-X-is-no.patch + +# S0ix support: +Patch61: xen-events-Add-wakeup-support-to-xen-pirq.patch + %description Qubes Dom0 kernel. diff --git a/xen-events-Add-wakeup-support-to-xen-pirq.patch b/xen-events-Add-wakeup-support-to-xen-pirq.patch new file mode 100644 index 00000000..c2ca8988 --- /dev/null +++ b/xen-events-Add-wakeup-support-to-xen-pirq.patch @@ -0,0 +1,47 @@ +From 3a3cbf4f4e6289ecc421ebea610e68e95aaf37ec Mon Sep 17 00:00:00 2001 +: +: Waiting for upstream review: +: https://lore.kernel.org/xen-devel/20230313134102.3157-1-simon@invisiblethingslab.com/ +: +From: Simon Gaiser +Date: Mon, 13 Mar 2023 14:01:47 +0100 +Subject: [PATCH] xen/events: Add wakeup support to xen-pirq + +This allows entering and exiting s2idle. Actual S0ix residency is +another topic [1]. + +Without this the ACPI code currently ignores the error enable_irq_wake() +returns when being used on a xen-pirq and the system goes to idle for +ever since the wakeup IRQ doesn't gets enabled. With [2] the error is +handled and the system refuses to go to s2idle. + +Link: https://lore.kernel.org/xen-devel/9051e484-b128-715a-9253-48af8e47bb9d@invisiblethingslab.com/ # [1] +Link: https://lore.kernel.org/linux-acpi/20230313125344.2893-1-simon@invisiblethingslab.com/ # [2] +Signed-off-by: Simon Gaiser +--- + +While I think that the set of flags I set is correct, I'm not familiar +with that code, so please pay special attention during review if they +are actually correct for xen-pirq. + + drivers/xen/events/events_base.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c +index c7715f8bd452..991082f04f05 100644 +--- a/drivers/xen/events/events_base.c ++++ b/drivers/xen/events/events_base.c +@@ -2176,6 +2176,10 @@ static struct irq_chip xen_pirq_chip __read_mostly = { + .irq_set_affinity = set_affinity_irq, + + .irq_retrigger = retrigger_dynirq, ++ ++ .flags = IRQCHIP_SKIP_SET_WAKE | ++ IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND | ++ IRQCHIP_MASK_ON_SUSPEND, + }; + + static struct irq_chip xen_percpu_chip __read_mostly = { +-- +2.39.2 +