]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - rpmsg/rpmsg.git/commitdiff
irqchip/irq-pruss-intc: Reset chained handlers during cleanup
authorSuman Anna <s-anna@ti.com>
Thu, 18 Apr 2019 19:46:59 +0000 (14:46 -0500)
committerSuman Anna <s-anna@ti.com>
Mon, 22 Apr 2019 17:07:03 +0000 (12:07 -0500)
The PRUSS INTC irqchip implementation provides a standard IRQ API
for consumers to directly use the PRU System Events as interrupts
and uses chained interrupts for connecting these to the main ARM
GIC interrupt controllers. These chained irq handlers are not removed
at present during any failures in probe, or uninstalled in remove.

Reset these chained handlers so that the interrupts at the GIC
level are deactivated properly when the INTC devices are unbound
from the driver.

Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/irqchip/irq-pruss-intc.c

index 022b4cfa811a87e1b7a3188aa2dac2f10cac14b9..c02e5e9600c93a891e00839edd8d564e1d73dbef 100644 (file)
@@ -577,6 +577,11 @@ static int pruss_intc_probe(struct platform_device *pdev)
        return 0;
 
 fail_irq:
+       while (--i >= 0) {
+               if (intc->irqs[i])
+                       irq_set_chained_handler_and_data(intc->irqs[i], NULL,
+                                                        NULL);
+       }
        irq_domain_remove(intc->domain);
        return irq;
 }
@@ -585,6 +590,13 @@ static int pruss_intc_remove(struct platform_device *pdev)
 {
        struct pruss_intc *intc = platform_get_drvdata(pdev);
        unsigned int hwirq;
+       int i;
+
+       for (i = 0; i < MAX_HOST_NUM_IRQS; i++) {
+               if (intc->irqs[i])
+                       irq_set_chained_handler_and_data(intc->irqs[i], NULL,
+                                                        NULL);
+       }
 
        if (intc->domain) {
                for (hwirq = 0; hwirq < MAX_PRU_SYS_EVENTS; hwirq++)