Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp205567rdh; Tue, 22 Aug 2023 18:28:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG7t5PudQkzgXtk009Jnx7BsC2Rb00xyPqO3110/MY1zvVVnqxrmkjygI7JOS/9UM2HvkZt X-Received: by 2002:a05:6512:3184:b0:4fe:8c1d:9e7b with SMTP id i4-20020a056512318400b004fe8c1d9e7bmr10187409lfe.49.1692754137461; Tue, 22 Aug 2023 18:28:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692754137; cv=none; d=google.com; s=arc-20160816; b=i7yLncmS0gVS6RIQSLz6OeZFNM+zQOiVJBTpYPEjY3ouIQdMSyZlKLEvKWRQ+uboWb u84wuSuQ+/srkxIv3HiifY4PuEQTjfofMfZH1vgeTD6ROIHRz4wV8KJFo6Y31qPVReTh GKui4Bzf0qNIC+zOrneiJFu8YavsI3LB3ciWdf54jHmXJNDXEc0t5L7bA1KS5qQxgeGL pp+TdhNpSw4+1HH4O1GsTFUVByWqyMnHVSnWom6hgze5DpDHMnfCXBkZXINdG6eqDjje xjLkAP+ARdAnNwZik/wvVNlaXIVAOH87qc1luGLHkCqOF1RWrjMFyfm0DO8azyzRFXtR fsYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from:cc :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=jbVKX2Kil956/PlTCtyTU23O4rcpA+3YrrBnBlUXX3E=; fh=ZgP+Gu1b+Srf5kf68dOBn9ldxkFSp+1u6I/7usViwIU=; b=CAE6cI2I+UbNumQOXEE8W4hDmE5vS2nYhDlOfAym8vGmYryS+b+IrletoOkVAzogte XAXmfsi1v2Bp4MTXKhuk2lUJlEeutBkA370yLoL48Mjz3jNHaaUoQp+BGmB8SDMTNhWn 0vlbx9AzS687pKazj6fawjn7ranC4ySAQCiTOZDagUBh+RT9RPVxi5iIUTWGPDm0BCsO /ReZvyYvFahdrs7jjUbhqp+P2/sTHJYF6ALcsYv+4iEY6dLnNAQWz5XnfRv9s+lj8WeB U2yizvB4+IpVGjNQZ0X+qGXAebgMvQRbK8qlzOYCrSdmI+Gk01z0wzOZ6C9+MetMh6FQ sxQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d5-20020aa7d5c5000000b005259d57fb82si8624808eds.3.2023.08.22.18.28.34; Tue, 22 Aug 2023 18:28:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229734AbjHVUBb (ORCPT + 99 others); Tue, 22 Aug 2023 16:01:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229816AbjHVUB3 (ORCPT ); Tue, 22 Aug 2023 16:01:29 -0400 Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBBE0CE3 for ; Tue, 22 Aug 2023 13:01:26 -0700 (PDT) Received: from [192.168.0.185] (ip5f5ae84c.dynamic.kabel-deutschland.de [95.90.232.76]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 603D861E5FE01; Tue, 22 Aug 2023 22:01:17 +0200 (CEST) Message-ID: Date: Tue, 22 Aug 2023 22:01:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Bluetooth: HCI: Introduce HCI_QUIRK_BROKEN_LE_CODED Content-Language: en-US To: Luiz Augusto von Dentz References: <20230822191444.3741307-1-luiz.dentz@gmail.com> Cc: Bruno Pitrus , linux-bluetooth@vger.kernel.org From: Paul Menzel In-Reply-To: <20230822191444.3741307-1-luiz.dentz@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org [CC: +Bruno] Dear Luiz, Thank you for the patch. Am 22.08.23 um 21:14 schrieb Luiz Augusto von Dentz: > From: Luiz Augusto von Dentz > > This introduces HCI_QUIRK_BROKEN_LE_CODED is is used to indicate that …. It is used … > LE Coded PHY shall not be used, it is then set for some Intel models > that claims to support it but when used causes many problems. that claim to … > Link: https://github.com/bluez/bluez/issues/577 > Link: https://github.com/bluez/bluez/issues/582 > Link: https://lore.kernel.org/linux-bluetooth/CABBYNZKco-v7wkjHHexxQbgwwSz-S=GZ=dZKbRE1qxT1h4fFbQ@mail.gmail.com/T/# > Fixes: 288c90224eec ("Bluetooth: Enable all supported LE PHY by default") > Signed-off-by: Luiz Augusto von Dentz > --- > drivers/bluetooth/btintel.c | 2 ++ > include/net/bluetooth/hci.h | 10 ++++++++++ > include/net/bluetooth/hci_core.h | 4 +++- > 3 files changed, 15 insertions(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c > index 9b239ce96fa4..3ed60b2b0340 100644 > --- a/drivers/bluetooth/btintel.c > +++ b/drivers/bluetooth/btintel.c > @@ -2776,6 +2776,8 @@ static int btintel_setup_combined(struct hci_dev *hdev) > case 0x11: /* JfP */ > case 0x12: /* ThP */ > case 0x13: /* HrP */ > + set_bit(HCI_QUIRK_BROKEN_LE_CODED, &hdev->quirks); > + fallthrough; > case 0x14: /* CcP */ > set_bit(HCI_QUIRK_VALID_LE_STATES, &hdev->quirks); > fallthrough; > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h > index c58425d4c592..767921d7f5c1 100644 > --- a/include/net/bluetooth/hci.h > +++ b/include/net/bluetooth/hci.h > @@ -319,6 +319,16 @@ enum { > * This quirk must be set before hci_register_dev is called. > */ > HCI_QUIRK_USE_MSFT_EXT_ADDRESS_FILTER, > + > + /* > + * When this quirk is set, LE Coded PHY is shall not be used. This is s/is shall/shall/ > + * required for some Intel controllers which erroneously claim to > + * support it but it causes problems with extended scanning. > + * > + * This quirk can be set before hci_register_dev is called or > + * during the hdev->setup vendor callback. > + */ > + HCI_QUIRK_BROKEN_LE_CODED, > }; > > /* HCI device flags */ > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h > index 6e2988b11f99..e6359f7346f1 100644 > --- a/include/net/bluetooth/hci_core.h > +++ b/include/net/bluetooth/hci_core.h > @@ -1817,7 +1817,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn); > #define scan_2m(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_2M) || \ > ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_2M)) > > -#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED)) > +#define le_coded_capable(dev) (((dev)->le_features[1] & HCI_LE_PHY_CODED) && \ > + !test_bit(HCI_QUIRK_BROKEN_LE_CODED, \ > + &(dev)->quirks)) > > #define scan_coded(dev) (((dev)->le_tx_def_phys & HCI_LE_SET_PHY_CODED) || \ > ((dev)->le_rx_def_phys & HCI_LE_SET_PHY_CODED)) Will this be future proof, once firmware for the broken controllers are fixed? Kind regards, Paul