All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support
@ 2026-07-13 12:01 Zijun Hu
  2026-07-13 12:01 ` [PATCH v2 1/5] Bluetooth: coredump: Introduce and apply hci_devcd_state_name() Zijun Hu
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Zijun Hu @ 2026-07-13 12:01 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Zijun Hu, linux-bluetooth, linux-kernel, Zijun Hu

This series collects the btusb and devcoredump changes required by the
upcoming Qualcomm QCC2072 support.

Posting them as a standalone series because the QCC2072 driver itself is
larger and will take longer to review. These prerequisites are small and
self-contained, so they can hopefully be reviewed and merged on their own
in the meantime.

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
Changes in v2:
- btusb: drop "Build the driver from multiple source files"; the split
  into btusb_main.c needs more discussion and will be sent separately
- coredump: implement hci_devcd_state_name() with a switch returning
  "Unknown" for out-of-range states, instead of an array lookup
- btusb: make btusb_recv_{event,acl}() take struct hci_dev * directly,
  instead of adding separate btusb_recv_{event,acl}_hdev() wrappers
- Link to v1: https://lore.kernel.org/r/20260708-btusb_prep_qcc2072-v1-0-d835b187fd01@oss.qualcomm.com

---
Zijun Hu (5):
      Bluetooth: coredump: Introduce and apply hci_devcd_state_name()
      Bluetooth: coredump: Allow drivers to pad dump header to fixed size
      Bluetooth: btusb: Add an indirect recv_intr() hook to btusb_data
      Bluetooth: btusb: Make btusb_recv_{event,acl}() take struct hci_dev *
      Bluetooth: btusb: Add a simple static btusb_prepare_reset()

 drivers/bluetooth/btusb.c        | 33 +++++++++++++++++--------
 include/net/bluetooth/coredump.h | 11 +++++++++
 net/bluetooth/coredump.c         | 52 ++++++++++++++++++++++++++++++----------
 3 files changed, 74 insertions(+), 22 deletions(-)
---
base-commit: eab19cb7618e5c50fd1f8c1efdc4e66e16575975
change-id: 20260708-btusb_prep_qcc2072-23604a4e81d1

Best regards,
-- 
Zijun Hu <zijun.hu@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH 1/6] Bluetooth: coredump: Introduce and apply hci_devcd_state_name()
@ 2026-07-09  6:14 Zijun Hu
  2026-07-09  9:29 ` Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support bluez.test.bot
  0 siblings, 1 reply; 8+ messages in thread
From: Zijun Hu @ 2026-07-09  6:14 UTC (permalink / raw)
  To: Marcel Holtmann, Luiz Augusto von Dentz
  Cc: Zijun Hu, linux-bluetooth, linux-kernel, Zijun Hu

Introduce hci_devcd_state_name() to make devcoredump state more
readable, and apply it in coredump.c. Also remove a trailing space
in two bt_dev_dbg() format strings while applying it.

Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
---
 include/net/bluetooth/coredump.h |  7 +++++++
 net/bluetooth/coredump.c         | 31 ++++++++++++++++++++++++-------
 2 files changed, 31 insertions(+), 7 deletions(-)

