diff mbox series

Bluetooth: btrtl: Shorten HCI_OP_RESET timeout

Message ID 20240927064127.4167789-1-hildawu@realtek.com (mailing list archive)
State New, archived
Headers show
Series Bluetooth: btrtl: Shorten HCI_OP_RESET timeout | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS

Commit Message

Hilda Wu Sept. 27, 2024, 6:41 a.m. UTC
Shorten the timeout for the HCI Reset on shutdown.

Signed-off-by: Hilda Wu <hildawu@realtek.com>
---
 drivers/bluetooth/btrtl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Menzel Sept. 27, 2024, 6:48 a.m. UTC | #1
Dear Hilda,


Thank you for your patch.

Am 27.09.24 um 08:41 schrieb Hilda Wu:
> Shorten the timeout for the HCI Reset on shutdown.

Why? It’d be great if you elaborated, and documented how to reproduce 
the problem.

What is the old and new timeout value? For the git commit message 
summary, maybe use:

Bluetooth: btrtl: Decrease HCI_OP_RESET timeout from x ms to y ms

> Signed-off-by: Hilda Wu <hildawu@realtek.com>
> ---
>   drivers/bluetooth/btrtl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
> index 2d95b3ea046d..7128a8a0ba25 100644
> --- a/drivers/bluetooth/btrtl.c
> +++ b/drivers/bluetooth/btrtl.c
> @@ -1371,7 +1371,7 @@ int btrtl_shutdown_realtek(struct hci_dev *hdev)
>   	/* According to the vendor driver, BT must be reset on close to avoid
>   	 * firmware crash.
>   	 */
> -	skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
> +	skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_CMD_TIMEOUT);
>   	if (IS_ERR(skb)) {
>   		ret = PTR_ERR(skb);
>   		bt_dev_err(hdev, "HCI reset during shutdown failed");


Kind regards,

Paul
Hilda Wu Oct. 1, 2024, 7:44 a.m. UTC | #2
Hi Paul,

Thank you for your opinion.
I just modified the commit message summary and sent v2.
Please check the following comment.
Thanks again.

Regards,
Hilda

-----Original Message-----
From: Paul Menzel <pmenzel@molgen.mpg.de> 
Sent: Friday, September 27, 2024 2:48 PM
To: Hilda Wu <hildawu@realtek.com>
Cc: marcel@holtmann.org; luiz.dentz@gmail.com; linux-bluetooth@vger.kernel.org; linux-kernel@vger.kernel.org; alex_lu@realsil.com.cn; Max Chou <max.chou@realtek.com>; KidmanLee <kidman@realtek.com>; howardchung@google.com; apusaka@chromium.org; yinghsu@chromium.org; johnlai@google.com
Subject: Re: [PATCH] Bluetooth: btrtl: Shorten HCI_OP_RESET timeout


External mail.



Dear Hilda,


Thank you for your patch.

Am 27.09.24 um 08:41 schrieb Hilda Wu:
> Shorten the timeout for the HCI Reset on shutdown.

Why? It’d be great if you elaborated, and documented how to reproduce the problem.

Actually, this patch is not for fix something happen, but a prevention.
Let upper layer stack reduce the expected waiting time, for preventing stack daemon be blocked by the socket close if this could happen.

What is the old and new timeout value? For the git commit message summary, maybe use:

Add changes.

Bluetooth: btrtl: Decrease HCI_OP_RESET timeout from x ms to y ms

Add changes.

> Signed-off-by: Hilda Wu <hildawu@realtek.com>
> ---
>   drivers/bluetooth/btrtl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c 
> index 2d95b3ea046d..7128a8a0ba25 100644
> --- a/drivers/bluetooth/btrtl.c
> +++ b/drivers/bluetooth/btrtl.c
> @@ -1371,7 +1371,7 @@ int btrtl_shutdown_realtek(struct hci_dev *hdev)
>       /* According to the vendor driver, BT must be reset on close to avoid
>        * firmware crash.
>        */
> -     skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
> +     skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, 
> + HCI_CMD_TIMEOUT);
>       if (IS_ERR(skb)) {
>               ret = PTR_ERR(skb);
>               bt_dev_err(hdev, "HCI reset during shutdown failed");


Kind regards,

Paul
diff mbox series

Patch

diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c
index 2d95b3ea046d..7128a8a0ba25 100644
--- a/drivers/bluetooth/btrtl.c
+++ b/drivers/bluetooth/btrtl.c
@@ -1371,7 +1371,7 @@  int btrtl_shutdown_realtek(struct hci_dev *hdev)
 	/* According to the vendor driver, BT must be reset on close to avoid
 	 * firmware crash.
 	 */
-	skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
+	skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_CMD_TIMEOUT);
 	if (IS_ERR(skb)) {
 		ret = PTR_ERR(skb);
 		bt_dev_err(hdev, "HCI reset during shutdown failed");