lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <TYZPR03MB527870252CC08268C037A42982D32@TYZPR03MB5278.apcprd03.prod.outlook.com>
Date: Thu, 13 Mar 2025 02:03:01 +0000
From: Yake Yang (杨亚克) <yake.yang@...iatek.com>
To: Paul Menzel <pmenzel@...gen.mpg.de>, Sean Wang <Sean.Wang@...iatek.com>,
	Wentao Guan <guanwentao@...ontech.com>
CC: "marcel@...tmann.org" <marcel@...tmann.org>, "johan.hedberg@...il.com"
	<johan.hedberg@...il.com>, "luiz.dentz@...il.com" <luiz.dentz@...il.com>,
	"linux-bluetooth@...r.kernel.org" <linux-bluetooth@...r.kernel.org>,
	"linux-mediatek@...ts.infradead.org" <linux-mediatek@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: 回复: [PATCH] Bluetooth: btmtk: delay usb_autopm_put_interface until WMT event received

Dear Paul , Sean,
Wentao (guanwentao@...ontech.com) is the reproducer .
Thanks!

-----邮件原件-----
发件人: Paul Menzel <pmenzel@...gen.mpg.de> 
发送时间: 2025年3月12日 14:40
收件人: Sean Wang <Sean.Wang@...iatek.com>; Yake Yang (杨亚克) <yake.yang@...iatek.com>
抄送: marcel@...tmann.org; johan.hedberg@...il.com; luiz.dentz@...il.com; linux-bluetooth@...r.kernel.org; linux-mediatek@...ts.infradead.org; linux-kernel@...r.kernel.org
主题: Re: [PATCH] Bluetooth: btmtk: delay usb_autopm_put_interface until WMT event received


External email : Please do not click links or open attachments until you have verified the sender or the content.


Dear Sean, dear Yake,


Thank you for the patch.

Am 12.03.25 um 00:16 schrieb sean.wang@...nel.org:
> From: Sean Wang <sean.wang@...iatek.com>
>
> Delay calling usb_autopm_put_interface until the WMT event response is 
> received to ensure proper synchronization and prevent premature power 
> management actions.

Do you have a reproducer? It’d be great if you could add that to the commit message.


Kind regards,

Paul


> Co-developed-by: Yake Yang <yake.yang@...iatek.com>
> Signed-off-by: Yake Yang <yake.yang@...iatek.com>
> Signed-off-by: Sean Wang <sean.wang@...iatek.com>
> ---
>   drivers/bluetooth/btmtk.c | 15 +++++++--------
>   1 file changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/bluetooth/btmtk.c b/drivers/bluetooth/btmtk.c 
> index 68846c5bd4f7..01832bc6a259 100644
> --- a/drivers/bluetooth/btmtk.c
> +++ b/drivers/bluetooth/btmtk.c
> @@ -620,17 +620,14 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev 
> *hdev,
>
>       if (err < 0) {
>               clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
> -             usb_autopm_put_interface(data->intf);
> -             goto err_free_wc;
> +             goto err_pm_put;
>       }
>
>       /* Submit control IN URB on demand to process the WMT event */
>       err = btmtk_usb_submit_wmt_recv_urb(hdev);
>
> -     usb_autopm_put_interface(data->intf);
> -
>       if (err < 0)
> -             goto err_free_wc;
> +             goto err_pm_put;
>
>       /* The vendor specific WMT commands are all answered by a vendor
>        * specific event and will have the Command Status or Command @@ 
> -646,18 +643,18 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
>       if (err == -EINTR) {
>               bt_dev_err(hdev, "Execution of wmt command interrupted");
>               clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
> -             goto err_free_wc;
> +             goto err_pm_put;
>       }
>
>       if (err) {
>               bt_dev_err(hdev, "Execution of wmt command timed out");
>               clear_bit(BTMTK_TX_WAIT_VND_EVT, &data->flags);
>               err = -ETIMEDOUT;
> -             goto err_free_wc;
> +             goto err_pm_put;
>       }
>
>       if (data->evt_skb == NULL)
> -             goto err_free_wc;
> +             goto err_pm_put;
>
>       /* Parse and handle the return WMT event */
>       wmt_evt = (struct btmtk_hci_wmt_evt *)data->evt_skb->data; @@ 
> -700,6 +697,8 @@ static int btmtk_usb_hci_wmt_sync(struct hci_dev *hdev,
>   err_free_skb:
>       kfree_skb(data->evt_skb);
>       data->evt_skb = NULL;
> +err_pm_put:
> +     usb_autopm_put_interface(data->intf);
>   err_free_wc:
>       kfree(wc);
>       return err;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