public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] Bluetooth: btmtksdio: fix the reset takes too long
@ 2022-05-12 21:38 sean.wang
  2022-05-12 21:38 ` [PATCH 2/2] Bluetooth: btmtksdio: fix possible FW initialization failure sean.wang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sean.wang @ 2022-05-12 21:38 UTC (permalink / raw)
  To: marcel, johan.hedberg
  Cc: sean.wang, Soul.Huang, YN.Chen, Leon.Yen, Eric-SY.Chang, Deren.Wu,
	km.lin, robin.chiu, Eddie.Chen, ch.yeh, posh.sun, ted.huang,
	Eric.Liang, Stella.Chang, Tom.Chou, steve.lee, jsiuda, frankgor,
	abhishekpandit, michaelfsun, mcchou, shawnku, linux-bluetooth,
	linux-mediatek, linux-kernel, Yake Yang

From: Sean Wang <sean.wang@mediatek.com>

Sending WMT command during the reset in progress is invalid and would get
no response from firmware until the reset is complete, so we ignore the WMT
command here to resolve the issue which causes the whole reset process
taking too long.

Fixes: 8fafe702253d ("Bluetooth: mt7921s: support bluetooth reset mechanism")
Co-developed-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Yake Yang <yake.yang@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
---
 drivers/bluetooth/btmtksdio.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
index 4ae6631a7c29..26e27fd79a21 100644
--- a/drivers/bluetooth/btmtksdio.c
+++ b/drivers/bluetooth/btmtksdio.c
@@ -1189,6 +1189,10 @@ static int btmtksdio_shutdown(struct hci_dev *hdev)
 	 */
 	pm_runtime_get_sync(bdev->dev);
 
+	/* wmt command only works until the reset is complete */
+	if (test_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state))
+		goto ignore_wmt_cmd;
+
 	/* Disable the device */
 	wmt_params.op = BTMTK_WMT_FUNC_CTRL;
 	wmt_params.flag = 0;
@@ -1202,6 +1206,7 @@ static int btmtksdio_shutdown(struct hci_dev *hdev)
 		return err;
 	}
 
+ignore_wmt_cmd:
 	pm_runtime_put_noidle(bdev->dev);
 	pm_runtime_disable(bdev->dev);
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-13 14:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-05-12 21:38 [PATCH 1/2] Bluetooth: btmtksdio: fix the reset takes too long sean.wang
2022-05-12 21:38 ` [PATCH 2/2] Bluetooth: btmtksdio: fix possible FW initialization failure sean.wang
2022-05-12 22:01 ` [1/2] Bluetooth: btmtksdio: fix the reset takes too long bluez.test.bot
2022-05-13 11:21 ` [PATCH 1/2] " patchwork-bot+bluetooth
2022-05-13 14:41 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox