Re: [PATCH 12/13] Bluetooth: btqca: Fix undetected error HCI status in qca_send_reset()

From: Zijun Hu

Date: Wed Jun 24 2026 - 22:08:57 EST


On 6/23/2026 11:15 PM, Luiz Augusto von Dentz wrote:
>> u8 cmd;
>> @@ -990,7 +971,8 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
>> }
>>
>> /* Perform HCI reset */
>> - err = qca_send_reset(hdev);
>> + bt_dev_dbg(hdev, "QCA HCI_RESET");
>> + err = __hci_reset_sync(hdev);
> So All the fuss about the reset is just to use it here? Actually the
> distinction between -err and status is rather important. The first
> means the command didn't run (timeout, cancel, etc), or it did run but
> returned a status != 0. If you want to capture both then you must use
> if (err). And yes there are parts of the code that test for < 0, but
> that is either a bug or they are intentionally ignoring the reset
> status as it is probably a non-recoverable error at that point.

1. Agree: > 0 for HCI status code (controller-side error), < 0 for command not executed
(timeout, cancel, transport failure). __hci_reset_sync() was introduced in this series and will
be refactored to follow this convention in v2.
2. Looking at drivers/bluetooth/, 7 out of 12 HCI reset call sites in the init/setup phase
silently ignore the controller status — not sure if this is intentional or not.
3. qca_set_bdaddr() and qca_send_reset() will be fixed to return the HCI status code and let the
caller decide whether to ignore it.

Will address all of the above in v2.