IB/ehca: Init irq tasklet before irq can happen
authorAlexander Schmidt <alexs@linux.vnet.ibm.com>
Mon, 5 Jul 2010 11:41:56 +0000 (11:41 +0000)
committerRoland Dreier <rolandd@cisco.com>
Wed, 4 Aug 2010 23:14:33 +0000 (16:14 -0700)
Initialize tasklet before interrupts are requested to prevent
scheduling of an uninitialized tasklet.

Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ehca/ehca_eq.c

index 3b87589b8ea0362c1a71e5b15cfdf9247b43f071..d9b1bb40f480f7d9662ec96b0695a825858cf0c3 100644 (file)
@@ -122,21 +122,21 @@ int ehca_create_eq(struct ehca_shca *shca,
 
        /* register interrupt handlers and initialize work queues */
        if (type == EHCA_EQ) {
+               tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
+
                ret = ibmebus_request_irq(eq->ist, ehca_interrupt_eq,
                                          IRQF_DISABLED, "ehca_eq",
                                          (void *)shca);
                if (ret < 0)
                        ehca_err(ib_dev, "Can't map interrupt handler.");
-
-               tasklet_init(&eq->interrupt_task, ehca_tasklet_eq, (long)shca);
        } else if (type == EHCA_NEQ) {
+               tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
+
                ret = ibmebus_request_irq(eq->ist, ehca_interrupt_neq,
                                          IRQF_DISABLED, "ehca_neq",
                                          (void *)shca);
                if (ret < 0)
                        ehca_err(ib_dev, "Can't map interrupt handler.");
-
-               tasklet_init(&eq->interrupt_task, ehca_tasklet_neq, (long)shca);
        }
 
        eq->is_initialized = 1;