[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1e8173de-8a48-4707-b276-2e1d6cfff96d@molgen.mpg.de>
Date: Fri, 3 Oct 2025 10:11:51 +0200
From: Paul Menzel <pmenzel@...gen.mpg.de>
To: Chris Lu <chris.lu@...iatek.com>
Cc: Marcel Holtmann <marcel@...tmann.org>,
Johan Hedberg <johan.hedberg@...il.com>,
Luiz Von Dentz <luiz.dentz@...il.com>, Sean Wang <sean.wang@...iatek.com>,
Will Lee <will-cy.Lee@...iatek.com>, SS Wu <ss.wu@...iatek.com>,
Steve Lee <steve.lee@...iatek.com>, linux-bluetooth@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH v1] Bluetooth: btmtksdio: Add pmctrl handling for BT
closed state during reset
Dear Chris,
Thank you for your patch.
Am 30.09.25 um 07:39 schrieb Chris Lu:
> This patch adds logic to handle power management control when the
> Bluetooth function is closed during the SDIO reset sequence.
>
> Specifically, if BT is closed before reset, the driver enables the
> SDIO function and sets driver pmctrl. After reset, if BT remains
> closed, the driver sets firmware pmctrl and disables the SDIO function.
>
> These changes ensure proper power management and device state consistency
> across the reset flow.
How can your patch be verified on a running system?
Kind regards,
Paul
> Fixes: 8fafe702253d ("Bluetooth: mt7921s: support bluetooth reset mechanism")
> Signed-off-by: Chris Lu <chris.lu@...iatek.com>
> ---
> drivers/bluetooth/btmtksdio.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
> index 50abefba6d04..62db31bd6592 100644
> --- a/drivers/bluetooth/btmtksdio.c
> +++ b/drivers/bluetooth/btmtksdio.c
> @@ -1270,6 +1270,12 @@ static void btmtksdio_reset(struct hci_dev *hdev)
>
> sdio_claim_host(bdev->func);
>
> + /* set drv_pmctrl if BT is closed before doing reset */
> + if (!test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state)) {
> + sdio_enable_func(bdev->func);
> + btmtksdio_drv_pmctrl(bdev);
> + }
> +
> sdio_writel(bdev->func, C_INT_EN_CLR, MTK_REG_CHLPCR, NULL);
> skb_queue_purge(&bdev->txq);
> cancel_work_sync(&bdev->txrx_work);
> @@ -1285,6 +1291,12 @@ static void btmtksdio_reset(struct hci_dev *hdev)
> goto err;
> }
>
> + /* set fw_pmctrl back if BT is closed after doing reset */
> + if (!test_bit(BTMTKSDIO_FUNC_ENABLED, &bdev->tx_state)) {
> + btmtksdio_fw_pmctrl(bdev);
> + sdio_disable_func(bdev->func);
> + }
> +
> clear_bit(BTMTKSDIO_PATCH_ENABLED, &bdev->tx_state);
> err:
> sdio_release_host(bdev->func);
Powered by blists - more mailing lists