mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
Bluetooth: hci_qca: Enhance retry logic in qca_setup
Currently driver only retries to download FW if FW downloading is failed. Sometimes observed command timeout for version request command, if this happen on some platforms during boot time, then a reboot is needed to turn ON BT. Instead to avoid a reboot, now extended retry logic for version request command too. Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
This commit is contained in:
parent
288c06973d
commit
9e80587aba
|
|
@ -1672,7 +1672,7 @@ static int qca_setup(struct hci_uart *hu)
|
||||||
retry:
|
retry:
|
||||||
ret = qca_power_on(hdev);
|
ret = qca_power_on(hdev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
|
clear_bit(QCA_SSR_TRIGGERED, &qca->flags);
|
||||||
|
|
||||||
|
|
@ -1681,7 +1681,7 @@ static int qca_setup(struct hci_uart *hu)
|
||||||
|
|
||||||
ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
|
ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
qca_set_speed(hu, QCA_INIT_SPEED);
|
qca_set_speed(hu, QCA_INIT_SPEED);
|
||||||
}
|
}
|
||||||
|
|
@ -1691,7 +1691,7 @@ static int qca_setup(struct hci_uart *hu)
|
||||||
if (speed) {
|
if (speed) {
|
||||||
ret = qca_set_speed(hu, QCA_OPER_SPEED);
|
ret = qca_set_speed(hu, QCA_OPER_SPEED);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto out;
|
||||||
|
|
||||||
qca_baudrate = qca_get_baudrate_value(speed);
|
qca_baudrate = qca_get_baudrate_value(speed);
|
||||||
}
|
}
|
||||||
|
|
@ -1700,7 +1700,7 @@ static int qca_setup(struct hci_uart *hu)
|
||||||
/* Get QCA version information */
|
/* Get QCA version information */
|
||||||
ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
|
ret = qca_read_soc_version(hdev, &soc_ver, soc_type);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
bt_dev_info(hdev, "QCA controller version 0x%08x", soc_ver);
|
bt_dev_info(hdev, "QCA controller version 0x%08x", soc_ver);
|
||||||
|
|
@ -1721,8 +1721,11 @@ static int qca_setup(struct hci_uart *hu)
|
||||||
* patch/nvm-config is found, so run with original fw/config.
|
* patch/nvm-config is found, so run with original fw/config.
|
||||||
*/
|
*/
|
||||||
ret = 0;
|
ret = 0;
|
||||||
} else {
|
}
|
||||||
if (retries < MAX_INIT_RETRIES) {
|
|
||||||
|
out:
|
||||||
|
if (ret && retries < MAX_INIT_RETRIES) {
|
||||||
|
bt_dev_warn(hdev, "Retry BT power ON:%d", retries);
|
||||||
qca_power_shutdown(hu);
|
qca_power_shutdown(hu);
|
||||||
if (hu->serdev) {
|
if (hu->serdev) {
|
||||||
serdev_device_close(hu->serdev);
|
serdev_device_close(hu->serdev);
|
||||||
|
|
@ -1735,7 +1738,6 @@ static int qca_setup(struct hci_uart *hu)
|
||||||
retries++;
|
retries++;
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/* Setup bdaddr */
|
/* Setup bdaddr */
|
||||||
if (soc_type == QCA_ROME)
|
if (soc_type == QCA_ROME)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user