Skip to content

Commit 6ac4233

Browse files
moore-brosVudentz
authored andcommitted
Bluetooth: btmtksdio: Prevent enabling interrupts after IRQ handler removal
Ensure interrupts are not re-enabled when the IRQ handler has already been removed. This prevents unexpected IRQ handler execution due to stale or unhandled interrupts. Modify btmtksdio_txrx_work to check if bdev->func->irq_handler exists before calling sdio_writel to enable interrupts. Co-developed-by: Pedro Tsai <[email protected]> Signed-off-by: Pedro Tsai <[email protected]> Co-developed-by: Felix Freimann <[email protected]> Signed-off-by: Felix Freimann <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 33634e2 commit 6ac4233

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/bluetooth/btmtksdio.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,8 @@ static void btmtksdio_txrx_work(struct work_struct *work)
610610
} while (int_status || time_is_before_jiffies(txrx_timeout));
611611

612612
/* Enable interrupt */
613-
sdio_writel(bdev->func, C_INT_EN_SET, MTK_REG_CHLPCR, NULL);
613+
if (bdev->func->irq_handler)
614+
sdio_writel(bdev->func, C_INT_EN_SET, MTK_REG_CHLPCR, NULL);
614615

615616
sdio_release_host(bdev->func);
616617

0 commit comments

Comments
 (0)