[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <077FBE27-DA84-4F11-BC69-F38184CE6B40@holtmann.org>
Date: Tue, 22 Nov 2016 22:55:10 +0100
From: Marcel Holtmann <marcel@...tmann.org>
To: Amitkumar Karwar <akarwar@...vell.com>
Cc: "linux-bluetooth@...r.kernel.org" <linux-bluetooth@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Cathy Luo <cluo@...vell.com>,
Nishant Sarmukadam <nishants@...vell.com>,
Ganapathi Bhat <gbhat@...vell.com>
Subject: Re: [PATCH] btusb: fix zero BD address problem during stress test
Hi Amitkumar,
>> From: Amitkumar Karwar [mailto:akarwar@...vell.com]
>> Sent: Tuesday, October 18, 2016 6:27 PM
>> To: linux-bluetooth@...r.kernel.org
>> Cc: marcel@...tmann.org; linux-kernel@...r.kernel.org; Cathy Luo;
>> Nishant Sarmukadam; Ganapathi Bhat; Amitkumar Karwar
>> Subject: [PATCH] btusb: fix zero BD address problem during stress test
>>
>> From: Ganapathi Bhat <gbhat@...vell.com>
>>
>> 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
>>
>> 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.
>>
>> 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.
>>
>> This patch handles the corner case to resolve zero BD address problem.
>>
>> Signed-off-by: Ganapathi Bhat <gbhat@...vell.com>
>> Signed-off-by: Amitkumar Karwar <akarwar@...vell.com>
>> ---
>> drivers/bluetooth/btusb.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> 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);
>>
>> - if (!test_bit(HCI_RUNNING, &hdev->flags))
>> - return;
>> -
>> - if (urb->status == 0) {
>> + if (urb->status == 0 && test_bit(HCI_RUNNING, &hdev->flags)) {
>> hdev->stat.byte_rx += urb->actual_length;
>>
>> 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.
can you explain how this is correct and show me the HCI traces for this.
Regards
Marcel
Powered by blists - more mailing lists