Patchwork [3/5] Revert "xen: Use IRQF_FORCE_RESUME"

login
register
mail settings
Submitter Herton Ronaldo Krzesinski
Date Dec. 3, 2011, 12:55 a.m.
Message ID <1322873716-22760-4-git-send-email-herton.krzesinski@canonical.com>
Download mbox | patch
Permalink /patch/129004/
State New
Headers show

Comments

Herton Ronaldo Krzesinski - Dec. 3, 2011, 12:55 a.m.
From: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>

This reverts commit feac01b2425e9358b11617b37de1be513344eabe.

Turns out this commit on 2.6.35.14 causes a regression:
http://bugs.launchpad.net/bugs/881542

It was fixed later upstream by commit "genirq: Add IRQF_RESUME_EARLY and
resume such IRQs earlier", but it doesn't backport cleanly to 2.6.35, so
just reverting it for now, not playing with it at this stage.

BugLink: http://bugs.launchpad.net/bugs/898139
Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
---
 drivers/xen/events.c |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

Patch

diff --git a/drivers/xen/events.c b/drivers/xen/events.c
index 614c88b..9c66deb 100644
--- a/drivers/xen/events.c
+++ b/drivers/xen/events.c
@@ -537,7 +537,7 @@  int bind_ipi_to_irqhandler(enum ipi_vector ipi,
 	if (irq < 0)
 		return irq;
 
-	irqflags |= IRQF_NO_SUSPEND | IRQF_FORCE_RESUME;
+	irqflags |= IRQF_NO_SUSPEND;
 	retval = request_irq(irq, handler, irqflags, devname, dev_id);
 	if (retval != 0) {
 		unbind_from_irq(irq);
@@ -896,6 +896,7 @@  void xen_poll_irq(int irq)
 void xen_irq_resume(void)
 {
 	unsigned int cpu, irq, evtchn;
+	struct irq_desc *desc;
 
 	init_evtchn_cpu_bindings();
 
@@ -914,6 +915,23 @@  void xen_irq_resume(void)
 		restore_cpu_virqs(cpu);
 		restore_cpu_ipis(cpu);
 	}
+
+	/*
+	 * Unmask any IRQF_NO_SUSPEND IRQs which are enabled. These
+	 * are not handled by the IRQ core.
+	 */
+	for_each_irq_desc(irq, desc) {
+		if (!desc->action || !(desc->action->flags & IRQF_NO_SUSPEND))
+			continue;
+		if (desc->status & IRQ_DISABLED)
+			continue;
+
+		evtchn = evtchn_from_irq(irq);
+		if (evtchn == -1)
+			continue;
+
+		unmask_evtchn(evtchn);
+	}
 }
 
 static struct irq_chip xen_dynamic_chip __read_mostly = {