]> git.baikalelectronics.ru Git - kernel.git/commitdiff
can: kvaser_pciefd: Call request_irq() before enabling interrupts
authorJimmy Assarsson <extja@kvaser.com>
Tue, 16 May 2023 13:43:15 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:06 +0000 (12:44 +0100)
commit 84762d8da89d29ba842317eb842973e628c27391 upstream.

Make sure the interrupt handler is registered before enabling interrupts.

Fixes: ea3f54dd9351 ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Cc: stable@vger.kernel.org
Signed-off-by: Jimmy Assarsson <extja@kvaser.com>
Link: https://lore.kernel.org/r/20230516134318.104279-4-extja@kvaser.com
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/can/kvaser_pciefd.c

index 66d40866352f8ead2434097b622ef79d2b032495..85e8459a1a23bd793329abe7836875afed48abb4 100644 (file)
@@ -1823,6 +1823,11 @@ static int kvaser_pciefd_probe(struct pci_dev *pdev,
        if (err)
                goto err_teardown_can_ctrls;
 
+       err = request_irq(pcie->pci->irq, kvaser_pciefd_irq_handler,
+                         IRQF_SHARED, KVASER_PCIEFD_DRV_NAME, pcie);
+       if (err)
+               goto err_teardown_can_ctrls;
+
        iowrite32(KVASER_PCIEFD_SRB_IRQ_DPD0 | KVASER_PCIEFD_SRB_IRQ_DPD1,
                  pcie->reg_base + KVASER_PCIEFD_SRB_IRQ_REG);
 
@@ -1843,11 +1848,6 @@ static int kvaser_pciefd_probe(struct pci_dev *pdev,
        iowrite32(KVASER_PCIEFD_SRB_CMD_RDB1,
                  pcie->reg_base + KVASER_PCIEFD_SRB_CMD_REG);
 
-       err = request_irq(pcie->pci->irq, kvaser_pciefd_irq_handler,
-                         IRQF_SHARED, KVASER_PCIEFD_DRV_NAME, pcie);
-       if (err)
-               goto err_teardown_can_ctrls;
-
        err = kvaser_pciefd_reg_candev(pcie);
        if (err)
                goto err_free_irq;