Skip to contentSkip to conversation

xen/events: Add wakeup support to xen-pirq

PATCH In review Simon Gaiser 2 participants 3 messages Mar 13, 2023 – Jul 31, 2023 Xen hypervisor interface

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

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(+)
drivers/xen/events/events_base.c +4 -0
index c7715f8bd452..991082f04f05 100644
@@ -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 = {
Signature · 1 line
2.39.2
#1 lore raw

Simon Gaiser:

Quoted 25 lines

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.

---

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(+)
drivers/xen/events/events_base.c +0 -0
index c7715f8bd452..991082f04f05 100644

drivers/xen/events/events_base.c static struct irq_chip xen_pirq_chip __read_mostly = { · line 2185

Quoted 10 lines
drivers/xen/events/events_base.c +4 -0
@@ -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 = {

ping

maintainer
#2 lore raw
Quoted 35 lines · Simon Gaiser

Simon Gaiser:

Quoted 34 lines

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.

---

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(+)
drivers/xen/events/events_base.c +4 -0
index c7715f8bd452..991082f04f05 100644
@@ -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,
  };
 
Quoted 2 lines

drivers/xen/events/events_base.c static struct irq_chip xen_pirq_chip __read_mostly = { · line 2185

Quoted 1 line
drivers/xen/events/events_base.c +0 -0
  static struct irq_chip xen_percpu_chip __read_mostly = {

ping

Sorry for not answering earlier.

I'm not sure about those flags either. Unfortunately I haven't found any documentation or comments describing their detailed semantics in a way enabling me to do a thorough review.

Thomas, are you seeing any problems with specifying those flags?

Juergen