[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250422012156.586600-2-chris.lu@mediatek.com>
Date: Tue, 22 Apr 2025 09:21:55 +0800
From: Chris Lu <chris.lu@...iatek.com>
To: Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg
<johan.hedberg@...il.com>, Luiz Von Dentz <luiz.dentz@...il.com>
CC: Sean Wang <sean.wang@...iatek.com>, Jiande Lu <jiande.lu@...iatek.com>,
Will Lee <will-cy.lee@...iatek.com>, SS Wu <ss.wu@...iatek.com>, Steve Lee
<steve.lee@...iatek.com>, linux-bluetooth <linux-bluetooth@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>, linux-mediatek
<linux-mediatek@...ts.infradead.org>, Chris Lu <chris.lu@...iatek.com>
Subject: [PATCH v2 1/2] Bluetooth: btmtksdio: Check function enabled before doing close
Check BTMTKSDIO_FUNC_ENABLED flag before doing close to prevent
btmtksdio_close been called twice.
Fixes: c4233afb9a ("Bluetooth: btmtksdio: Prevent enabling interrupts after IRQ handler removal")
Signed-off-by: Chris Lu <chris.lu@...iatek.com>
---
drivers/bluetooth/btmtksdio.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 566c136e83bf..3c66e3ee9834 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -723,6 +723,10 @@ static int btmtksdio_close(struct hci_dev *hdev)
{
struct btmtksdio_dev *bdev = hci_get_drvdata(hdev);
+ /* Skip btmtksdio_close if BTMTKSDIO_FUNC_ENABLED isn't set */
+ if (!test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state))
+ return 0;
+
sdio_claim_host(bdev->func);
/* Disable interrupt */
--
2.45.2
Powered by blists - more mailing lists