Merge branch 'linus' into irq/core
[firefly-linux-kernel-4.4.55.git] / kernel / irq / resend.c
index 32fc47c2c622ccb1ef183985951d64b4b09d3267..dd95f44f99b226d8f44f3a2a3ba5284e2f6ecdf5 100644 (file)
@@ -77,13 +77,21 @@ void check_irq_resend(struct irq_desc *desc)
                        unsigned int irq = irq_desc_get_irq(desc);
 
                        /*
-                        * 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);