Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp695506ybb; Fri, 3 Apr 2020 10:06:24 -0700 (PDT) X-Google-Smtp-Source: APiQypKEKTovN8PugxUJ1dT5o6P9yRxOwgp27lj+AvuT5GrPdwqhjtsvM1KGFKqD2k2FlnNbiLH4 X-Received: by 2002:aca:b382:: with SMTP id c124mr3647688oif.64.1585933583960; Fri, 03 Apr 2020 10:06:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585933583; cv=none; d=google.com; s=arc-20160816; b=Dhy2FNs+U0CjOM7UQIt30kaIulCRhrKOhhUYtje9LIyZvh8Jo9WFnGAxb1MtSMvTpo 0qotBvRz4D2hCF+gSmK8rUniLrav//4smxOIbNLM4yPr2I/rgL/pE1F/vsPblyBz7yFj jUds+uKjnzMCIQcI0KHIigUTXzyZqh819X7A1Bmra2uymosJlBRh58p8LskiFNU3xFY9 QfTaYccolw1XepfnZ1s3UfED4goy8MUbWe+zbkwW6zhC5m3nnw5glA+DMCsEbR1yqWEs cGUUa2/HWvXgpMrFPPAwT1ZV7e9OyYholyEP/7UY09uyPsKCU8Fo+POkNNl1pRexMEbN ibbw== 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=2dtFHqyzKE90NGmD3bL/NXY8yZv2TgC5fq7E6e6Z+Ao=; b=PnygNBlLOD7EzgzxuauLhcj96/wMT/qnnyW3JGC/NAeTHe2l7NCnPc/ZbTCbZByHKw Uq80AGIcQgjP/pbbINrvHXPtrdajF2gBjdt1GiHgOyRlstcrcdedmsHIE5ByErUc7EVv TFCILxj0lrQkPgkharYXfxH3AmUA859M3BiqNi+bd1jhjao+eULs85XcDmhJpk9NNLBr bVCTVzs25i8c9ai0W6JPJAx9Ud+DEZG2I3yd+H09tJ9DZBFb7cmWokkulLKxCGIdg5Es 0iyh6V/3aYV/VGKH5eROpC/CIXaErwc/DMkl4qpk2ZhuJnidetAIYpnYxLAzZwxW/bNt 4dBA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m10si673400otc.28.2020.04.03.10.06.10; Fri, 03 Apr 2020 10:06: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728276AbgDCRF1 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 3 Apr 2020 13:05:27 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:39705 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728188AbgDCRF1 (ORCPT ); Fri, 3 Apr 2020 13:05:27 -0400 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 41F69CED02; Fri, 3 Apr 2020 19:14:59 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH v1] bluetooth:Adding driver and quirk defs for multi-role LE From: Marcel Holtmann In-Reply-To: Date: Fri, 3 Apr 2020 19:05:25 +0200 Cc: Alain Michaud , BlueZ Content-Transfer-Encoding: 8BIT Message-Id: References: <20200403133806.246918-1-alainm@chromium.org> To: Alain Michaud 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 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 condition >>> 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[] = { >>> /* 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 necessary >>> + * as many controllers have been seen has having trouble initiating >>> + * 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. Trying to enable each controller individually is cumbersome. I rather later on blacklist the one or two historic controllers that don’t 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 not supported, we just don’t indicate support for advertising. 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. Regards Marcel