[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <e26167a3fcefdeae1151162e8676c9a467a8100d.1652390894.git.objelf@gmail.com>
Date: Fri, 13 May 2022 05:38:11 +0800
From: <sean.wang@...iatek.com>
To: <marcel@...tmann.org>, <johan.hedberg@...il.com>
CC: <sean.wang@...iatek.com>, <Soul.Huang@...iatek.com>,
<YN.Chen@...iatek.com>, <Leon.Yen@...iatek.com>,
<Eric-SY.Chang@...iatek.com>, <Deren.Wu@...iatek.com>,
<km.lin@...iatek.com>, <robin.chiu@...iatek.com>,
<Eddie.Chen@...iatek.com>, <ch.yeh@...iatek.com>,
<posh.sun@...iatek.com>, <ted.huang@...iatek.com>,
<Eric.Liang@...iatek.com>, <Stella.Chang@...iatek.com>,
<Tom.Chou@...iatek.com>, <steve.lee@...iatek.com>,
<jsiuda@...gle.com>, <frankgor@...gle.com>,
<abhishekpandit@...gle.com>, <michaelfsun@...gle.com>,
<mcchou@...omium.org>, <shawnku@...gle.com>,
<linux-bluetooth@...r.kernel.org>,
<linux-mediatek@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, Yake Yang <yake.yang@...iatek.com>
Subject: [PATCH 1/2] Bluetooth: btmtksdio: fix the reset takes too long
From: Sean Wang <sean.wang@...iatek.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@...iatek.com>
Signed-off-by: Yake Yang <yake.yang@...iatek.com>
Signed-off-by: Sean Wang <sean.wang@...iatek.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
Powered by blists - more mailing lists