Skip to content

Bluetooth: btusb/btqca/hci_sync: Clean up btusb and fix several bugs

Zijun Hu linux-arm-msm linux-bluetooth lkml 2 versions – In review

Get series with b4
b4 am [email protected] change-id 20260622-bt_bugfix-fbb216ca1ff9

Versions newest first

  1. v2 Latest12 patches 2 repliesIn review 11 of 12 applied
  2. v113 patches 19 repliesSuperseded

Changes in v2 from the cover letter · 18 lines

- Reorder the series so each helper is introduced before its users and
related changes are grouped together.
- btqca: reword "Fix qca_set_bdaddr()", add the btmon (WCN7850) trace,
and add Bartosz's Reviewed-by.
- btusb: add the btmon (WCN6855) trace to the BD_ADDR byte-order fix.
- btusb: rename and reword the devcoredump fix.
- hci_sync: simplify __hci_reset_sync() to return __hci_cmd_sync_status() directly; rename the patch to "Introduce __hci_reset_sync()".
- hci_sync: "Simplify hci_reset_sync()" now returns the status directly;
drop the separate "Fix return value of hci_reset_sync()" patch.
- btqca: replace "Fix undetected error HCI status in qca_send_reset()"
with "Simplify qca_send_reset() by using __hci_reset_sync()" (cleanup,
not a fix; dropped the Fixes tag).
- btusb: reword "Simplify btusb_shutdown_qca()".
- btusb: rename "Initialize @priv_size at declaration" -> "Reduce a
redundant assignment in btusb_probe()".
- New patch: "hci_event: Log error for HCI reset status error in hci_cc_reset()".
- Drop "Move struct btusb_data and macros into btusb.h"; deferred to a follow-up series.
- Link to v1: https://lore.kernel.org/r/[email protected]

Patches in v2 11 of 12 applied

#Subject and filesSizeRepliesApplied
1/12Bluetooth: btqca: Fix qca_set_bdaddr() waiting for wrong HCI eventdrivers/bluetooth/btqca.c+1 -21 replyApplied
2/12Bluetooth: btusb: Fix BD_ADDR byte order in btusb_set_bdaddr_wcn6855()drivers/bluetooth/btusb.c+5 -40 repliesApplied
3/12Bluetooth: btusb: Record matched usb_device_id into btusb_datadrivers/bluetooth/btusb.c+2 -00 repliesApplied
4/12Bluetooth: btusb: QCA: Fix populating devcoredump fields on unenabled devicesdrivers/bluetooth/btusb.c+4 -20 repliesApplied
5/12Bluetooth: btusb: QCA: move qca_dump out of struct btusb_datadrivers/bluetooth/btusb.c+34 -220 repliesApplied
6/12Bluetooth: hci_sync: Introduce __hci_reset_sync() for device driversinclude/net/bluetooth/hci_sync.h net/bluetooth/hci_sync.c+9 -00 repliesApplied
7/12Bluetooth: btqca: Simplify qca_send_reset() by using __hci_reset_sync()drivers/bluetooth/btqca.c+2 -200 repliesApplied
8/12Bluetooth: btusb: Simplify btusb_shutdown_qca() by using __hci_reset_sync()drivers/bluetooth/btusb.c+4 -70 repliesApplied
9/12Bluetooth: hci_sync: Simplify hci_reset_sync()net/bluetooth/hci_sync.c+2 -80 repliesApplied
10/12Bluetooth: hci_event: Log error for HCI reset status error in hci_cc_reset()net/bluetooth/hci_event.c+4 -11 reply
11/12Bluetooth: btusb: Reduce a redundant assignment in btusb_probe()drivers/bluetooth/btusb.c+1 -30 repliesApplied
12/12Bluetooth: btusb: Use & instead of == to test bitflag BTUSB_IGNOREdrivers/bluetooth/btusb.c+1 -10 repliesApplied

Reviews trailers per patch

5 of 12 patches have a Reviewed-by or Acked-by.

