Commit baabb7f5 authored by Sean Wang's avatar Sean Wang Committed by Marcel Holtmann

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: 8fafe702 ("Bluetooth: mt7921s: support bluetooth reset mechanism")
Co-developed-by: default avatarYake Yang <yake.yang@mediatek.com>
Signed-off-by: default avatarYake Yang <yake.yang@mediatek.com>
Signed-off-by: default avatarSean Wang <sean.wang@mediatek.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 74697205
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment