On 6/29/26 3:01 PM, George Moussalem via B4 Relay wrote:
> From: George Moussalem <[email protected]>
>
> Add support for the Bluetooth controller found in the IPQ5018 SoC.
> This driver implements firmware loading and the transport layer between
> the HCI core and the Bluetooth controller.
>
> The firmware is loaded by the host into the dedicated reserved memory
> carveout and authenticated by TrustZone. A Secure Channel Manager (SCM)
> call safely brings the peripheral core out of reset.
>
> A shared memory ring buffer topology handles runtime data frame
> transport between the host APSS and the controller.
>
> An outgoing APCS IPC bit and an incoming GIC interrupt handle host/guest
> signaling.
>
> Signed-off-by: George Moussalem <[email protected]>
> ---
[...]
> +#include <linux/bits.h>
> +#include <linux/clk.h>
> +#include <linux/delay.h>
> +#include <linux/device.h>
> +#include <linux/elf.h>
> +#include <linux/firmware.h>
> +#include <linux/firmware/qcom/qcom_scm.h>
> +#include <linux/init.h>
> +#include <linux/interrupt.h>
> +#include <linux/io.h>
> +#include <linux/kernel.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_reserved_mem.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/reset.h>
> +#include <linux/skbuff.h>
> +#include <linux/slab.h>
> +#include <linux/soc/qcom/mdt_loader.h>
> +#include <linux/types.h>
> +#include <linux/workqueue.h>
I don't know for sure, but the amount of the includes suggests some may
be unnecessary
[...]
> +static void btqcomipc_update_stats(struct hci_dev *hdev, struct sk_buff
> *skb);
I don't think the forward-declaration is necessary
> +static struct ring_buffer_info *btss_get_tx_rbuf(struct qcom_btss *desc,
> + bool *is_sbuf_full)
> +{
> + u8 idx;
> + struct ring_buffer_info *rinfo;
> +
> + for (rinfo = &(desc->tx_ctxt->sring_buf_info); rinfo != NULL;
> + rinfo = (struct ring_buffer_info *)(uintptr_t)(rinfo->next)) {
> + idx = (rinfo->widx + 1) % (desc->tx_ctxt->smsg_buf_cnt);
That's one complex for-loop! Maybe move the assignments into the loop body
[...]
> + /* Account for HCI packet type as it's not included in the skb payload
> */
> + len = (skb) ? skb->len + 1 : 0;
Unnecessary parentheses, also in some other places
> + memset(&aux_ptr, 0, sizeof(struct ipc_aux_ptr));
You can do aux_ptr = { } at declaration
Konrad