From patchwork Mon Sep 19 16:48:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter X-Patchwork-Id: 12980746 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EAE61ECAAA1 for ; Mon, 19 Sep 2022 16:51:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F+DJFgvVJFXWJkgmAky/L3SbNVUtomBZMr7zItWDQIY=; b=jtn1s4N4sk7vr9 nEBPuFga5Leqw5Nw4CB9tAOr4zNiKxtbEHWyELYZ/JKqDTp4FOqLhduYE60wvWcggYUa0zO5PTjk3 7mQ/7R6AvwBEnhJg+e5ak6B74XfoH7WpEXWOAxrhurzKEQhI3ryoES4NiNYV5Dhaw/Cbwf8mL1sLP xaN4u84BFE9yxH2buIWMRqg5yVEKwKY4p29EXpGJnNEDv13Zn4bUz3PLHqTxq1l8WRrlQspyKzUm8 tY9ETCiKoz5UsRCVDgtsCHKmU+tmMRgEdWqt+2b/MsqObN5u72nxf1RvEjYYxdolwZWgnPm8/taH/ UzblPUnWUJYlwDUl8g2A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaJyr-00D04q-Of; Mon, 19 Sep 2022 16:50:49 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaJxr-00CzXc-6e for linux-arm-kernel@lists.infradead.org; Mon, 19 Sep 2022 16:49:48 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 96BE65C03E7; Mon, 19 Sep 2022 12:49:46 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 19 Sep 2022 12:49:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-transfer-encoding:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1663606186; x= 1663692586; bh=K5EvS7vP8L6M31QM3zmyMgApIJPVaOglFG1TvndhbBw=; b=m 6kIL4i0AX7Y+QbPyrfAQbkpnc710+D3qXsWg9AoWYBNK5BlE9aJvSJHsDuvGraXU xaLcRHeaCeAOT0uh/j0kuAWFrQL9ZDYg3hzBLxmae1QJipFY7QmjN25moUdes5j4 FupjAXmJ6LpRjh6fA+9kB2as22LmBBcjyRbErCda3SA35VFDZglhb631Scdw+2uj 7860xrECNzIqN/OM2NDbE5UzZn1pEhQPQTep3/th7huBVbArBBZnHRXxEURGMeVh sjNLxxQZhaybkE2aHa/ythGAklLZgf8GvGpWwXYkCr7emSoK93eA6UQpUwaJqVI3 WlW5XfF+k0h3cVUf/BizA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1663606186; x=1663692586; bh=K5EvS7vP8L6M3 1QM3zmyMgApIJPVaOglFG1TvndhbBw=; b=kR5Bzz9cWGSRkxYtO0zBmK2f/iFjm 4e3OMtsG/jDd0RVAB/SEMypxzwlw38Q+7TfTEIVRaL7XpQy/zsPlPA9JfMDFoGsc 8PR+bWni6TVUCNmiFt7MGQa+YZeiMPZGMxMDDSn9BgmU3ABp8+2iKzIMsMDfh3Ml 1av58S34SGukv6w6Ny4XgcT200Uik3SqWfZy4tr04HSyQaX1keY7r0BVSNyCkd/O g6YITj87h3bpi/ofU7aOZZ/effdML61bKKBqgcwoVtDHF5WNV3LAX2M7IsqSOTRz u01pavh6PzsjFe7nZzyi9n5fXGxYhQTwfkH+IWcQ5XeDvSoqV+IT11ywA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfedvjedguddtkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuvhgv nhcurfgvthgvrhcuoehsvhgvnhesshhvvghnphgvthgvrhdruggvvheqnecuggftrfgrth htvghrnhepjeeiheehkeegvdejhfevkeejgfdutdefhfethedtieffleekieeuudefleek jeegnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmrghilhhfrhhomhepsh hvvghnsehsvhgvnhhpvghtvghrrdguvghv X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 Sep 2022 12:49:44 -0400 (EDT) From: Sven Peter To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz Cc: Sven Peter , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Krzysztof Kozlowski , Paolo Abeni , Rob Herring , Hector Martin , Alyssa Rosenzweig , asahi@lists.linux.dev, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/7] Bluetooth: Add quirk to disable MWS Transport Configuration Date: Mon, 19 Sep 2022 18:48:33 +0200 Message-Id: <20220919164834.62739-7-sven@svenpeter.dev> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220919164834.62739-1-sven@svenpeter.dev> References: <20220919164834.62739-1-sven@svenpeter.dev> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_094947_341380_6B9E6B52 X-CRM114-Status: GOOD ( 13.81 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Broadcom 4378/4387 controllers found in Apple Silicon Macs claim to support getting MWS Transport Layer Configuration, < HCI Command: Read Local Supported... (0x04|0x0002) plen 0 > HCI Event: Command Complete (0x0e) plen 68 Read Local Supported Commands (0x04|0x0002) ncmd 1 Status: Success (0x00) [...] Get MWS Transport Layer Configuration (Octet 30 - Bit 3)] [...] , but then don't actually allow the required command: > HCI Event: Command Complete (0x0e) plen 15 Get MWS Transport Layer Configuration (0x05|0x000c) ncmd 1 Status: Command Disallowed (0x0c) Number of transports: 0 Baud rate list: 0 entries 00 00 00 00 00 00 00 00 00 00 Signed-off-by: Sven Peter --- new commit in v3 since this now fails loudly since 6.0-rc4 include/net/bluetooth/hci.h | 10 ++++++++++ net/bluetooth/hci_sync.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 75dcd818cf04..33d83d5ab84b 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -273,6 +273,16 @@ enum { * during the hdev->setup vendor callback. */ HCI_QUIRK_BROKEN_EXT_SCAN, + + /* + * When this quirk is set, the HCI_OP_GET_MWS_TRANSPORT_CONFIG command is + * disabled. This is required for some Broadcom controllers which + * erroneously claim to support MWS Transport Layer Configuration. + * + * This quirk can be set before hci_register_dev is called or + * during the hdev->setup vendor callback. + */ + HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, }; /* HCI device flags */ diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index fbd5613eebfc..791b37344ed6 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -3939,6 +3939,8 @@ static int hci_get_mws_transport_config_sync(struct hci_dev *hdev) { if (!(hdev->commands[30] & 0x08)) return 0; + if (test_bit(HCI_QUIRK_BROKEN_MWS_TRANSPORT_CONFIG, &hdev->quirks)) + return 0; return __hci_cmd_sync_status(hdev, HCI_OP_GET_MWS_TRANSPORT_CONFIG, 0, NULL, HCI_CMD_TIMEOUT);