Skip to contentSkip to conversation

irq fixes

GIT PULL Ingo Molnar 1 participant 1 message Jul 18, 2015

Subsystems (7)
x86 GPIO irqchip drivers IRQ +3 more subsystems
lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the latest irq-urgent-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git irq-urgent-for-linus

# HEAD: 591e5bec13f15feb13fc445b6c9c59954711c4ac irqchip/gicv3-its: Fix mapping of LPIs to collections

Misc irq fixes:

- two driver fixes,
- a Xen regression fix,
- a nested irq thread crash fix.

Thanks,

Ingo

------------------>
Marc Zyngier (1):
irqchip/gicv3-its: Fix mapping of LPIs to collections

Thomas Gleixner (3):
gpio/davinci: Fix race in installing chained irq handler
genirq: Revert sparse irq locking around __cpu_up() and move it to x86 for now
genirq: Prevent resend to interrupts marked IRQ_NESTED_THREAD

 arch/x86/kernel/smpboot.c        |  11 ++++
 drivers/gpio/gpio-davinci.c      |   6 +--
 drivers/irqchip/irq-gic-v3-its.c | 111 ++++++++++++++++++++++++++-------------
 kernel/cpu.c                     |   9 ----
 kernel/irq/resend.c              |  18 +++++--
 5 files changed, 101 insertions(+), 54 deletions(-)
arch/x86/kernel/smpboot.c +11 -0
index d3010aa79daf..b1f3ed9c7a9e 100644
@@ -992,8 +992,17 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 
 	common_cpu_up(cpu, tidle);
 
+	/*
+	 * We have to walk the irq descriptors to setup the vector
+	 * space for the cpu which comes online.  Prevent irq
+	 * alloc/free across the bringup.
+	 */
+	irq_lock_sparse();
+
 	err = do_boot_cpu(apicid, cpu, tidle);
+
 	if (err) {
+		irq_unlock_sparse();
 		pr_err("do_boot_cpu failed(%d) to wakeup CPU#%u\n", err, cpu);
 		return -EIO;
 	}
@@ -1011,6 +1020,8 @@ int native_cpu_up(unsigned int cpu, struct task_struct *tidle)
 		touch_nmi_watchdog();
 	}
 
+	irq_unlock_sparse();
+
 	return 0;
 }
 
drivers/gpio/gpio-davinci.c +2 -4
index c5e05c82d67c..c246ac3dda7c 100644
@@ -578,15 +578,13 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
 		writel_relaxed(~0, &g->clr_falling);
 		writel_relaxed(~0, &g->clr_rising);
 
-		/* set up all irqs in this bank */
-		irq_set_chained_handler(bank_irq, gpio_irq_handler);
-
 		/*
 		 * Each chip handles 32 gpios, and each irq bank consists of 16
 		 * gpio irqs. Pass the irq bank's corresponding controller to
 		 * the chained irq handler.
 		 */
-		irq_set_handler_data(bank_irq, &chips[gpio / 32]);
+		irq_set_chained_handler_and_data(bank_irq, gpio_irq_handler,
+						 &chips[gpio / 32]);
 
 		binten |= BIT(bank);
 	}
drivers/irqchip/irq-gic-v3-its.c +75 -36

283 lines not on this page · raw message

kernel/cpu.c +0 -9
index 6a374544d495..5644ec5582b9 100644
@@ -527,18 +527,9 @@ static int _cpu_up(unsigned int cpu, int tasks_frozen)
 		goto out_notify;
 	}
 
-	/*
-	 * Some architectures have to walk the irq descriptors to
-	 * setup the vector space for the cpu which comes online.
-	 * Prevent irq alloc/free across the bringup.
-	 */
-	irq_lock_sparse();
-
 	/* Arch-specific enabling code. */
 	ret = __cpu_up(cpu, idle);
 
-	irq_unlock_sparse();
-
 	if (ret != 0)
 		goto out_notify;
 	BUG_ON(!cpu_online(cpu));
kernel/irq/resend.c +13 -5
index 9065107f083e..7a5237a1bce5 100644
@@ -75,13 +75,21 @@ void check_irq_resend(struct irq_desc *desc, unsigned int irq)
 		    !desc->irq_data.chip->irq_retrigger(&desc->irq_data)) {
 #ifdef CONFIG_HARDIRQS_SW_RESEND
 			/*
-			 * If the interrupt has a parent irq and runs
-			 * in the thread context of the parent irq,
-			 * retrigger the parent.
+			 * If the interrupt is running in the thread
+			 * context of the parent irq we need to be
+			 * careful, because we cannot trigger it
+			 * directly.
 			 */
-			if (desc->parent_irq &&
-			    irq_settings_is_nested_thread(desc))
+			if (irq_settings_is_nested_thread(desc)) {
+				/*
+				 * If the parent_irq is valid, we
+				 * retrigger the parent, otherwise we
+				 * do nothing.
+				 */
+				if (!desc->parent_irq)
+					return;
 				irq = desc->parent_irq;
+			}
 			/* Set it pending and activate the softirq: */
 			set_bit(irq, irqs_resend);
 			tasklet_schedule(&resend_tasklet);