Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp753463ybb; Fri, 3 Apr 2020 11:10:23 -0700 (PDT) X-Google-Smtp-Source: APiQypIgG64G7og3Yf/YBwVif2Rxc0/IhjaHSGdv/HkNeK/Ut1rl1A1m0P/zvVinx56Sf+d4+jxN X-Received: by 2002:a05:6830:1f39:: with SMTP id e25mr7651205oth.135.1585937423401; Fri, 03 Apr 2020 11:10:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585937423; cv=none; d=google.com; s=arc-20160816; b=RgBNf0Ec7M4gJihY+fYDDEJTpMPwMaihSQdfWmdO7eCz5zmqTFhW3QAsyPXGCE2EmO HscE9E6Ti/S5koBAoUp9Yr8J03SsyUwCa2qytJKGGnOplVlWQaRHiaTCB32fQKallw5f VmbpCrN3EwWXBNx1B4Ao5dzWNaA9Q4hRW4eGHqMXXy4GT4EALr+Ax86DHWrIBEvN90/y KMETvBUDvvHeZri4e7hxOJ6JGDThpnhvHIFbaEhSggV69Up2U/p0t9XuL7XqgvmNbp7o binsv/0GmLcbpPnikYqmoGSGmuD6pGIYBOWYv1hG2N21gU9VdB8sreJDztPS+Bi+Y+g2 k1Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=EiqS1cpCoNakgz+V9OjVJVKBwDP9abWkyart37dFgaQ=; b=HYkTRDLkvvrlayeJ5/2L/yHQtP4F3AVyuBAm6ZOfD2AhBmO7BR27V1eX1Q3ZWlctSL zNWtQJEF3krkVYtNjqC1Ig3xrYH7fbsr3H27V2F7xATcj62GJ2cOU9MY9ZzfE3ffgFCD HHxD8hr7vmJMw9IizLYBJ9CZlh7hb9k5ZFvEwbchRIHwxKVsLEsJNXLhzcqyBPwjsZ5s pxTQKpSYZEsTKXNn+XxuJZUgK15b/eaI3p55JptUCm7vsV1ruIWYIseBijzbSeanmoaU ij4GNnlVxrDDzj/BM4AJWoSOPm5QDB/JiQ6/ucD4A2svVuDkAr9ls8YzJTMCpswQ64Ff u/Cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=W2nFSLdp; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id i4si1101277oiy.222.2020.04.03.11.10.10; Fri, 03 Apr 2020 11:10:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=W2nFSLdp; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 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 S2404096AbgDCSI6 (ORCPT + 99 others); Fri, 3 Apr 2020 14:08:58 -0400 Received: from mail-lj1-f193.google.com ([209.85.208.193]:40362 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728437AbgDCSI5 (ORCPT ); Fri, 3 Apr 2020 14:08:57 -0400 Received: by mail-lj1-f193.google.com with SMTP id 19so7871682ljj.7 for ; Fri, 03 Apr 2020 11:08:56 -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:content-transfer-encoding; bh=EiqS1cpCoNakgz+V9OjVJVKBwDP9abWkyart37dFgaQ=; b=W2nFSLdpN/UGXfhG51ZZvmsZxh5hp17QGBV0slNzgYQQ2anAa2dFU2/EnzER3GIAlj rH8m0i/NgtGsP6OzecJplZ9xxNMRlKkAVaopTmkgIj9FxLDvVSc9Rs5Z1W7gVqd4peK3 Q/uomW7JPGpm7TlQKnkhWS4Le3RvpJhHJ3o5J6eOG/aQw4RU4elX4w1zojwDFB90qpgc 88GGWYOidbIhzwzb/feqUFidm1dj2AI/J8jIne/Q3+KYR7th8HRSxzxY+BnDoJ+cRDvD 7rOTJk9zw7tVUzGKeMHXmZwVzRD2i1G/6ZTVTUwdM4QH/UHT84gkcekVKNRJgg12dZHh encg== 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:content-transfer-encoding; bh=EiqS1cpCoNakgz+V9OjVJVKBwDP9abWkyart37dFgaQ=; b=ALmYPYeGsUWM2bohFVRkaGlhG01siLlMa4RdnESbJ/BRrgqfaXd66YlfLATAmqil77 FE+a9rfeRMhMe3lOXZcbQewnqNg+5c42PCl09VIrt5DFx4Kkuv6ZSD5v5r85WOXklDVy 7W5fkXS3eoD4VpSGoUcYpeyW/mjwah/2dV/pQqB5QEfYOwNMjjwyzy0JECpUR1nN7p3Z Hj4SKhern2J4hXIJujFhOKWIIfQs4y4EJHwTZ2eRkwbvLDDZLIJHMkiQ05F5zaS5wC2N MTEHSTsEZxjUWTE9wQqBIB4WDLHi/XbqxkXwCEBOMAivO8HwSlzJf/SIpmY6Aty1hKbh lEaQ== X-Gm-Message-State: AGi0PuabjmGv2DjpPzULtWsKfaVmpwmhriWRBJVfY2r/5dKbIiKbGJoI cGffF5dd2ixy+KHn3tnd4ZtdDTfpKL8bBx9NQPfdhg== X-Received: by 2002:a2e:3a16:: with SMTP id h22mr5187353lja.81.1585937335056; Fri, 03 Apr 2020 11:08:55 -0700 (PDT) MIME-Version: 1.0 References: <20200403133806.246918-1-alainm@chromium.org> In-Reply-To: From: Alain Michaud Date: Fri, 3 Apr 2020 14:08:43 -0400 Message-ID: Subject: Re: [PATCH v1] bluetooth:Adding driver and quirk defs for multi-role LE To: Marcel Holtmann Cc: Alain Michaud , BlueZ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org On Fri, Apr 3, 2020 at 2:04 PM Marcel Holtmann wrote: > > Hi Alain, > > >>>>> This change adds the relevant driver and quirk to allow drivers to > >>>>> report that concurrent roles are well supported by the controller. > >>>>> > >>>>> This has historically been disabled as controllers did not reliably > >>>>> support this. In particular, this will be used to relax this condit= ion > >>>>> for controllers that have been well tested and reliable. > >>>>> > >>>>> /* Most controller will fail if we try to create new connection= s > >>>>> * while we have an existing one in slave role. > >>>>> */ > >>>>> if (hdev->conn_hash.le_num_slave > 0) > >>>>> return NULL; > >>>>> > >>>>> Signed-off-by: Alain Michaud > >>>>> --- > >>>>> > >>>>> drivers/bluetooth/btusb.c | 2 ++ > >>>>> include/net/bluetooth/hci.h | 8 ++++++++ > >>>>> 2 files changed, 10 insertions(+) > >>>>> > >>>>> diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > >>>>> index 3bdec42c9612..22e61a502d40 100644 > >>>>> --- a/drivers/bluetooth/btusb.c > >>>>> +++ b/drivers/bluetooth/btusb.c > >>>>> @@ -58,6 +58,8 @@ static struct usb_driver btusb_driver; > >>>>> #define BTUSB_CW6622 0x100000 > >>>>> #define BTUSB_MEDIATEK 0x200000 > >>>>> #define BTUSB_WIDEBAND_SPEECH 0x400000 > >>>>> +#define BTUSB_LE_CONCURRENT_ROLES_SUPPORTED \ > >>>>> + 0x800000 > >>>>> > >>>>> static const struct usb_device_id btusb_table[] =3D { > >>>>> /* Generic Bluetooth USB device */ > >>>>> diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hc= i.h > >>>>> index 5f60e135aeb6..b2c76cde7cd4 100644 > >>>>> --- a/include/net/bluetooth/hci.h > >>>>> +++ b/include/net/bluetooth/hci.h > >>>>> @@ -214,6 +214,14 @@ enum { > >>>>> * This quirk must be set before hci_register_dev is called. > >>>>> */ > >>>>> HCI_QUIRK_WIDEBAND_SPEECH_SUPPORTED, > >>>>> + > >>>>> + /* When this quirk is set, the controller has validated that > >>>>> + * concurrent LE roles are supported. This mechanism is nece= ssary > >>>>> + * as many controllers have been seen has having trouble init= iating > >>>>> + * a connectable advertisement after at least one connection = in > >>>>> + * central had already been established. > >>>>> + */ > >>>>> + HCI_QUIRK_LE_CONCURRENT_ROLES_SUPPORTED, > >>>>> }; > >>>> > >>>> lets do this the other way around. Lets remove the limitation we hav= e in our HCI core code. And then we see which controllers report errors. Tr= ying to enable each controller individually is cumbersome. I rather later o= n blacklist the one or two historic controllers that don=E2=80=99t support = it. > >>>> > >>> > >>> I agree it's cumbersome but given we don't have much data or existing > >>> tests around this, we don't have too many options. I strongly > >>> disagree with the approach of simply enabling it and seeing what > >>> breaks as scenarios using this functionality are expected to scale ou= t > >>> quickly, likely before we have time to fine all controller issues. > >>> > >>> My team is building test infrastructure to help collect data with > >>> this, we already know it's already problematic on a range of > >>> controllers and we have a good idea on which controllers which will b= e > >>> set. We will contribute to the cumbersome part of this. > >> > >> can we at least do something a bit smarter based on the LE Read Suppor= ted States command? > >> > >> If that command in general indicates that central and peripheral mode = is supported concurrently, we provide the support for advertising. If it is= not supported, we just don=E2=80=99t indicate support for advertising. > > In an ideal case I'd say yes, but that's also proven not to be a > > reliable metric. Unfortunately it doesn't seem to be covered by > > qualification program and as a result, it is largely not trustworthy. > > > >> > >> So I have a really bad experience with the move from Bluetooth 1.0b to= 1.1 and the HCI Reset on init. We got that wrong by whitelisting > > hardware and it came to bite us badly when the number of controllers > > increased that just got the spec right. > > I'm afraid I don't have a good exit plan for this at the moment. It > > may be something we either need to have some sort of extention for the > > hardware to report the appropriate support or better, fix the > > compliance gap so after a particular HCI version the bit field becomes > > trustworthy. > > why do we always end up in these rock vs hard-place situations ;) This is, IMO, a direct result of poor quality of the qualification program, especially around HCI contract validation. > > You might realize that I am really reluctant with whitelisting of behavio= r that should be default. Do you happen to have a bit more data that you ca= n share? We are still collecting the data. We can share the data around when we'd be ready to set the driver flag :) > > Or can we do at least something like QUIRK_VALID_LE_STATES and if that qu= irk is not set, then only central mode gets enabled. We can then provide a = debugfs setting for that quirk. I'm happy to change this into QUIK_VALID_LE_STATES, but I admit that testing some of the directed advertisement states are beyond the scope of what I'm comfortable signing up for. > > Regards > > Marcel >