Linux bluetooth development
 help / color / mirror / Atom feed
From: Zijun Hu <zijun.hu@oss.qualcomm.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Rocky Liao <quic_rjliao@quicinc.com>,
	Bartosz Golaszewski <brgl@kernel.org>,
	Ben Young Tae Kim <ytkim@qca.qualcomm.com>,
	Balakrishna Godavarthi <quic_bgodavar@quicinc.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Zijun Hu <zijun_hu@icloud.com>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	Luiz Augusto von Dentz <luiz.von.dentz@intel.com>,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 12/13] Bluetooth: btqca: Fix undetected error HCI status in qca_send_reset()
Date: Thu, 25 Jun 2026 10:08:33 +0800	[thread overview]
Message-ID: <08d5009c-507d-4c01-b888-e28a8c76bc06@oss.qualcomm.com> (raw)
In-Reply-To: <CABBYNZKx3+08Ajisy7-sHi0TZJNrbgzBzdszcKfiZUiNOdhByA@mail.gmail.com>

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.


  reply	other threads:[~2026-06-25  2:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-22 14:52 [PATCH 00/13] Bluetooth: btusb/btqca/hci_sync: Clean up btusb and fix several bugs Zijun Hu
2026-06-22 14:52 ` [PATCH 01/13] Bluetooth: btusb: Initialize @priv_size at declaration in btusb_probe() Zijun Hu
2026-06-22 15:30   ` Dmitry Baryshkov
2026-06-23  8:50     ` Bartosz Golaszewski
2026-06-23  9:33     ` Zijun Hu
2026-06-22 18:35   ` Bluetooth: btusb/btqca/hci_sync: Clean up btusb and fix several bugs bluez.test.bot
2026-06-22 14:52 ` [PATCH 02/13] Bluetooth: btusb: Use & instead of == to test bitflag BTUSB_IGNORE Zijun Hu
2026-06-22 15:30   ` Dmitry Baryshkov
2026-06-23  8:51   ` Bartosz Golaszewski
2026-06-22 14:52 ` [PATCH 03/13] Bluetooth: btusb: Record matched usb_device_id into btusb_data Zijun Hu
2026-06-22 14:52 ` [PATCH 04/13] Bluetooth: btusb: QCA: Do not populate devcoredump fields on ATH3012 or QCA_ROME Zijun Hu
2026-06-22 15:31   ` Dmitry Baryshkov
2026-06-23  9:50     ` Zijun Hu
2026-06-22 14:52 ` [PATCH 05/13] Bluetooth: btusb: QCA: move qca_dump out of struct btusb_data Zijun Hu
2026-06-22 14:52 ` [PATCH 06/13] Bluetooth: btusb: Fix BD_ADDR byte order in btusb_set_bdaddr_wcn6855() Zijun Hu
2026-06-22 14:52 ` [PATCH 07/13] Bluetooth: hci_sync: Simplify hci_reset_sync() Zijun Hu
2026-06-23  8:56   ` Bartosz Golaszewski
2026-06-22 14:52 ` [PATCH 08/13] Bluetooth: hci_sync: Fix return value of hci_reset_sync() Zijun Hu
2026-06-22 15:35   ` Luiz Augusto von Dentz
2026-06-23 10:48     ` Zijun Hu
2026-06-22 14:52 ` [PATCH 09/13] Bluetooth: hci_sync: Add __hci_reset_sync() for device driver Zijun Hu
2026-06-22 14:52 ` [PATCH 10/13] Bluetooth: btusb: Simplify btusb_shutdown_qca() by using __hci_reset_sync() Zijun Hu
2026-06-22 14:52 ` [PATCH 11/13] Bluetooth: btusb: Move struct btusb_data and macros into btusb.h Zijun Hu
2026-06-23  9:02   ` Bartosz Golaszewski
2026-06-23 10:09     ` Zijun Hu
2026-06-22 14:52 ` [PATCH 12/13] Bluetooth: btqca: Fix undetected error HCI status in qca_send_reset() Zijun Hu
2026-06-23  9:03   ` Bartosz Golaszewski
2026-06-23 10:13     ` Zijun Hu
2026-06-23 15:15   ` Luiz Augusto von Dentz
2026-06-25  2:08     ` Zijun Hu [this message]
2026-06-22 14:52 ` [PATCH 13/13] Bluetooth: btqca: Fix qca_set_bdaddr() using wrong HCI event type Zijun Hu
2026-06-23  9:04   ` Bartosz Golaszewski
2026-06-23 10:16     ` Zijun Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08d5009c-507d-4c01-b888-e28a8c76bc06@oss.qualcomm.com \
    --to=zijun.hu@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=luiz.von.dentz@intel.com \
    --cc=marcel@holtmann.org \
    --cc=mka@chromium.org \
    --cc=quic_bgodavar@quicinc.com \
    --cc=quic_rjliao@quicinc.com \
    --cc=ytkim@qca.qualcomm.com \
    --cc=zijun_hu@icloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox