mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pauli Virtanen <pav@iki.fi>
To: Zijun Hu <zijun.hu@oss.qualcomm.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	 Luiz Augusto von Dentz	 <luiz.dentz@gmail.com>
Cc: Zijun Hu <zijun_hu@icloud.com>,
	linux-bluetooth@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 4/4] Bluetooth: btusb: Add support for Qualcomm multi-subsystem QCC2072
Date: Fri, 11 Sep 2026 22:56:14 +0300	[thread overview]
Message-ID: <7bfc5ec0438b830386ae2899756bb9a7c4b9e123.camel@iki.fi> (raw)
In-Reply-To: <20260911-btusb_qcc2072-v5-4-422754f4e938@oss.qualcomm.com>

Hi,

pe, 2026-09-11 kello 01:00 -0700, Zijun Hu kirjoitti:
> QCC2072 has a Peripheral (PERI) subsystem to support the BT function
> unit, the transport wire is owned by PERI and carries both BT-HCI and
> PERI-HCI frames, as shown below:
> 
>                  _______________________________
>        USB I/F	|	   internal link	|
> BTHOST --------	|---- PERI -------------- BT	|
> 		|_______________________________|
>                 (other on-chip subsystems omitted)
> 
> PERI has its own command/event/ACL traffic, memdump, and firmware
> (PATCH and NVM), all different from BT's own, and BTHOST needs to
> interact with PERI directly.
> 
> To support multi-subsystem controllers, add btusb_qcom.c/.h as a new
> transport-specific design:
> 
> - Multi-subsystem memdump collection.
> - Generic PERI event handling, and sending a PERI frame then
>   syncing an event sequence.
> - Downloading PERI firmware (rampatch and NVM).
> - Recovery on command timeout or hardware error event.
[clip]
> 
> +/*
> + * btusb_qcom_send_frame - send a frame for BT or PERI
> + * @hdev: the HCI device
> + * @skb: the frame to send
> + *
> + * Implements hdev->send().
> + *
> + * Return: 0 on success, or a negative errno on failure.
> + */
> +int btusb_qcom_send_frame(struct hci_dev *hdev, struct sk_buff *skb)

This one should have __context_unsafe(/* conditional locking */)
annotation, or no if (need_lock), to avoid warnings on LLVM 23.

> +{
> +	struct btusb_qcom *xport_data = btusb_qcom_xport_data(hdev);
> +	struct btqcom_data *qbt_data = hci_get_priv(hdev);
> +	bool is_vendor;
> +	bool need_lock;
> +	u8 pkt_type;
> +	int ret;
> +
> +	if (qbt_data->category != QBTC_CAT_MSUBSYS)
> +		return xport_data->send_bt_frame(hdev, skb);
> +
> +	pkt_type = hci_skb_pkt_type(skb);
> +	is_vendor = pkt_type == HCI_VENDOR_PKT;
> +	/* an empty vendor packet has no path to reach here */
> +	if (is_vendor)
> +		hci_skb_pkt_type(skb) = *(const u8 *)skb_pull_data(skb, 1);
> +
> +	pkt_type = hci_skb_pkt_type(skb);
> +	need_lock = pkt_type == HCI_COMMAND_PKT ||
> +		    pkt_type == QPERI_COMMAND_PKT;
> +
> +	if (need_lock)
> +		mutex_lock(&xport_data->tx_mutex);
> +
> +	if (is_vendor)
> +		ret = xport_data->send_vendor_frame(hdev, skb);
> +	else
> +		ret = xport_data->send_bt_frame(hdev, skb);
> +
> +	if (need_lock)
> +		mutex_unlock(&xport_data->tx_mutex);
> +
> +	return ret;
> +}

-- 
Pauli Virtanen

  reply	other threads:[~2026-09-11 19:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-11  8:00 [PATCH v5 0/4] Bluetooth: btusb: Support " Zijun Hu
2026-09-11  8:00 ` [PATCH v5 1/4] Bluetooth: btusb: Add recv_intr() hook to btusb_data Zijun Hu
2026-09-11  8:00 ` [PATCH v5 2/4] Bluetooth: Add generic support for vendor packets Zijun Hu
2026-09-11  8:00 ` [PATCH v5 3/4] Bluetooth: btusb: Build the driver from multiple source files Zijun Hu
2026-09-11  8:00 ` [PATCH v5 4/4] Bluetooth: btusb: Add support for Qualcomm multi-subsystem QCC2072 Zijun Hu
2026-09-11 19:56   ` Pauli Virtanen [this message]
2026-09-14  2:53     ` 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=7bfc5ec0438b830386ae2899756bb9a7c4b9e123.camel@iki.fi \
    --to=pav@iki.fi \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=zijun.hu@oss.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

all inboxes | Powered by JetHome®