Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp382920pxj; Fri, 7 May 2021 10:38:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZGE3lK/y2xIco/9cO2N8J8dBbX2WHzZiaTJqsgSnTpvCcFEbZa+t0YoL/3vg6tS4MPNTt X-Received: by 2002:a05:6402:2050:: with SMTP id bc16mr12676821edb.179.1620409109413; Fri, 07 May 2021 10:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620409109; cv=none; d=google.com; s=arc-20160816; b=oVExyw8a0KBLdmyKgFEd9f3thvB3zkO8ZBxH/hRDonAcTcDPdehDx9Vzit+88fRl/8 wK0m6rkmiv2pn5cUvHhALmjeVqwap12jxcEl8+8ogDJeS1goLpUnBNUMWXX0fuN4/kLK JamCLJjcu8RC7sK7h28uTGNIzmr52wj7+qZZJpRX8wEGm8QD6kOvVstu8Y96Ci79LwiT sQFs5Ixg+pEF3fuwrEkGyPdlO4cgv4nN/a2gaKGSAevXukp33X1AjINkXvwhAKhIx7XF mHws1axAxfAxgKDwxJCSFaJHxFE2I8ATC3sy7WCHN0uCqxVuY/fTwS4enwMYGsdnhx1U pfTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rehBiwuqoeTrE/V+jkpp/fz3FhsW+pn7PjItMnFizDE=; b=JY88bGRZQ+pnpa7+zlrHcl4lV9yr80aziw+IqHnCmB8JvS2p0izAMrJv1IKEKda5mk sz8ThKwbZP60mSu12DcGhQA4DuOf88sr1ej2fcq5ou3YBkzzLt/3nJcGWoEHZcTpzQdY Fs7xBntjDLkFnuidsVg0ZNKsWX3ZVxcz82dFPkHGm8UsL9sD7WFAj+2D9uaZ0ivwho2H VAgu9djIalMbh5+WjQA0SaFIVICiL2TAngV3yksMt/3EGHdhz/lJes0KFiXC7laeSBTw 1SnX0NHUvZqj89LSr6cBuh0sQteeZ+wHRJQoq4+yrNnt+l1gJJ0vLIM38h71iqcJiJ1M GiJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=YZ1ijAGq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ay26si5443157ejb.227.2021.05.07.10.38.04; Fri, 07 May 2021 10:38:29 -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=@google.com header.s=20161025 header.b=YZ1ijAGq; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229849AbhEGQph (ORCPT + 99 others); Fri, 7 May 2021 12:45:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236871AbhEGQph (ORCPT ); Fri, 7 May 2021 12:45:37 -0400 Received: from mail-qk1-x72d.google.com (mail-qk1-x72d.google.com [IPv6:2607:f8b0:4864:20::72d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73E7C061574 for ; Fri, 7 May 2021 09:44:36 -0700 (PDT) Received: by mail-qk1-x72d.google.com with SMTP id q10so4909153qkc.5 for ; Fri, 07 May 2021 09:44:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rehBiwuqoeTrE/V+jkpp/fz3FhsW+pn7PjItMnFizDE=; b=YZ1ijAGqg3pvyAvGOEMdNWMjbmrf7tkj8gFJMjGHS2/ze1XbXlUJllHFzfSqfoaPxz +ipiHHv0jcFNf1jWHjJpP+8pHB62jW8zPfh1AWvMpbUB4+Zmod3H1UcVkeEtKZ8q0LLU JAGE6DlJ5SjFV4kNSJ4xtSn+HGd7H8GeuKfWA9dSbfTPgIBm7FdHbegX16BhNl7vGyXK 59GvRdspqyFBQY69g2gWchkR+3jRrG9rEZtjcRU0KdvpiJztNBeMKXEX4Vc0i9aiOGxK +Qs9f9PRvDjJmkLM5NiK+M3pozmbMwLmdbtsRSMzffsPuqOqGK27VERW0l0DDJ8odTEC 2Tzw== 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=rehBiwuqoeTrE/V+jkpp/fz3FhsW+pn7PjItMnFizDE=; b=qh6F+KxORjDasN3g3yJir4/+0cQjMLusV5Rf4ucc9F+3cZpb3M0AD6eyHaAVIDv9in 6m9WqoFN0apfQeh/TSFymnxaTW87IF5Zjc1rPidevq/ExXVHkvrlaxj2dzBkkqMMsSP0 zDu5FKLDpYFgvbm+Q47avmT44rl16niBABua0QUXjWRVCXQERS3L50et2M+pm2/IEmOJ aSz47tl4wCydBw5EH62cHZyY8Tah54AvbAfh0k9cFlSSpIbKz5M62mptQMyrFC7CgMl/ j6gm/+05v3rlLgVGMn1dhL7HJcZtrdD9aaLiTymzszX5R/QkkR4YICkRqBdqSYaXLotl cLPg== X-Gm-Message-State: AOAM533ghD4iLTtlqasel5GJ2JRB63dMFOi+zJfeX0igTwE4H/ib48v8 NM0EEhbI0UuzOa9Xk9iZ9Yx4k928fqPnmKrmGBBivA== X-Received: by 2002:a05:620a:208a:: with SMTP id e10mr6166186qka.112.1620405875829; Fri, 07 May 2021 09:44:35 -0700 (PDT) MIME-Version: 1.0 References: <20210429111523.Bluez.v1.1.Ic00ed950add081b346d6c8ced590bb7b2eb6e9f7@changeid> <44A0B714-12C5-4A43-9829-CAE3D8BF374B@holtmann.org> In-Reply-To: <44A0B714-12C5-4A43-9829-CAE3D8BF374B@holtmann.org> From: Yu Liu Date: Fri, 7 May 2021 09:43:59 -0700 Message-ID: Subject: Re: [Bluez PATCH v1] doc/mgmt-api - Add a new error code for HCI status 0x3e To: Marcel Holtmann Cc: Bluetooth Kernel Mailing List , Luiz Augusto von Dentz , ChromeOS Bluetooth Upstreaming , Abhishek Pandit-Subedi Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marcel, We have a couple of bugs where the controller failed on the Read Remote Feature command after initial connection with the 0x3E error, guy.damary@intel made some suggestions after root caused the issues, you can see his detailed suggestions here: https://buganizer.corp.google.com/issues/174806913#comment98. To summarize: he suggests us to retry up to 3 times if 0x3E is encountered during LE pairing. Regarding this change: I see MGMT_STATUS_CONNECT_FAILED could be returned under 4 different scenarios, 3 in the mgmt_status_table table and 1 in pair_device as a fallback error to cover all the other cases, so I decided to introduce a new error code to make sure we don't retry in the cases where we shouldn't. If you think this cae be avoided by checking other flags at the same time, I can then drop the change from the kernel and only change the user space. Thanks On Fri, May 7, 2021 at 1:19 AM Marcel Holtmann wrote: > > Hi Yu, > > > We want to retry the pairing when HCI status 0x3e (Connection failed to > > established/Synchronization timeout) is returned from the controller. > > This is to add a new MGMT error code so that we can catch this 0x3e > > failure and issue a retry in the user space. > > > > Reviewed-by: Abhishek Pandit-Subedi > > --- > > > > Changes in v1: > > - Initial change > > > > doc/mgmt-api.txt | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/doc/mgmt-api.txt b/doc/mgmt-api.txt > > index 5355fedb0..f7cbf7ab2 100644 > > --- a/doc/mgmt-api.txt > > +++ b/doc/mgmt-api.txt > > @@ -200,6 +200,7 @@ and Command Complete events: > > 0x12 RFKilled > > 0x13 Already Paired > > 0x14 Permission Denied > > +0x15 Connection Not Established > > > > As a general rule all commands generate the events as specified below, > > however invalid lengths or unknown commands will always generate a > > @@ -1112,6 +1113,7 @@ Pair Device Command > > Not Powered > > Invalid Index > > Already Paired > > + Connection Not Established > > I really dislike the naming. And even more so, I request the motive here. > > So looking at our code, we have 3 cases where we use the previous status: > > MGMT_STATUS_CONNECT_FAILED, /* Page Timeout */ > MGMT_STATUS_CONNECT_FAILED, /* Connection Establishment Failed */ > MGMT_STATUS_CONNECT_FAILED, /* MAC Connection Failed */ > > And they do map to the 3 available transports, either via BR/EDR or LE or AMP. That means if you call Pair Device you already know well today when it fails to establish the link and can retry it. > > My question, what are you trying to fix here. > > Regards > > Marcel >