All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zijun Hu <quic_zijuhu@quicinc.com>
To: <luiz.dentz@gmail.com>, <marcel@holtmann.org>, <jiangzp@google.com>
Cc: <linux-bluetooth@vger.kernel.org>, <quic_zijuhu@quicinc.com>
Subject: [PATCH v1 0/3] Fix 2 tool btattach issues for QCA controllers
Date: Sat, 13 Apr 2024 00:26:24 +0800	[thread overview]
Message-ID: <1712939188-25529-1-git-send-email-quic_zijuhu@quicinc.com> (raw)
In-Reply-To: <1710914907-30012-1-git-send-email-quic_zijuhu@quicinc.com>

There are many QCA soc types defined by drivers/bluetooth/btqca.h
enum qca_btsoc_type {
        QCA_INVALID = -1,
        QCA_AR3002,
        QCA_ROME,
        QCA_WCN3988,
        QCA_WCN3990,
        QCA_WCN3998,
        QCA_WCN3991,
        QCA_QCA2066,
        QCA_QCA6390,
        QCA_WCN6750,
        QCA_WCN6855,
        QCA_WCN7850,
        QCA_MAX,
};
and every soc type stands for a kind of QCA BT controller, this patch
series are to solve below 2 tool btattach issues for QCA soc types:
1) tool btattach will cause kernel crash when used for QCA_ROME
2) tool btattach does not support any other soc type except QCA_ROME

For hci_uart derived from tool btattach, it is allocated by hci_ldisc
and is Non-serdev device, its @serdev is NULL and its soc type is
currenlty hard coded as QCA_ROME.

The 1st issue is caused by dereferencing nullptr hu->serdev, in order to
solve the 2nd issue, a new ioctl is introduced for user to specify soc
type by a new added tool btattach option.

Zijun Hu (3):
  Bluetooth: qca: Fix crash caused by tool btattach for QCA_ROME
  Bluetooth: hci_ldisc: Add a ioctl HCIUARTSETPROTODATA
  Bluetooth: qca: Fix wrong soc type returned for tool btattach

 drivers/bluetooth/btqca.h     |  1 +
 drivers/bluetooth/hci_ldisc.c | 10 ++++++++++
 drivers/bluetooth/hci_qca.c   | 10 ++++++++--
 drivers/bluetooth/hci_uart.h  |  3 +++
 4 files changed, 22 insertions(+), 2 deletions(-)

-- 
2.7.4


  parent reply	other threads:[~2024-04-12 16:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-20  6:08 [PATCH v1 0/2] Bluetooth: qca: Add tool btattach support for more QCA soc types Zijun Hu
2024-03-20  6:08 ` [PATCH v1 1/2] Bluetooth: hci_ldisc: Add a ioctl HCIUARTSETPROTODATA Zijun Hu
2024-03-20  6:34   ` Bluetooth: qca: Add tool btattach support for more QCA soc types bluez.test.bot
2024-03-20  6:08 ` [PATCH v1 2/2] Bluetooth: qca: Fix wrong soc_type returned for tool btattach Zijun Hu
2024-03-20  7:19 ` [PATCH v1] tools/btattach: Add support for all QCA soc_types Zijun Hu
2024-03-20  9:02   ` [v1] " bluez.test.bot
2024-04-12 16:26 ` Zijun Hu [this message]
2024-04-12 16:26   ` [PATCH v1 1/3] Bluetooth: qca: Fix crash caused by tool btattach for QCA_ROME Zijun Hu
2024-04-12 16:56     ` Fix 2 tool btattach issues for QCA controllers bluez.test.bot
2024-04-12 16:26   ` [PATCH v1 2/3] Bluetooth: hci_ldisc: Add a ioctl HCIUARTSETPROTODATA Zijun Hu
2024-04-12 16:26   ` [PATCH v1 3/3] Bluetooth: qca: Fix wrong soc type returned for tool btattach Zijun Hu
2024-04-12 16:26   ` [PATCH BlueZ v1] tools/btattach: Add support for more QCA soc types Zijun Hu
2024-04-12 18:02     ` [BlueZ,v1] " bluez.test.bot
2024-04-12 20:10     ` [PATCH BlueZ v1] " Wren Turkal
2024-04-13  2:44       ` quic_zijuhu
2024-04-13  3:12         ` Wren Turkal
2024-04-18  3:38     ` [PATCH BlueZ v2] " Zijun Hu
2024-04-18  5:40       ` [BlueZ,v2] " bluez.test.bot
2024-04-17 12:52 ` [PATCH v2 0/4] Fix 2 tool btattach issues for QCA controllers Zijun Hu
2024-04-17 12:52   ` [PATCH v2 1/4] Bluetooth: qca: Fix crash caused by tool btattach for QCA_ROME Zijun Hu
2024-04-17 12:52   ` [PATCH v2 2/4] Bluetooth: qca: Fix nullptr dereference for non-serdev devices Zijun Hu
2024-04-17 12:52   ` [PATCH v2 3/4] Bluetooth: hci_ldisc: Add a ioctl HCIUARTSETPROTODATA Zijun Hu
2024-04-17 21:27     ` Luiz Augusto von Dentz
2024-04-18  0:44       ` quic_zijuhu
2024-04-17 12:52   ` [PATCH v2 4/4] Bluetooth: qca: Fix wrong soc type returned for tool btattach Zijun Hu
2024-04-17 21:39     ` Luiz Augusto von Dentz
2024-04-18  1:26       ` quic_zijuhu
2024-04-18  3:11   ` [PATCH v3 0/4] Fix 2 tool btattach issues for QCA controllers Zijun Hu
2024-04-18  3:11     ` [PATCH v3 1/4] Bluetooth: qca: Fix crash caused by tool btattach for QCA_ROME Zijun Hu
2024-04-18  3:57       ` Fix 2 tool btattach issues for QCA controllers bluez.test.bot
2024-04-18  3:11     ` [PATCH v3 2/4] Bluetooth: qca: Fix nullptr dereference for non-serdev devices Zijun Hu
2024-04-18 16:08       ` Johan Hovold
2024-04-18 22:15         ` quic_zijuhu
2024-04-18  3:11     ` [PATCH v3 3/4] Bluetooth: hci_ldisc: Add a ioctl HCIUARTSETPROTODATA Zijun Hu
2024-04-18  3:11     ` [PATCH v3 4/4] Bluetooth: qca: Support more soc types for non-serdev devices 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=1712939188-25529-1-git-send-email-quic_zijuhu@quicinc.com \
    --to=quic_zijuhu@quicinc.com \
    --cc=jiangzp@google.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    /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 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.