Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422686AbcKPGKv convert rfc822-to-8bit (ORCPT ); Wed, 16 Nov 2016 01:10:51 -0500 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:55597 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932186AbcKPGKs (ORCPT ); Wed, 16 Nov 2016 01:10:48 -0500 From: Amitkumar Karwar To: "marcel@holtmann.org" , "linux-bluetooth@vger.kernel.org" CC: "linux-kernel@vger.kernel.org" , Cathy Luo , Nishant Sarmukadam , Ganapathi Bhat Subject: RE: [PATCH] btusb: fix zero BD address problem during stress test Thread-Topic: [PATCH] btusb: fix zero BD address problem during stress test Thread-Index: AQHSKT9FW6HZ2jYE4Ua/U9hcW6HDhKDbTRhg Date: Wed, 16 Nov 2016 06:10:40 +0000 Message-ID: References: <1476795449-20592-1-git-send-email-akarwar@marvell.com> In-Reply-To: <1476795449-20592-1-git-send-email-akarwar@marvell.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.93.176.43] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-11-15_08:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1609300000 definitions=main-1611160107 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1979 Lines: 54 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 > > From: Ganapathi Bhat > > 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 > Signed-off-by: Amitkumar Karwar > --- > 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. Regards, Amitkumar