Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3847443rdb; Thu, 28 Dec 2023 01:48:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsW6NRguLkLVebeP2eYwLAbzHlrCURPYM3sjnI+91fmMyL2m3U3Xiv9oKeBactquCbiBDq X-Received: by 2002:a17:906:218:b0:a27:76d4:6394 with SMTP id 24-20020a170906021800b00a2776d46394mr61267ejd.82.1703756883643; Thu, 28 Dec 2023 01:48:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703756883; cv=none; d=google.com; s=arc-20160816; b=jK4TVPAKBE2K25jbSePefKV/1Mg/8ymP3ecczDe7GvjmujebLcJR5xT0AZ4X6JcqOU dUtef7CkMh++ph3eM5IeCjLX8YmnWe+XSZriJ7aiZ74RwCHG+9yZPssdqjt6Yrrcc+dI Odry0b70R+prK6jLUeSsMSXapIr6hp7NL62kIJO26wlhRis320OgHP6gpClwnezW4gA/ QBNEAuSjVrpkLtLSpsVd5G8uQqYIJ6P+tJMIKMCh/BX+Zt4NGZnbDPUuv7j7zpgoOqtr zZrDWyTAkTd5mQvDEzTdL7Nluv4rrIO2xawT4WpO76Pwdqh/wxXo+tUYwH+cjGlAg4RP t7+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=to:cc:date:message-id:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:from:content-transfer-encoding :feedback-id:dkim-signature:dkim-signature; bh=InsY1OZSAZnSuRG5SxIiyCXnOFO2J93RUtltbwwZBKQ=; fh=sMttDp0SjunhJsMlNPkhr/QSPmpuMAVmQyGn6bp/hag=; b=czWkKB3pYfWGmUF+uZJzImu1V+ecgJP5irwIcN0dIEQgjlus7OeiL0d0F9C4zmFmtS j02+W4DImbTKYK0AUfFAXgghkOK04tlkfoj5z34thkTNNZgStkHIsPssr86puYscnB5f j+kR8repxXegAnO+Omxe2/5mjYYcdAclFWVRbav5Zai4KrsHa5ZByhR4x7Nfxu8T/x+/ nGPCLJoJtv2tw/sZLQsF0Qz4qiAPzQXbGQdmKkGMUpOyWgnAAG+XsWwt9QjjZfox+uyk WNMbVGJdbEQvquO5N4r3LC6m/htDfOAGtz4ec+pZzBwOeely/KZiqS1JMtFhTAWSfDLt ZZ1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=JEODCXGf; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Q+kQXi9i; spf=pass (google.com: domain of linux-bluetooth+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l23-20020a170907915700b00a239a5662eesi6886631ejs.367.2023.12.28.01.48.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 01:48:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm2 header.b=JEODCXGf; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=Q+kQXi9i; spf=pass (google.com: domain of linux-bluetooth+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3AE0B1F232C0 for ; Thu, 28 Dec 2023 09:48:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5200E6D3F; Thu, 28 Dec 2023 09:47:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=svenpeter.dev header.i=@svenpeter.dev header.b="JEODCXGf"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Q+kQXi9i" X-Original-To: linux-bluetooth@vger.kernel.org Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E8428C8DB; Thu, 28 Dec 2023 09:47:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=svenpeter.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=svenpeter.dev Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 172185C0085; Thu, 28 Dec 2023 04:47:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 28 Dec 2023 04:47:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm2; t=1703756830; x= 1703843230; bh=InsY1OZSAZnSuRG5SxIiyCXnOFO2J93RUtltbwwZBKQ=; b=J EODCXGfaWH/RBkHZg+MRUqF14mEFLiGkf14+E4Owwcr9gcZY/MDgMh0K4ZwLuVZO Vf6vvjrZDlISOgRZ9g1bd/X7f5YPiXR6UV/urfeRAzEliopi0TDWjUA+LCmxxNyj s3FCRG7wh7i93JKXGmYeJNUpK8erAuFOrforPnOxfZG9XzlTtMnRKkzR/CSeWvDr cdgmZ+vgApPg2fd2oXITlzVYbsS17tiOZWHcbfNVpU/atoRuHFdpXrCYvwCermAB ruA4bt40t6hPIBK5FLSpEUA+ysgnWG5/zxXkLIWO6ufF711mi1TMHv4AhmFjilBD Dn5WNeP0RU5qrbWijm+IA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:message-id:mime-version:reply-to:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1703756830; x=1703843230; bh=InsY1OZSAZnSu RG5SxIiyCXnOFO2J93RUtltbwwZBKQ=; b=Q+kQXi9iTox/LHxCTiogbP52BxlSn AuAqbM6oHAU6oRIxONdnB24SftCQulLg30NCmtTkXPFnJ5soDBYFWlFTlRcEuGaN AbKa+oCNavbBUPlRSWuQAr/LRj+heuP+CqMjk7KZtBxdfJdlOAjxKydk8/+fn6Ul DO9HzATDcAT6LS41wtASf7UX9TE4yQxDdnUOaOxhN2DLji7433rmUM9hi9FRCZNr MyuzfeWJrts/IstFwR6gkCfeWawTRKbXQ/71fXn+OqFxQW93o89DRNOQRzyMrSfw a/sxh1sPy5UySogDK4w0MJoYP8Bvi/3Mxz+6/1c0kHNjTW4d3j+aXPFjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdefuddgtdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurheptgfghfgguffkffevvffosehtqhhmtdhhtdejnecuhfhrohhmpefuvhgvnhcu rfgvthgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrthhtvg hrnhepleehkeehudelvefhteeltdelhfekiefgkefguddvheekjeehuedvtdeikefhgeel necuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 Dec 2023 04:47:09 -0500 (EST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Sven Peter Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 (1.0) Subject: Re: [PATCH v3] Bluetooth: Fix Bluetooth for BCM4377 on T2 Intel MacBooks Message-Id: Date: Thu, 28 Dec 2023 10:46:57 +0100 Cc: Paul Menzel , Felix Zhang , linux-bluetooth@vger.kernel.org, stable@vger.kernel.org, Johan Hovold , Hector Martin , Bagas Sanjaya , Alyssa Rosenzweig , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Orlando Chamberlain , kekrby@gmail.com, admin@kodeit.net, Janne Grunau , Aditya Garg , asahi@lists.linux.dev, linux-kernel@vger.kernel.org To: Johan Hovold X-Mailer: iPhone Mail (21B101) =EF=BB=BFSending this again because Apple mail decided to default to HTML mails since the last update apparently *sigh* =EF=BB=BFHi, > On Dec 27, 2023, at 11:30, Johan Hovold wrote: >=20 > On Mon, Dec 25, 2023 at 09:26:05PM +0100, Paul Menzel wrote: >=20 >> Thank you very much for the patch. I am adding Johan to Cc field. >=20 > Thanks for the report. Guess I could use a break from the proverbial > eggnog. >=20 >> Am 25.12.23 um 21:01 schrieb Felix Zhang: >>> Starting v6.5, Bluetooth does not work at all on my T2 MacBookAir9,1 >>> with the BCM4377 chip. When I boot up the computer, go into >> Somehow a blank line snug in above. >>> bluetoothctl, and then try to run commands like scan on, show, list, >>> it returns "No default controller available." I have tried reloading >>> the >> It=E2=80=99d be great if you reflowed for 75 characters per line (also be= low). >>> kernel module, in which the log outputs "{Added,Removed} hci0 >>> (unconfigured)." With this patch, I am able to use Bluetooth as >>> normal >>> without any errors regarding hci0 being unconfigured. However, an >>> issue is still present where sometimes hci_bcm4377 will have to be >>> reloaded in order to get bluetooth to work. I believe this was still >>> present before the previously mentioned commit. >>> Due to the bit HCI_QUIRK_USE_BDADDR_PROPERTY being always set in >>> drivers/bluetooth/hci_bcm4377.c (line 2371), the chip would be left >>> unconfigured on kernels compiled after commit 6945795bc81a >>> ("Bluetooth: >>> fix use-bdaddr-property quirk") due to a change in its logic. On the >>> M1 Macs, the device would be configured in the devicetree. However, >>> that is not the case on T2 Macs. Because the bluetooth adapter is >>> left >>> unconfigured, it is not usable in the operating system. In order to >>> circumvent this issue, a flag is added to prevent the bit from being >>> set on the BCM4377, while setting it on the other devices. >=20 > The commit you tracked this down to restored the original semantics for > HCI_QUIRK_USE_BDADDR_PROPERTY, which means that it should only be set > for devices with an invalid address. >=20 > The Broadcom BCM4377 driver has so far been setting this flag > unconditionally which now potentially results in also valid addresses > being marked as invalid. >=20 > I've just sent a patch that makes sure to only mark invalid addresses as > invalid: >=20 > https://lore.kernel.org/lkml/20231227101003.10534-1-johan+linaro@kernel.or= g/ >=20 > Note however that the flag still needs to be set in case your device > lacks storage for a unique device address so you cannot simply drop it > for some device classes as you do below (unless you are certain that > these devices will always have a valid address). We do know that though. BCM4377 is present on Apple=E2=80=99s x86 Macs and always has internal stora= ge for the address. If the board comes up without an address there=E2=80=99s no= thing much we can do because the address isn=E2=80=99t provided by ACPI or anythin= g else and setting the invalid address quirk for that situation seems appropri= ate. BCM4378/4387 is present on Apple=E2=80=99s ARM Macs and never has internal s= torage. The address is always provided by our bootloader in the device tree. These should always unconditionally set HCI_QUIRK_USE_BDADDR_PROPERTY just like this patch does. Best, Sven=