Skip to content

Commit baabb7f

Browse files
moore-brosholtmann
authored andcommitted
Bluetooth: btmtksdio: fix the reset takes too long
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: 8fafe70 ("Bluetooth: mt7921s: support bluetooth reset mechanism") Co-developed-by: Yake Yang <[email protected]> Signed-off-by: Yake Yang <[email protected]> Signed-off-by: Sean Wang <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 7469720 commit baabb7f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/bluetooth/btmtksdio.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,10 @@ static int btmtksdio_shutdown(struct hci_dev *hdev)
11891189
*/
11901190
pm_runtime_get_sync(bdev->dev);
11911191

1192+
/* wmt command only works until the reset is complete */
1193+
if (test_bit(BTMTKSDIO_HW_RESET_ACTIVE, &bdev->tx_state))
1194+
goto ignore_wmt_cmd;
1195+
11921196
/* Disable the device */
11931197
wmt_params.op = BTMTK_WMT_FUNC_CTRL;
11941198
wmt_params.flag = 0;
@@ -1202,6 +1206,7 @@ static int btmtksdio_shutdown(struct hci_dev *hdev)
12021206
return err;
12031207
}
12041208

1209+
ignore_wmt_cmd:
12051210
pm_runtime_put_noidle(bdev->dev);
12061211
pm_runtime_disable(bdev->dev);
12071212

0 commit comments

Comments
 (0)