PatchBartosz GolaszewskiDmitry Baryshkov
1/12R-b
2/12
3/12
4/12
5/12
6/12
7/12
8/12
9/12R-b
10/12R-b
11/12R-b
12/12R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/12] Bluetooth: btusb/btqca/hci_sync: Clean up btusb and fix several bugs

This series cleans up btusb in preparation for adding a new chip, QCC2072, and fixes several pre-existing bugs found along the way.

Bug fixes:
- qca_set_bdaddr() waited for HCI_EV_VENDOR, but the controller replies with a Command Complete event.
- btusb_set_bdaddr_wcn6855() sent the BD_ADDR without byte-swapping it.
- btusb QCA populated devcoredump fields on devices where devcoredump is not enabled.
- BTUSB_IGNORE is a bitmask and must be tested with '&', not '=='.

Cleanups:
- Add __hci_reset_sync() helper and use it in qca_send_reset() and btusb_shutdown_qca() to drop open-coded HCI reset boilerplate.
- Simplify hci_reset_sync() and log an error in hci_cc_reset() on a non-zero reset status.
- Record the matched usb_device_id in struct btusb_data and move qca_dump into a dedicated struct btqca_data.
- Reduce a redundant assignment in btusb_probe().

---
Changes in v2:
- Reorder the series so each helper is introduced before its users and
related changes are grouped together.
- btqca: reword "Fix qca_set_bdaddr()", add the btmon (WCN7850) trace,
and add Bartosz's Reviewed-by.
- btusb: add the btmon (WCN6855) trace to the BD_ADDR byte-order fix.
- btusb: rename and reword the devcoredump fix.
- hci_sync: simplify __hci_reset_sync() to return __hci_cmd_sync_status() directly; rename the patch to "Introduce __hci_reset_sync()".
- hci_sync: "Simplify hci_reset_sync()" now returns the status directly;
drop the separate "Fix return value of hci_reset_sync()" patch.
- btqca: replace "Fix undetected error HCI status in qca_send_reset()"
with "Simplify qca_send_reset() by using __hci_reset_sync()" (cleanup,
not a fix; dropped the Fixes tag).
- btusb: reword "Simplify btusb_shutdown_qca()".
- btusb: rename "Initialize @priv_size at declaration" -> "Reduce a
redundant assignment in btusb_probe()".
- New patch: "hci_event: Log error for HCI reset status error in hci_cc_reset()".
- Drop "Move struct btusb_data and macros into btusb.h"; deferred to a follow-up series.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Zijun Hu (12):
Bluetooth: btqca: Fix qca_set_bdaddr() waiting for wrong HCI event
Bluetooth: btusb: Fix BD_ADDR byte order in btusb_set_bdaddr_wcn6855()
Bluetooth: btusb: Record matched usb_device_id into btusb_data
Bluetooth: btusb: QCA: Fix populating devcoredump fields on unenabled devices
Bluetooth: btusb: QCA: move qca_dump out of struct btusb_data
Bluetooth: hci_sync: Introduce __hci_reset_sync() for device drivers
Bluetooth: btqca: Simplify qca_send_reset() by using __hci_reset_sync()
Bluetooth: btusb: Simplify btusb_shutdown_qca() by using __hci_reset_sync()
Bluetooth: hci_sync: Simplify hci_reset_sync()
Bluetooth: hci_event: Log error for HCI reset status error in hci_cc_reset()
Bluetooth: btusb: Reduce a redundant assignment in btusb_probe()
Bluetooth: btusb: Use & instead of == to test bitflag BTUSB_IGNORE

 drivers/bluetooth/btqca.c        | 25 ++----------
 drivers/bluetooth/btusb.c        | 86 +++++++++++++++++++++++-----------------
 include/net/bluetooth/hci_sync.h |  1 +
 net/bluetooth/hci_event.c        |  5 ++-
 net/bluetooth/hci_sync.c         | 16 ++++----
 5 files changed, 66 insertions(+), 67 deletions(-)

---
base-commit: cb20f6afc25b2b54c0fec61b45ac0ec9eb875d59
change-id: 20260622-bt_bugfix-fbb216ca1ff9

Best regards,

Signature · 1 line
Zijun Hu <[email protected]>