[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABBYNZJOEi_=vLiivGFt7tKiq8TMn9YG=FkC20y-6M75Bi8vYg@mail.gmail.com>
Date: Mon, 6 Jan 2025 15:44:02 -0500
From: Luiz Augusto von Dentz <luiz.dentz@...il.com>
To: Chris Lu <chris.lu@...iatek.com>
Cc: Marcel Holtmann <marcel@...tmann.org>, Johan Hedberg <johan.hedberg@...il.com>,
Sean Wang <sean.wang@...iatek.com>, Aaron Hou <aaron.hou@...iatek.com>,
Steve Lee <steve.lee@...iatek.com>, linux-bluetooth <linux-bluetooth@...r.kernel.org>,
linux-kernel <linux-kernel@...r.kernel.org>,
linux-mediatek <linux-mediatek@...ts.infradead.org>
Subject: Re: [PATCH v1] Bluetooth: btmtk: Fix failed to send func ctrl for
MediaTek devices.
Hi Chris,
On Mon, Dec 23, 2024 at 3:58 AM Chris Lu <chris.lu@...iatek.com> wrote:
>
> Use usb_autopm_get_interface() and usb_autopm_put_interface()
> in btmtk_usb_shutdown(), it could send func ctrl after enabling
> autosuspend.
>
> Bluetooth: btusb_mtk_hci_wmt_sync() hci0: Execution of wmt command
> timed out
> Bluetooth: btusb_mtk_shutdown() hci0: Failed to send wmt func ctrl
> (-110)
>
> Signed-off-by: Chris Lu <chris.lu@...iatek.com>
Missing Fixes tag, Ive been adding it myself for some time now but you
better create the practice to include it so I don't have to go find
what commit introduced btmtk_usb_shutdown to then do git log -1
--pretty=fixes and git commit --amend.
> ---
> drivers/bluetooth/btmtk.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c
> index 7fd9d5ddce02..224eafc27dbe 100644
> --- a/drivers/bluetooth/btmtk.c
> +++ b/drivers/bluetooth/btmtk.c
> @@ -1472,10 +1472,15 @@ EXPORT_SYMBOL_GPL(btmtk_usb_setup);
>
> int btmtk_usb_shutdown(struct hci_dev *hdev)
> {
> + struct btmtk_data *data = hci_get_priv(hdev);
> struct btmtk_hci_wmt_params wmt_params;
> u8 param = 0;
> int err;
>
> + err = usb_autopm_get_interface(data->intf);
> + if (err < 0)
> + return err;
> +
> /* Disable the device */
> wmt_params.op = BTMTK_WMT_FUNC_CTRL;
> wmt_params.flag = 0;
> @@ -1486,9 +1491,11 @@ int btmtk_usb_shutdown(struct hci_dev *hdev)
> err = btmtk_usb_hci_wmt_sync(hdev, &wmt_params);
> if (err < 0) {
> bt_dev_err(hdev, "Failed to send wmt func ctrl (%d)", err);
> + usb_autopm_put_interface(data->intf);
> return err;
> }
>
> + usb_autopm_put_interface(data->intf);
> return 0;
> }
> EXPORT_SYMBOL_GPL(btmtk_usb_shutdown);
> --
> 2.45.2
>
--
Luiz Augusto von Dentz
Powered by blists - more mailing lists