mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
Bluetooth: btmtk: Do not discard the subsystem reset timeout
When the MTK_BT_RST_DONE poll times out, btmtk_usb_subsys_reset() logs "Reset timeout" and keeps the error in err, but err is then overwritten by the return value of the following btmtk_usb_id_get() call, so the timeout is never reported to the caller. Commit25b6d7593a("Bluetooth: btmtk: introduce btmtk reset work") discarded the return value of the chip id read, so the function returned the timeout error as intended. Commit3dcb122b30("Bluetooth: btusb: mediatek: return error for failed reg access") started assigning err at that call and silently dropped it. Keep the timeout in a separate variable and return it, restoring the original behaviour without changing the control flow. Fixes:3dcb122b30("Bluetooth: btusb: mediatek: return error for failed reg access") Signed-off-by: Ismail Tarim <ismailtarim7@gmail.com> Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
parent
59c3ee19ca
commit
21b50c2484
|
|
@ -860,6 +860,7 @@ static u32 btmtk_usb_reset_done(struct hci_dev *hdev)
|
|||
|
||||
int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id)
|
||||
{
|
||||
int reset_err = 0;
|
||||
u32 val;
|
||||
int err;
|
||||
|
||||
|
|
@ -958,8 +959,10 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id)
|
|||
|
||||
err = readx_poll_timeout(btmtk_usb_reset_done, hdev, val,
|
||||
val & MTK_BT_RST_DONE, 20000, 1000000);
|
||||
if (err < 0)
|
||||
if (err < 0) {
|
||||
bt_dev_err(hdev, "Reset timeout");
|
||||
reset_err = err;
|
||||
}
|
||||
|
||||
if (dev_id == 0x7922) {
|
||||
err = btmtk_usb_uhw_reg_write(hdev, MTK_UDMA_INT_STA_BT, 0x000000FF);
|
||||
|
|
@ -973,7 +976,7 @@ int btmtk_usb_subsys_reset(struct hci_dev *hdev, u32 dev_id)
|
|||
return err ? err : -ENODEV;
|
||||
}
|
||||
|
||||
return err;
|
||||
return reset_err;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(btmtk_usb_subsys_reset);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user