* [PATCH] Bluetooth: Increase command tx timeout
@ 2011-07-20 19:12 Szymon Janc
2011-07-21 16:14 ` Peter Hurley
0 siblings, 1 reply; 3+ messages in thread
From: Szymon Janc @ 2011-07-20 19:12 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Szymon Janc
Some CSR chips require more time for HCI reset command to complete.
Too short timeout caused next command being sent before reset
complete event resulting in
[23101.792031] hci_cmd_timer: hci0 command tx timeout
[23102.792046] hci_cmd_timer: hci0 command tx timeout
after pluging in dongle and non functional bt.
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
include/net/bluetooth/hci.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index be30aab..12a527c 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -121,7 +121,7 @@ enum {
#define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */
#define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
#define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
-#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */
+#define HCI_CMD_TIMEOUT (3000) /* 3 seconds */
/* HCI data types */
#define HCI_COMMAND_PKT 0x01
--
1.7.5.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Increase command tx timeout
2011-07-20 19:12 [PATCH] Bluetooth: Increase command tx timeout Szymon Janc
@ 2011-07-21 16:14 ` Peter Hurley
2011-07-26 19:52 ` Szymon Janc
0 siblings, 1 reply; 3+ messages in thread
From: Peter Hurley @ 2011-07-21 16:14 UTC (permalink / raw)
To: Szymon Janc; +Cc: linux-bluetooth@vger.kernel.org
Hi Szymon,
On Wed, 2011-07-20 at 15:12 -0400, Szymon Janc wrote:
> Some CSR chips require more time for HCI reset command to complete.
> Too short timeout caused next command being sent before reset
> complete event resulting in
> [23101.792031] hci_cmd_timer: hci0 command tx timeout
> [23102.792046] hci_cmd_timer: hci0 command tx timeout
> after pluging in dongle and non functional bt.
>
> Signed-off-by: Szymon Janc <szymon@janc.net.pl>
> ---
> include/net/bluetooth/hci.h | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
> index be30aab..12a527c 100644
> --- a/include/net/bluetooth/hci.h
> +++ b/include/net/bluetooth/hci.h
> @@ -121,7 +121,7 @@ enum {
> #define HCI_PAIRING_TIMEOUT (60000) /* 60 seconds */
> #define HCI_IDLE_TIMEOUT (6000) /* 6 seconds */
> #define HCI_INIT_TIMEOUT (10000) /* 10 seconds */
> -#define HCI_CMD_TIMEOUT (1000) /* 1 seconds */
> +#define HCI_CMD_TIMEOUT (3000) /* 3 seconds */
>
> /* HCI data types */
> #define HCI_COMMAND_PKT 0x01
Respectfully, I disagree that this is the correct fix for this problem.
After an HCI_Reset, *no* hci commands should be issued until after the
*successful* Command Complete is received. IMHO, the current code
suffers two defects:
- it doesn't wait for Command Complete after the Reset command is sent
- it ignores the result code from that Command Complete
I believe the proper fix is to _loop_ over the HCI_Reset until a
successful Command Complete is received.
Regards,
Peter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Bluetooth: Increase command tx timeout
2011-07-21 16:14 ` Peter Hurley
@ 2011-07-26 19:52 ` Szymon Janc
0 siblings, 0 replies; 3+ messages in thread
From: Szymon Janc @ 2011-07-26 19:52 UTC (permalink / raw)
To: Peter Hurley; +Cc: linux-bluetooth@vger.kernel.org
Hi Peter,
> Respectfully, I disagree that this is the correct fix for this problem.
>
> After an HCI_Reset, *no* hci commands should be issued until after the
> *successful* Command Complete is received. IMHO, the current code
> suffers two defects:
> - it doesn't wait for Command Complete after the Reset command is sent
> - it ignores the result code from that Command Complete
>
> I believe the proper fix is to _loop_ over the HCI_Reset until a
> successful Command Complete is received.
Yes, You've got a point.. I've already prepared and tested a proper fix and
will send it shortly.
Thanks for advice!
--
Szymon K. Janc
szymon@janc.net.pl // GG: 1383435
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-07-26 19:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-20 19:12 [PATCH] Bluetooth: Increase command tx timeout Szymon Janc
2011-07-21 16:14 ` Peter Hurley
2011-07-26 19:52 ` Szymon Janc
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).