diff --git a/include/net/bluetooth/coredump.h b/include/net/bluetooth/coredump.h
index 72f51b587a04..ab85a6adfffd 100644
--- a/include/net/bluetooth/coredump.h
+++ b/include/net/bluetooth/coredump.h
@@ -60,6 +60,8 @@ struct hci_devcoredump {
 
 #ifdef CONFIG_DEV_COREDUMP
 
+const char *hci_devcd_state_name(enum devcoredump_state state);
+
 void hci_devcd_reset(struct hci_dev *hdev);
 void hci_devcd_rx(struct work_struct *work);
 void hci_devcd_timeout(struct work_struct *work);
@@ -74,6 +76,11 @@ int hci_devcd_abort(struct hci_dev *hdev);
 
 #else
 
+static inline const char *hci_devcd_state_name(enum devcoredump_state state)
+{
+	return "";
+}
+
 static inline void hci_devcd_reset(struct hci_dev *hdev) {}
 static inline void hci_devcd_rx(struct work_struct *work) {}
 static inline void hci_devcd_timeout(struct work_struct *work) {}
diff --git a/net/bluetooth/coredump.c b/net/bluetooth/coredump.c
index 720cb79adf96..3d4c2194ef43 100644
--- a/net/bluetooth/coredump.c
+++ b/net/bluetooth/coredump.c
@@ -30,8 +30,9 @@ struct hci_devcoredump_skb_pattern {
 
 #define DBG_UNEXPECTED_STATE() \
 	bt_dev_dbg(hdev, \
-		   "Unexpected packet (%d) for state (%d). ", \
-		   hci_dmp_cb(skb)->pkt_type, hdev->dump.state)
+		   "Unexpected packet (%d) for state %s.", \
+		   hci_dmp_cb(skb)->pkt_type, \
+		   hci_devcd_state_name(hdev->dump.state))
 
 #define MAX_DEVCOREDUMP_HDR_SIZE	512	/* bytes */
 
@@ -50,8 +51,9 @@ static int hci_devcd_update_hdr_state(char *buf, size_t size, int state)
 /* Call with hci_dev_lock only. */
 static int hci_devcd_update_state(struct hci_dev *hdev, int state)
 {
-	bt_dev_dbg(hdev, "Updating devcoredump state from %d to %d.",
-		   hdev->dump.state, state);
+	bt_dev_dbg(hdev, "Updating devcoredump state from %s to %s.",
+		   hci_devcd_state_name(hdev->dump.state),
+		   hci_devcd_state_name(state));
 
 	hdev->dump.state = state;
 
@@ -245,7 +247,7 @@ static void hci_devcd_dump(struct hci_dev *hdev)
 	struct sk_buff *skb;
 	u32 size;
 
-	bt_dev_dbg(hdev, "state %d", hdev->dump.state);
+	bt_dev_dbg(hdev, "state %s", hci_devcd_state_name(hdev->dump.state));
 
 	size = hdev->dump.tail - hdev->dump.head;
 
@@ -368,8 +370,9 @@ void hci_devcd_rx(struct work_struct *work)
 			break;
 
 		default:
-			bt_dev_dbg(hdev, "Unknown packet (%d) for state (%d). ",
-				   hci_dmp_cb(skb)->pkt_type, hdev->dump.state);
+			bt_dev_dbg(hdev, "Unknown packet (%d) for state %s.",
+				   hci_dmp_cb(skb)->pkt_type,
+				   hci_devcd_state_name(hdev->dump.state));
 			break;
 		}
 
@@ -551,3 +554,17 @@ int hci_devcd_abort(struct hci_dev *hdev)
 	return 0;
 }
 EXPORT_SYMBOL(hci_devcd_abort);
+
+const char *hci_devcd_state_name(enum devcoredump_state state)
+{
+	static const char * const state_names[] = {
+		[HCI_DEVCOREDUMP_IDLE]		= "IDLE",
+		[HCI_DEVCOREDUMP_ACTIVE]	= "ACTIVE",
+		[HCI_DEVCOREDUMP_DONE]		= "DONE",
+		[HCI_DEVCOREDUMP_ABORT]		= "ABORT",
+		[HCI_DEVCOREDUMP_TIMEOUT]	= "TIMEOUT",
+	};
+
+	return state_names[state];
+}
+EXPORT_SYMBOL(hci_devcd_state_name);

-- 
2.34.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-07-13 13:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-13 12:01 [PATCH v2 0/5] Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support Zijun Hu
2026-07-13 12:01 ` [PATCH v2 1/5] Bluetooth: coredump: Introduce and apply hci_devcd_state_name() Zijun Hu
2026-07-13 13:11   ` Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support bluez.test.bot
2026-07-13 12:01 ` [PATCH v2 2/5] Bluetooth: coredump: Allow drivers to pad dump header to fixed size Zijun Hu
2026-07-13 12:01 ` [PATCH v2 3/5] Bluetooth: btusb: Add an indirect recv_intr() hook to btusb_data Zijun Hu
2026-07-13 12:01 ` [PATCH v2 4/5] Bluetooth: btusb: Make btusb_recv_{event,acl}() take struct hci_dev * Zijun Hu
2026-07-13 12:01 ` [PATCH v2 5/5] Bluetooth: btusb: Add a simple static btusb_prepare_reset() Zijun Hu
  -- strict thread matches above, loose matches on Subject: below --
2026-07-09  6:14 [PATCH 1/6] Bluetooth: coredump: Introduce and apply hci_devcd_state_name() Zijun Hu
2026-07-09  9:29 ` Bluetooth: btusb: Preparation for upcoming Qualcomm QCC2072 support bluez.test.bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.