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 <pedro.tsai@mediatek.com> Signed-off-by: Pedro Tsai <pedro.tsai@mediatek.com> Co-developed-by: Felix Freimann <felix.freimann@mediatek.com> Signed-off-by: Felix Freimann <felix.freimann@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
1 parent 33634e2 commit 6ac4233

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

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)