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

Bluetooth: btmtksdio: fix possible FW initialization failure

According to FW advised sequence, mt7921s need to re-acquire privilege
immediately after the firmware download is complete before normal running.
Otherwise, it is still possible the bus may be stuck in an abnormal status
that causes FW initialization failure in the current driver.

Fixes: 752aea58 ("Bluetooth: mt7921s: fix bus hang with wrong privilege")
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 0fab6361
...@@ -864,6 +864,14 @@ static int mt79xx_setup(struct hci_dev *hdev, const char *fwname) ...@@ -864,6 +864,14 @@ static int mt79xx_setup(struct hci_dev *hdev, const char *fwname)
return err; return err;
} }
err = btmtksdio_fw_pmctrl(bdev);
if (err < 0)
return err;
err = btmtksdio_drv_pmctrl(bdev);
if (err < 0)
return err;
/* Enable Bluetooth protocol */ /* Enable Bluetooth protocol */
wmt_params.op = BTMTK_WMT_FUNC_CTRL; wmt_params.op = BTMTK_WMT_FUNC_CTRL;
wmt_params.flag = 0; wmt_params.flag = 0;
...@@ -1109,14 +1117,6 @@ static int btmtksdio_setup(struct hci_dev *hdev) ...@@ -1109,14 +1117,6 @@ static int btmtksdio_setup(struct hci_dev *hdev)
if (err < 0) if (err < 0)
return err; return err;
err = btmtksdio_fw_pmctrl(bdev);
if (err < 0)
return err;
err = btmtksdio_drv_pmctrl(bdev);
if (err < 0)
return err;
/* Enable SCO over I2S/PCM */ /* Enable SCO over I2S/PCM */
err = btmtksdio_sco_setting(hdev); err = btmtksdio_sco_setting(hdev);
if (err < 0) { if (err < 0) {
......
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