linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Amitkumar Karwar <akarwar@marvell.com>
To: "marcel@holtmann.org" <marcel@holtmann.org>,
	"linux-bluetooth@vger.kernel.org"
	<linux-bluetooth@vger.kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Cathy Luo <cluo@marvell.com>,
	Nishant Sarmukadam <nishants@marvell.com>,
	Ganapathi Bhat <gbhat@marvell.com>
Subject: RE: [PATCH] btusb: fix zero BD address problem during stress test
Date: Wed, 16 Nov 2016 06:10:40 +0000	[thread overview]
Message-ID: <a23725dc02bb48deb00e5f9c8043bc3c@SC-EXCH04.marvell.com> (raw)
In-Reply-To: <1476795449-20592-1-git-send-email-akarwar@marvell.com>

Hi Marcel,

> From: Amitkumar Karwar [mailto:akarwar@marvell.com]
> Sent: Tuesday, October 18, 2016 6:27 PM
> To: linux-bluetooth@vger.kernel.org
> Cc: marcel@holtmann.org; linux-kernel@vger.kernel.org; Cathy Luo;
> Nishant Sarmukadam; Ganapathi Bhat; Amitkumar Karwar
> Subject: [PATCH] btusb: fix zero BD address problem during stress test
>=20
> From: Ganapathi Bhat <gbhat@marvell.com>
>=20
> We came across a corner case issue during reboot stress test in which
> hciconfig shows BD address is all zero. Reason is we don't get response
> for HCI RESET command during initialization
>=20
> The issue is tracked to a race where USB subsystem calls
> btusb_intr_complete() to deliver a data(NOOP frame) received on
> interrupt endpoint. HCI_RUNNING flag is not yet set by bluetooth
> subsystem. So we ignore that frame and return.
>=20
> As we missed to resubmit the buffer to interrupt endpoint in this case,
> we don't get response for BT reset command downloaded after this.
>=20
> This patch handles the corner case to resolve zero BD address problem.
>=20
> Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
> Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
> ---
>  drivers/bluetooth/btusb.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
>=20
> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
> index 811f9b9..b5596ac 100644
> --- a/drivers/bluetooth/btusb.c
> +++ b/drivers/bluetooth/btusb.c
> @@ -607,10 +607,7 @@ static void btusb_intr_complete(struct urb *urb)
>  	BT_DBG("%s urb %p status %d count %d", hdev->name, urb, urb-
> >status,
>  	       urb->actual_length);
>=20
> -	if (!test_bit(HCI_RUNNING, &hdev->flags))
> -		return;
> -
> -	if (urb->status =3D=3D 0) {
> +	if (urb->status =3D=3D 0 && test_bit(HCI_RUNNING, &hdev->flags)) {
>  		hdev->stat.byte_rx +=3D urb->actual_length;
>=20
>  		if (btusb_recv_intr(data, urb->transfer_buffer,

Did you get a chance to check this?
Please let us know if you have any review comments.

Regards,
Amitkumar

  reply	other threads:[~2016-11-16  6:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-18 12:57 [PATCH] btusb: fix zero BD address problem during stress test Amitkumar Karwar
2016-11-16  6:10 ` Amitkumar Karwar [this message]
2016-11-22 21:55   ` Marcel Holtmann
2016-11-23  7:50     ` Amitkumar Karwar
2016-11-23  8:16       ` Marcel Holtmann
2016-11-23  9:44         ` Amitkumar Karwar
2016-11-25 11:21         ` Amitkumar Karwar
2016-12-07  7:44         ` Amitkumar Karwar
2016-12-07  9: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=a23725dc02bb48deb00e5f9c8043bc3c@SC-EXCH04.marvell.com \
    --to=akarwar@marvell.com \
    --cc=cluo@marvell.com \
    --cc=gbhat@marvell.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=nishants@marvell.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;
as well as URLs for NNTP newsgroup(s).