Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp743136ybk; Wed, 13 May 2020 11:53:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCu20yGInIOXZ0ibj9n/7RFUAYpoyBBo7UF24xJpQCjyn81wUuqIoQy3CmoNAm5MRXQ3l1 X-Received: by 2002:a17:906:328c:: with SMTP id 12mr374612ejw.69.1589395993404; Wed, 13 May 2020 11:53:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589395993; cv=none; d=google.com; s=arc-20160816; b=EFoG7E4+F4s+cJhYu49E8cVgdLp+U+3LJ3BWwShpAdMh0Vkk9Sqx9OR98JXND3FQDf QUbJ3wGQ0Xjle68r/sfXdVSwctbTFpmBegECeMmiB82D19R1NVT45I6zcQR+LsBtxppk pPWdrgVABBVnb4H/jLIgecPeoxHaBQ3iWybECe4h5J3HitzVX3NHB9OkKb+uFT0JP7Fp Le/A1kuPPx/Q3xxmBWoD9gAe0d8zPZhe4y46SMDZY0FdzlBLpEnA7W2LSPK/kh2Zdy2a w0f6V2SJ2M6WT0X1T0CGIGcNMzlSrwZ+0oXALAEUpregApfBgS95tnoPdILyHDT/eoK2 MkHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=2iy5elEnJud6iWeyuwRZvnMMJ+uGwrkCKLP22Y5Ook0=; b=NUQB8+EbKXWd5oBR7S6rjv62eW3AG28FHjbyRaJ4JV3l8GF6xmbpBaAAKURYm85Hms CwbvaMioB3ayXqP7qPkQY4awoeLHj4+gZ1GtmNFOhVApS/W2hpOmgX+WsJHBm/3hONwm RgDA60fqQWPLuzzNB7BnHYwcWjI8Lg9gLmUgR4CSYwCx3aqFK1DoJfm+aadZaTJZ+n91 Nzh7rdSG+bQaTNrFYTgrTJXKHv3rHPiVlpILZHKLu0OsK+nAiTQ+cjqXHmDXnNEHxcaj wBLi7arp1Zoh9d0iwatk0OMMaXFNh8Bhjw7nLl5xnqT6J+9f0ojLuUM90sIYYkqylV/w cJYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=SsHyEs2l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l20si258482eds.589.2020.05.13.11.52.33; Wed, 13 May 2020 11:53:13 -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; dkim=pass header.i=@chromium.org header.s=google header.b=SsHyEs2l; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732881AbgEMSwG (ORCPT + 99 others); Wed, 13 May 2020 14:52:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1732218AbgEMSwG (ORCPT ); Wed, 13 May 2020 14:52:06 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08789C061A0C for ; Wed, 13 May 2020 11:52:06 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id l3so201371edq.13 for ; Wed, 13 May 2020 11:52:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2iy5elEnJud6iWeyuwRZvnMMJ+uGwrkCKLP22Y5Ook0=; b=SsHyEs2lLMu5vD+Ko1JJMJWGlefIHjpc9VaDQuAlUoHrNSV8VQOFVpaRJTpJUKD5UA felfB0LfqEQx+K0eMXXZX8qCwdYjAr/vJMqfedLTTJyTcKK6ZJu7/VKJo6NbjGdzOipZ oOq/WzSK5ambxuPNIhMcZ5pPeSWpG45MUhClM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2iy5elEnJud6iWeyuwRZvnMMJ+uGwrkCKLP22Y5Ook0=; b=b3BI4OlbnJp8nrdqtalNaajez9WNY/eM+LXA3iblO252e9g7vAvgl2J2Hu3NQ4BHbw iY7P51oFxo875VPLne79ZgmZ7Z+sH05PxaAxnVYrZo4dvzmRYGJVyAJIBuYXuq4lhK6o LsWbm1W00X+SqTjJHLzW3PYrLpU4BgPR9uDh3Uf5IpEVhcMBnnkwLIObPqoOpGzI3km4 uH+Jdi4KdIPmth1JImcY2aIMBBIQEniW5nteMO+p7IYA4OMG0y93h7hKRZ/ORcvzJGMn L9zbg0C4a736rqjuyCmu19r+d/Fess5qRX0lPV/LRvorTBHE5D9Se0f7FgER3t9uWodi aPBw== X-Gm-Message-State: AOAM530MgvQgHvxJveuFFHY4MrE7eskkV8fM806rPktMY20yyazOLIyl gDUCQS8R5A87X5XQvclHJqZsuOXD6d0= X-Received: by 2002:a50:fa87:: with SMTP id w7mr1061320edr.0.1589395924380; Wed, 13 May 2020 11:52:04 -0700 (PDT) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com. [209.85.221.44]) by smtp.gmail.com with ESMTPSA id g16sm12229edy.6.2020.05.13.11.52.03 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 May 2020 11:52:03 -0700 (PDT) Received: by mail-wr1-f44.google.com with SMTP id l17so774331wrr.4 for ; Wed, 13 May 2020 11:52:03 -0700 (PDT) X-Received: by 2002:adf:eacb:: with SMTP id o11mr767238wrn.253.1589395922826; Wed, 13 May 2020 11:52:02 -0700 (PDT) MIME-Version: 1.0 References: <89566A98-F0CE-4E70-A344-915E81FB0C14@holtmann.org> <20200506195503.5837-1-sonnysasaka@chromium.org> <933B812E-E805-4D2A-A758-D09235BB4030@holtmann.org> In-Reply-To: <933B812E-E805-4D2A-A758-D09235BB4030@holtmann.org> From: Sonny Sasaka Date: Wed, 13 May 2020 11:51:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] Bluetooth: Handle Inquiry Cancel error after Inquiry Complete To: Marcel Holtmann Cc: BlueZ Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Thanks, Marcel! On Wed, May 13, 2020 at 12:35 AM Marcel Holtmann wrote: > > 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 >