All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yanli Yang" <yanli.yang@bedmex.com>
Cc: robh@kernel.org, conor+dt@kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH bluetooth-next v5 3/3] Bluetooth: btaic: Add AIC8800D80 SDIO loader and UART transport
Date: Thu, 24 Sep 2026 07:53:40 +0000	[thread overview]
Message-ID: <20260924075340.65E081F000FF@smtp.kernel.org> (raw)
In-Reply-To: <39564a381eaf73a9225a3706f2c44c0b3706a519.1790235697.git.yanli.yang@bedmex.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] bluetooth: btaic: forcible override of SDIO CCCR IEN corrupts bus state
- [Medium] bluetooth: btaic: permanent TX queue wedge on UART transmission error
--

commit 0b3f4967899ed87ce6d0daef5c0ff2b9f67d8faf
Author: Yanli Yang <yanli.yang@bedmex.com>

Bluetooth: btaic: Add AIC8800D80 SDIO loader and UART transport

This commit adds a driver for the AIC8800D80 combination chip. It uses
SDIO function 1 for Bluetooth firmware loading and a serdev UART for H4
HCI traffic. Firmware loading and patching are synchronized with UART
initialization via a reference-counted boot state.

> diff --git a/drivers/bluetooth/btaic_sdio.c b/drivers/bluetooth/btaic_sdio.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/bluetooth/btaic_sdio.c
[ ... ]
> +static int aic_bt_sdio_hw_init(struct aic_bt_sdio *btdev)
> +{
> +	struct sdio_func *func = btdev->func;
> +	struct mmc_host *host = func->card->host;
> +	u8 io_control;
> +	int err;
[ ... ]
> +	err = sdio_claim_irq(func, aic_bt_sdio_irq);
> +	if (err)
> +		goto disable_func;
> +	btdev->irq_claimed = true;
> +
> +	sdio_f0_writeb(func, 0x07, 0x04, &err);

[Severity: High]
Does this hardcoded write to the CCCR IEN register (0x04) bypass the MMC 
core's interrupt tracking? 

Since sdio_claim_irq() was already called to properly enable the master and 
Function 1 interrupts, writing 0x07 forcibly enables the Function 2 (WiFi) 
interrupt outside of the MMC core's knowledge. Could this lead to unhandled 
interrupt storms or disrupt the WiFi function if its driver is not yet ready?

> +	if (err)
> +		goto release_irq;
> +
> +	sdio_writeb(func, 0x07, AIC_SDIO_INTR_ENABLE, &err);
> +	if (err)
> +		goto release_irq;
> +
> +	sdio_release_host(func);
> +	return 0;
[ ... ]
> diff --git a/drivers/bluetooth/btaic_uart.c b/drivers/bluetooth/btaic_uart.c
> new file mode 100644
> --- /dev/null
> +++ b/drivers/bluetooth/btaic_uart.c
[ ... ]
> +static void aic_bt_tx_work(struct work_struct *work)
> +{
> +	struct aic_bt_uart *uart = container_of(work, struct aic_bt_uart,
> +						 tx_work);
> +
> +	for (;;) {
> +		struct sk_buff *skb;
> +
> +		clear_bit(AIC_BT_TX_WAKEUP, &uart->tx_state);
> +
> +		while ((skb = skb_dequeue(&uart->txq))) {
> +			int len;
> +
> +			len = serdev_device_write_buf(uart->serdev, skb->data,
> +						      skb->len);
> +			if (len <= 0) {
> +				skb_queue_head(&uart->txq, skb);
> +				if (len < 0)
> +					bt_dev_err(uart->hdev,
> +						   "UART transmit failed (%d)", len);
> +				break;
> +			}

[Severity: Medium]
Will this create a permanent wedge in the TX queue on a transmission error?

If serdev_device_write_buf() returns a negative error code (such as -EIO 
or -ENODEV) due to local hardware or bus errors, the driver treats it 
identically to a full buffer by pushing the exact same skb back to the 
head of uart->txq.

On the next TX wakeup, it appears it will dequeue this same packet, 
fail again, and requeue it indefinitely, which would effectively block 
all subsequent outbound Bluetooth traffic rather than gracefully dropping 
the failed packet.

> +
> +			uart->hdev->stat.byte_tx += len;
> +			skb_pull(skb, len);
> +			if (skb->len) {
> +				skb_queue_head(&uart->txq, skb);
> +				break;
> +			}

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1790235697.git.yanli.yang@bedmex.com?part=3

      reply	other threads:[~2026-09-24  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24  7:41 [PATCH bluetooth-next v5 0/3] Bluetooth: Add AIC8800D80 SDIO firmware loader and UART HCI Yanli Yang
2026-09-24  3:34 ` [PATCH bluetooth-next v5 1/3] dt-bindings: vendor-prefixes: Add AIC Semiconductor Yanli Yang
2026-09-24  7:51   ` Krzysztof Kozlowski
2026-09-24  8:11     ` 杨彦立
2026-09-24 10:18   ` Bluetooth: Add AIC8800D80 SDIO firmware loader and UART HCI bluez.test.bot
2026-09-24  3:34 ` [PATCH bluetooth-next v5 2/3] dt-bindings: net: bluetooth: Add AIC8800D80 Yanli Yang
2026-09-24  7:54   ` Krzysztof Kozlowski
2026-09-24  3:34 ` [PATCH bluetooth-next v5 3/3] Bluetooth: btaic: Add AIC8800D80 SDIO loader and UART transport Yanli Yang
2026-09-24  7:53   ` sashiko-bot [this message]

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=20260924075340.65E081F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=yanli.yang@bedmex.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 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.