Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp524778pxb; Thu, 30 Sep 2021 11:01:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkJfZyTOyVwuCwpiDv5jwSU9p3sONApzFpMlfnF8JlS32DI+EX1f0bkiA6OxLJRFyrER7j X-Received: by 2002:a17:902:a38b:b0:13d:9c41:92ec with SMTP id x11-20020a170902a38b00b0013d9c4192ecmr5285849pla.39.1633024911623; Thu, 30 Sep 2021 11:01:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633024911; cv=none; d=google.com; s=arc-20160816; b=pw5S0l3qAQ/T0Dq7pvtBgQSQWQ5eWh7HDOOrqrylL+HAEKuFZYH2Rn3dI5uGbqXpUJ jluZMetke/jgRRQ7jBwVOwGLgU7Sf7xNM+mKAzvOBno2VpKGy2JDjzXQwidggC4TMAkE gQjDjTGmsWng5OsoekEneZv2aaHqGvtR4sVQ3K5i5oUXa6tBPnqKds/ojpBEbdHPNfDS PtTe39UPgREUojtmU/akmDCvOKwFM9ic7zJ3vMS7yvKvvfD/H8mytzMzY1j0ZIpmRGHc kOo8YgjSAJZ5EE2g/AM7UDmXVBjZKfby1qKUOc3ldf+EzOP4vsox2j8xWTiNDQLE7p49 dJDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=54e34L1mjRg/5yK3fIb2FNuF6X0tLxSygmXIlZCgCNY=; b=GTjP0Ek6GjDZ5C5IRJo1Bf+CJEWYwJ2/PrgAA3tFHGZeBuohmmq47DU3Go2O6o3h45 rWTSZttpGVq4FoGXvui1MQhxMk3v/bkYTxCDni1jb63NIGispl7SwwI7a4jquxtxH+4r 00qpJmOaS+ANvi3Qddyi+Wq0ZkpVQcrmEJ0HtqeHmLaOR27jg0MMVnVnQ64EiDTID6jr jdPc80V95siIr3QR9NMEhQyntMXTWMeWddWXVmXujpQF1y+b3FsF+x1Hd+LDWldrNhs+ KnCj42Dn/ArNBTITVV0tABAkfwCXxjN2dZA0JC4tWd3QWHR1OE4u1JDT/Wh0t/NQfiUO V4bA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b7si4394356pfr.374.2021.09.30.11.01.18; Thu, 30 Sep 2021 11:01:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352926AbhI3SAm convert rfc822-to-8bit (ORCPT + 99 others); Thu, 30 Sep 2021 14:00:42 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:47060 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352882AbhI3SAl (ORCPT ); Thu, 30 Sep 2021 14:00:41 -0400 Received: from smtpclient.apple (p5b3d2185.dip0.t-ipconnect.de [91.61.33.133]) by mail.holtmann.org (Postfix) with ESMTPSA id 12109CED17; Thu, 30 Sep 2021 19:58:55 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.13\)) Subject: Re: [PATCH] Bluetooth: add quirk disabling query LE tx power From: Marcel Holtmann In-Reply-To: <20210930141256.19943-1-redecorating@protonmail.com> Date: Thu, 30 Sep 2021 19:58:54 +0200 Cc: danielwinkler@google.com, Johan Hedberg , linux-bluetooth , regressions@lists.linux.dev, sonnysasaka@chromium.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <4970a940-211b-25d6-edab-21a815313954@protonmail.com> <20210930063106.19881-1-redecorating@protonmail.com> <20210930141256.19943-1-redecorating@protonmail.com> To: Orlando Chamberlain X-Mailer: Apple Mail (2.3654.120.0.1.13) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Orlando, > Querying LE tx power on startup broke Bluetooth on some Broadcom chips > in Apple computers (at least MacBookPro16,1 and iMac20,1). Added a quirk > disabling this query for affected devices, based off their common chip > id 150. Affected devices will not be able to query LE tx power, however > they were not doing this before. > > Fixes: 7c395ea521e6m ("Bluetooth: Query LE tx power on startup") > Signed-off-by: Orlando Chamberlain > --- > drivers/bluetooth/btbcm.c | 4 ++++ > include/net/bluetooth/hci.h | 8 ++++++++ > net/bluetooth/hci_core.c | 3 ++- > 3 files changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c > index e4182acee488..4ecc50d93107 100644 > --- a/drivers/bluetooth/btbcm.c > +++ b/drivers/bluetooth/btbcm.c > @@ -353,6 +353,10 @@ static int btbcm_read_info(struct hci_dev *hdev) > return PTR_ERR(skb); > > bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]); > + > + if (skb->data[1] == 150) > + set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks); > + > kfree_skb(skb); > > /* Read Controller Features */ > diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h > index b80415011dcd..5e0dd0c39ade 100644 > --- a/include/net/bluetooth/hci.h > +++ b/include/net/bluetooth/hci.h > @@ -246,6 +246,14 @@ enum { > * HCI after resume. > */ > HCI_QUIRK_NO_SUSPEND_NOTIFIER, > + > + /* > + * When this quirk is set, LE tx power is not queried on startup. > + * > + * This quirk can be set before hci_register_dev is called or > + * during the hdev->setup vendor callback. > + */ > + HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, > }; > > /* HCI device flags */ > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c > index 8a47a3017d61..16e39739c662 100644 > --- a/net/bluetooth/hci_core.c > +++ b/net/bluetooth/hci_core.c > @@ -742,7 +742,8 @@ static int hci_init3_req(struct hci_request *req, unsigned long opt) > hci_req_add(req, HCI_OP_LE_READ_ADV_TX_POWER, 0, NULL); > } > > - if (hdev->commands[38] & 0x80) { > + if (hdev->commands[38] & 0x80 && > + !test_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks)) { > /* Read LE Min/Max Tx Power*/ > hci_req_add(req, HCI_OP_LE_READ_TRANSMIT_POWER, > 0, NULL); so I really need the btmon traces from the device init (so unload and reload the module) and we need to see what commands are supported and what commands are failing. Since you say this is on a MacBook, I assume this is an UART based Broadcom chip. Sometimes Broadcom has been really flaky with their actually implemented commands. However in some cases firmware updates do fix this. So any chance you can boot OS X and check that the latest firmware is loaded. Regards Marcel