Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Bluetooth: btusb: Avoid race condition during controller recovery
@ 2018-06-06  6:03 Amit K Bag
  2018-06-06  6:23 ` Bag, Amit K
  0 siblings, 1 reply; 7+ messages in thread
From: Amit K Bag @ 2018-06-06  6:03 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: sukumar.ghorai, chethan.tumkur.narayan, ravishankar.srivatsa,
	Amit K Bag

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] Bluetooth: btusb: Avoid race condition during controller recovery
@ 2018-06-06  6:22 Amit K Bag
  2018-06-06  9:57 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 7+ messages in thread
From: Amit K Bag @ 2018-06-06  6:22 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: sukumar.ghorai, chethan.tumkur.narayan, ravishankar.srivatsa,
	Amit K Bag

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..2303ac037240 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(5);
+
 	/* 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH] Bluetooth: btusb: Avoid race condition during controller recovery
@ 2018-05-31  9:50 Amit K Bag
  2018-06-05 14:05 ` Marcel Holtmann
  2018-06-05 14:07 ` Marcel Holtmann
  0 siblings, 2 replies; 7+ messages in thread
From: Amit K Bag @ 2018-05-31  9:50 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: sukumar.ghorai, chethan.tumkur.narayan, ravishankar.srivatsa

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.

Change-Id: Ifbc387d4377bc79081244d444d45ba6effc95f23
Signed-off-by: Chethan T N <chethan.tumkur.narayan@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..844b4145ff76 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -1741,6 +1741,15 @@ static int btusb_setup_intel(struct hci_dev *hdev)
 	int disable_patch, err;
 	struct intel_version ver;
 
+	/* 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);
+
 	BT_DBG("%s", hdev->name);
 
 	/* The controller has a bug with the first HCI command sent to it
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-06-06  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-06  6:03 [PATCH] Bluetooth: btusb: Avoid race condition during controller recovery Amit K Bag
2018-06-06  6:23 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox