From: Chris Lu <chris.lu@mediatek.com>
To: Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Luiz Von Dentz <luiz.dentz@gmail.com>
Cc: Sean Wang <sean.wang@mediatek.com>,
Jiande Lu <jiande.lu@mediatek.com>,
Will Lee <will-cy.lee@mediatek.com>, SS Wu <ss.wu@mediatek.com>,
Steve Lee <steve.lee@mediatek.com>,
linux-bluetooth <linux-bluetooth@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-mediatek <linux-mediatek@lists.infradead.org>,
Chris Lu <chris.lu@mediatek.com>
Subject: [PATCH v1 1/2] Bluetooth: btmtksdio: Check function enabled before doing close
Date: Mon, 21 Apr 2025 15:29:13 +0800 [thread overview]
Message-ID: <20250421072914.466092-2-chris.lu@mediatek.com> (raw)
In-Reply-To: <20250421072914.466092-1-chris.lu@mediatek.com>
Check BTMTKSDIO_FUNC_ENABLED flag before doing close to prevent
btmtksdio_close been called twice.
Signed-off-by: Chris Lu <chris.lu@mediatek.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
next prev parent reply other threads:[~2025-04-21 7:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-21 7:29 [PATCH v1 0/2] Bluetooth: btmtksdio: ensure btmtksdio_close is executed before btmtksdio_remove Chris Lu
2025-04-21 7:29 ` Chris Lu [this message]
2025-04-21 14:01 ` bluez.test.bot
2025-04-21 19:19 ` [PATCH v1 1/2] Bluetooth: btmtksdio: Check function enabled before doing close Luiz Augusto von Dentz
2025-04-21 7:29 ` [PATCH v1 2/2] Bluetooth: btmtksdio: Do close if SDIO card removed without close Chris Lu
2025-04-21 19:19 ` Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250421072914.466092-2-chris.lu@mediatek.com \
--to=chris.lu@mediatek.com \
--cc=jiande.lu@mediatek.com \
--cc=johan.hedberg@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=sean.wang@mediatek.com \
--cc=ss.wu@mediatek.com \
--cc=steve.lee@mediatek.com \
--cc=will-cy.lee@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox