Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp317637ybk; Wed, 13 May 2020 00:38:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVpCuC0t9TjloogYeTrIR3aTiwpHDV7lI/JpiZF2LQJfnB1KQlEkQ6/9mTjCw3t+L9cHo2 X-Received: by 2002:a50:e04c:: with SMTP id g12mr6055056edl.74.1589355488679; Wed, 13 May 2020 00:38:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589355488; cv=none; d=google.com; s=arc-20160816; b=ziAPJ5KSyKXmUjOAgtxxgpUcd8R9O2o0BBweYA7uU6JlnYgmgQHw2/69avSHbKfV+R qx2Iuc0WyQgo0BZsuIp2LgDAJKAcEyFPKeETmdg1JPKUT3YOhfifcwD+DLT16YKM+o8j 11fNvJ8Z9Q98nN19y5tYzjWlL9wg3A+Csb7kzK6Vsp9lELn7IglukxPepeWojqyZxTUU 8vvaGRYnlA1xHQ4VJQJqBpZAIWccB+JbiN9ecGYJlFkH/F+4sDjUXcmCBuPl/pAWWSxX ZtHghsdvYK+fjBa5lVufXBpZ0UzRxrLAEHRYbAv4jUpZayY+lbyfTiJ+8aF6BBW8Xq14 Gdlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=Qqxej+Bo/KLKrWdvKE9bnNxaqGxZamUny5DFRnYZXEg=; b=dR9NNW3MV2hIWmoKYZY6A+QlUBIwxbkWRn4wphBj2kiCEhHjyQISOct20fbr+R+wd9 kA/JymD6Zk1OotQUW1skYmW2KoiPAxwTg4oV7NZLV33n/BKdAnyZOjddmGZIRE65JKDl oGO+hQ6rXIAWP00Ri1Cx4l4HMzPyP8zkQhr0LvMcno4/DTSNCbo129zmQHY5ZnXnP6Vc VcH2cZlQTpgRmNYCNHDu7fslFJ6X4bzOzZs0+fIIRd1AFjpNHDAxM/mLvxxnYW4WdA3r 6BWoVf0gbdmFBe4slQhazY+HmhQGXLlRXh6EoGm1Iat6ongQjIDymQCdh2w01BixmWG3 8hRQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x24si6287670edl.563.2020.05.13.00.37.42; Wed, 13 May 2020 00:38:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728988AbgEMHfY (ORCPT + 99 others); Wed, 13 May 2020 03:35:24 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:57871 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726138AbgEMHfY (ORCPT ); Wed, 13 May 2020 03:35:24 -0400 Received: from [192.168.1.91] (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 19A53CED09; Wed, 13 May 2020 09:45:06 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH] Bluetooth: Handle Inquiry Cancel error after Inquiry Complete From: Marcel Holtmann In-Reply-To: <20200506195503.5837-1-sonnysasaka@chromium.org> Date: Wed, 13 May 2020 09:34:53 +0200 Cc: linux-bluetooth@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <933B812E-E805-4D2A-A758-D09235BB4030@holtmann.org> References: <89566A98-F0CE-4E70-A344-915E81FB0C14@holtmann.org> <20200506195503.5837-1-sonnysasaka@chromium.org> To: Sonny Sasaka X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Sonny, > After sending Inquiry Cancel command to the controller, it is possible > that Inquiry Complete event comes before Inquiry Cancel command complete > event. In this case the Inquiry Cancel command will have status of > Command Disallowed since there is no Inquiry session to be cancelled. > This case should not be treated as error, otherwise we can reach an > inconsistent state. > > Example of a btmon trace when this happened: > > < HCI Command: Inquiry Cancel (0x01|0x0002) plen 0 >> HCI Event: Inquiry Complete (0x01) plen 1 > Status: Success (0x00) >> HCI Event: Command Complete (0x0e) plen 4 > Inquiry Cancel (0x01|0x0002) ncmd 1 > Status: Command Disallowed (0x0c) > --- > net/bluetooth/hci_event.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel