Re: [PATCH v2] Bluetooth: hci_mrvl: Leave the serdev port lifetime to hci_serdev
From: Loic Poulain
Date: Mon Nov 16 2026 - 11:42:13 EST
On Mon, Nov 16, 2026 at 5:36 PM Michael McAllister
<me@xxxxxxxxxxxxxxxxxxxxx> wrote:
>
> hci_uart_register_device_priv() opens the port before calling mrvl_open(),
> so Marvell opens it twice. Likewise, mrvl_close() closes it before the
> transport closes it again during unregister or registration error cleanup.
>
> Remove the extra calls and let hci_serdev own the port lifetime. This also
> avoids failing probe when serdev rejects a second open with -EALREADY.
>
> Fixes: be70e5e774a6 ("Bluetooth: hci_mrvl: Add serdev support")
> Reported-by: Markus Probst <markus.probst@xxxxxxxxx>
> Closes: https://lore.kernel.org/341e56b1ff7d8a5b109e26e30dfed61faa54d603.camel@xxxxxxxxx/
> Signed-off-by: Michael McAllister <me@xxxxxxxxxxxxxxxxxxxxx>
Reviewed-by: Loic Poulain <loic.poulain@xxxxxxxxxxxxxxxx>
> ---
> Hi Markus,
>
> This just drops the non-standard trailer that checkpatch flagged. No
> code changes from v1; still looking for a test on Marvell hardware.
>
> Thanks,
> Michael
>
> Changes in v2:
> - Drop the Assisted-by trailer. AI assistance was used for v1.
>
> drivers/bluetooth/hci_mrvl.c | 14 --------------
> 1 file changed, 14 deletions(-)
>
> diff --git a/drivers/bluetooth/hci_mrvl.c b/drivers/bluetooth/hci_mrvl.c
> index 5798a8db0..def19907c 100644
> --- a/drivers/bluetooth/hci_mrvl.c
> +++ b/drivers/bluetooth/hci_mrvl.c
> @@ -57,7 +57,6 @@ struct hci_mrvl_pkt {
> static int mrvl_open(struct hci_uart *hu)
> {
> struct mrvl_data *mrvl;
> - int ret;
>
> BT_DBG("hu %p", hu);
>
> @@ -75,17 +74,7 @@ static int mrvl_open(struct hci_uart *hu)
>
> hu->priv = mrvl;
>
> - if (hu->serdev) {
> - ret = serdev_device_open(hu->serdev);
> - if (ret)
> - goto err;
> - }
> -
> return 0;
> -err:
> - kfree(mrvl);
> -
> - return ret;
> }
>
> static int mrvl_close(struct hci_uart *hu)
> @@ -94,9 +83,6 @@ static int mrvl_close(struct hci_uart *hu)
>
> BT_DBG("hu %p", hu);
>
> - if (hu->serdev)
> - serdev_device_close(hu->serdev);
> -
> skb_queue_purge(&mrvl->txq);
> skb_queue_purge(&mrvl->rawq);
> kfree_skb(mrvl->rx_skb);
> --
> 2.39.5
>
>