Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp702153ybb; Fri, 3 Apr 2020 10:13:49 -0700 (PDT) X-Google-Smtp-Source: APiQypLaMty6G6a7HsxNDw3RPjIQK+Sze2kYls6puWP1V7qeeIjs9Rm5YS/XIfxJTl9sFYdfREUP X-Received: by 2002:a4a:e144:: with SMTP id p4mr7453797oot.55.1585934029274; Fri, 03 Apr 2020 10:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585934029; cv=none; d=google.com; s=arc-20160816; b=Ak/VOcZvCeS0KFEKk2BSxXxd4+Vr8WwCRvBwxmp7lZYqfo+Udx1DRfdfyhZ26nMF82 6wTw4dtVU5Ym+96z7eXYfVgzaz//sBokB79Jeymjk+i/tsBmkiFHmJAxcDmgFBBXm1bL nSDtfGnPnCAgfHSB/QGM/NqgXEVz2sNWGlHittZUtS3pMnBEhEMqTQFKePYFJTICsBgK AtdbVdCyGUng27YSjaBTwMXEZAV+DZjDnURRys2UwT2AkBAQt+YX/y7k++9pZHrMFuj8 pJRV0PY06hEMGFnF4I0qsYSoASAjDy70rpZuSNobFzZ4TolrW5MUV5oO6tAaHMCNEqLO 8rgw== 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=HSpR6K/pYIpGbbixuFSHlTpRwTA7M8j5OghtVLTP4XM=; b=WUPP1Yf7gelU+XJhcmF1Pz3KKPIRyIAVterKJmPgAY6UXBb5FYEVRxLjEjiO6B4Lgu ZpVcwFXTfIXxVySXH45fW2rpwv0LuyNscxS5dVDWtnB1RH3cUWlveTD+ZZD69rZV65sZ DrxJIOWUXPSSWWrXb5xOHqKpZDE4lZH/Luoj+ZoX6f4t8AKUG5wOWJc56DrZ3afO6IGq 8qyZKFLVojNmIN3JXQlVl913wfSAcYlZcGGZMfPwRUc4wOfhm0xPKsq+PxaWPIJoNyMj pDjie6oUbxeCiMuYjPnCLwVw5JpP41m1jU0cWlqBfrNz8dOI3FaVB7XEJvfcoRcyZp1+ eVqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=joy7rjvc; 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 v130si3981484oib.115.2020.04.03.10.13.34; Fri, 03 Apr 2020 10:13:49 -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=joy7rjvc; 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 S2404111AbgDCRLj (ORCPT + 99 others); Fri, 3 Apr 2020 13:11:39 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34377 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404106AbgDCRLj (ORCPT ); Fri, 3 Apr 2020 13:11:39 -0400 Received: by mail-lj1-f196.google.com with SMTP id p10so7755204ljn.1 for ; Fri, 03 Apr 2020 10:11: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:content-transfer-encoding; bh=HSpR6K/pYIpGbbixuFSHlTpRwTA7M8j5OghtVLTP4XM=; b=joy7rjvcFTZShWHAL/8yG3IO7NZau0A61M3bp5ixE6qQ77xa2q353rcXiJmsD9imCH BT6fsKDfVulQBt0HmkiKbgkK9Q2ilYejs2H+MbnmESrwFHsyP4xPC+dRxunaWaBUXWvw GFy74PNvXTg6l0zu5BlK1lK8nVFq2rSdC3T25CF+FTrlX9yiHnt5EYbAHZ4XpEpt4qx0 BA3OhkYkUvNbVvstgWdSDaI4BEdhck0f8oe0uTiPnMbs/jKuaEg0hg3Qq1CFoQifUxry gH5J2rIRP8jSS/PSfpS3JWptLlGUQlXRHWenZQS0vW1z3M/nz+RqomrqjEFRM1NIgYfZ Kiqg== 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=HSpR6K/pYIpGbbixuFSHlTpRwTA7M8j5OghtVLTP4XM=; b=hJYrjv0rbyDc+YWV7W4/qyf1ZU8ju1dynJcBpEefjKbXNr2LyN2+HgAmdteqIaadqP 1gjjN+hgC2lY3TPjDN6v3CBcH6CJ5z2UgBGXhhcHCKtDwPcJBw4AAyA2dOILmkUFMl6w eAWokgvtDBFiZ4m5KHSeuzKMWOfOiNnQ0+xq4f2vYOBk4EkO8CrsmJsHuvCNIfIJKjVr NyaRRN3j0Ade2uLkeYKfmggzSBUc81CURBQJBWz/MlIRRRaFbTYgTlfn3TQ9cBnqMYz+ +W2Svr1OUe7LFgMmqI1TDyHbDFmcX1GhAXn1lzWGJM2h08sAGnU3JL26tJ0AkfHs11oG xrcg== X-Gm-Message-State: AGi0PuZQc2jyOnDkk/lv/Uj+d6JWYaMTT0NOGYvCOBmK8xGwdYKJYfOR ynjuiZGBm85B+9ZJ4Ld1c2BqSJG5iDozrlcSrvl46an/ X-Received: by 2002:a2e:9652:: with SMTP id z18mr1009476ljh.79.1585933895212; Fri, 03 Apr 2020 10:11:35 -0700 (PDT) MIME-Version: 1.0 References: <20200403133806.246918-1-alainm@chromium.org> In-Reply-To: From: Alain Michaud Date: Fri, 3 Apr 2020 13:11:23 -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 Hi Marcel, On Fri, Apr 3, 2020 at 1:05 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 conditio= n > >>> for controllers that have been well tested and reliable. > >>> > >>> /* Most controller will fail if we try to create new connections > >>> * 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/hci.= 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 necess= ary > >>> + * as many controllers have been seen has having trouble initia= ting > >>> + * 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 have = in our HCI core code. And then we see which controllers report errors. Tryi= ng to enable each controller individually is cumbersome. I rather later on = 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 out > > 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 be > > set. We will contribute to the cumbersome part of this. > > can we at least do something a bit smarter based on the LE Read Supported= 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 no= t 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. > > Regards > > Marcel >