OMAP: Fix a BUG in l3 error handler.
authorTodd Poynor <toddpoynor@google.com>
Mon, 29 Aug 2011 12:12:23 +0000 (17:42 +0530)
committerSantosh Shilimkar <santosh.shilimkar@ti.com>
Sat, 24 Sep 2011 07:58:57 +0000 (13:28 +0530)
With the current sequence of registering the irq and
assigning it to the app_irq, debug_irq driver variables,
there can be corner cases where the pending irq gets
triggered immediately after registering, handler gets called
resulting in a crash. So changed this sequence.

Signed-off-by: sricharan <r.sricharan@ti.com>
Signed-off-by: Todd Poynor <toddpoynor@google.com>
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
arch/arm/mach-omap2/omap_l3_noc.c

index d560c8894e1ff76b0b6d4ccccf4f0d22991d3a80..cf237dd4dba5547e7d80f7011e04525849f672e7 100644 (file)
@@ -124,7 +124,7 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
 {
        static struct omap4_l3          *l3;
        struct resource *res;
-       int ret, irq;
+       int ret;
 
        l3 = kzalloc(sizeof(*l3), GFP_KERNEL);
        if (!l3)
@@ -176,8 +176,8 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
        /*
         * Setup interrupt Handlers
         */
-       irq = platform_get_irq(pdev, 0);
-       ret = request_irq(irq,
+       l3->debug_irq = platform_get_irq(pdev, 0);
+       ret = request_irq(l3->debug_irq,
                        l3_interrupt_handler,
                        IRQF_DISABLED, "l3-dbg-irq", l3);
        if (ret) {
@@ -185,10 +185,9 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
                                         OMAP44XX_IRQ_L3_DBG);
                goto err3;
        }
-       l3->debug_irq = irq;
 
-       irq = platform_get_irq(pdev, 1);
-       ret = request_irq(irq,
+       l3->app_irq = platform_get_irq(pdev, 1);
+       ret = request_irq(l3->app_irq,
                        l3_interrupt_handler,
                        IRQF_DISABLED, "l3-app-irq", l3);
        if (ret) {
@@ -196,7 +195,6 @@ static int __init omap4_l3_probe(struct platform_device *pdev)
                                         OMAP44XX_IRQ_L3_APP);
                goto err4;
        }
-       l3->app_irq = irq;
 
        return 0;