From: Amit K Bag <amit.k.bag@intel.com>
To: linux-bluetooth@vger.kernel.org
Cc: sukumar.ghorai@intel.com, chethan.tumkur.narayan@intel.com,
ravishankar.srivatsa@intel.com, Amit K Bag <amit.k.bag@intel.com>
Subject: [PATCH] Bluetooth: btusb: Avoid race condition during controller recovery
Date: Wed, 6 Jun 2018 11:33:40 +0530 [thread overview]
Message-ID: <1528265020-10202-1-git-send-email-amit.k.bag@intel.com> (raw)
From: Chethan T N <chethan.tumkur.narayan@intel.com>
Observed race condition during controller recovery mechanism
resulting the controller not responding to the reset command.
To avoid such race condition need a delay of 2ms soon after the
USB re-enumeration and before sending the Reset command which shall
allow controller to completely recover and process the Reset command.
BUG=b:64035404
TEST=Magic tethering, P0 and P1 santiy test cases, kernel-boot log
Signed-off-by: Chethan T N <chethan.tumkur.narayan@intel.com>
Signed-off-by: Amit K Bag <amit.k.bag@intel.com>
---
drivers/bluetooth/btusb.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index f73a27ea28cc..c7fce9c11889 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1743,6 +1743,15 @@ static int btusb_setup_intel(struct hci_dev *hdev)
BT_DBG("%s", hdev->name);
+ /* Observed race condition during controller recovery mechanism
+ * resulting the controller not responding to the reset command.
+ *
+ * To avoid such race condition need a delay of 2ms soon after the
+ * USB re-enumeration and before sending the Reset command which shall
+ * allow controller to completely recover and process the Reset command.
+ */
+ mdelay(2);
+
/* The controller has a bug with the first HCI command sent to it
* returning number of completed commands as zero. This would stall the
* command processing in the Bluetooth core.
--
2.7.4
next reply other threads:[~2018-06-06 6:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-06 6:03 Amit K Bag [this message]
2018-06-06 6:23 ` [PATCH] Bluetooth: btusb: Avoid race condition during controller recovery Bag, Amit K
-- strict thread matches above, loose matches on Subject: below --
2018-06-06 6:22 Amit K Bag
2018-06-06 9:57 ` Luiz Augusto von Dentz
2018-05-31 9:50 Amit K Bag
2018-06-05 14:05 ` Marcel Holtmann
2018-06-05 14:07 ` Marcel Holtmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1528265020-10202-1-git-send-email-amit.k.bag@intel.com \
--to=amit.k.bag@intel.com \
--cc=chethan.tumkur.narayan@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=ravishankar.srivatsa@intel.com \
--cc=sukumar.ghorai@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox