Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2539573rwi; Fri, 28 Oct 2022 08:13:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4MB5tK0DCc4OmxPsFDD4noEbEnLjZTaIYtRdpJOQvxNcPdXZcERzkorO47FChAiq9aINYq X-Received: by 2002:a17:90a:6043:b0:213:8043:4b85 with SMTP id h3-20020a17090a604300b0021380434b85mr7720997pjm.135.1666969999090; Fri, 28 Oct 2022 08:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666969999; cv=none; d=google.com; s=arc-20160816; b=M7NThjEUoBkNzdy7hqkgpB+gKaqilT493AM1ATKuYfLYXGhoxufDp3LCBL9xXJHcfM D3SrjCEqyXqJjyabeT35iQwCC3JlzV4D/Q5wrJjY4WXOuoeO6lz6Xuz8PwbPOlYVDF+g F8aXnVKGVuqoYXfMJHfrTb0uNYHi1vkTMu1CzzjFuG63LWQEStMYSGFrz2Xvjzwv+RKU 1LJ4gufRggJB9CwWpjauM7PMQk5YgGD5cTUQrp4UDlwBpALP3W9A4xilJI1JWPOjfct1 zI9SI6wMmxDgyyaQfG7uo92gm6ZlTyQ/eNMGT6xZlBKlwZWJp1qpkV25atUO5bb5P8fB fqNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:date:references:in-reply-to :message-id:mime-version:user-agent:feedback-id:dkim-signature :dkim-signature; bh=Sy6FI25zRCehPukmtH7/3V5knsC4JumJoR5V84h5kaM=; b=gJZ32XsQHgaqaH5ml8RRRHfa7NYQj9g6jbM3O8Xzgr8DgyBlPDTVfWGGheC7xr0MFN KQe64bibf2k56oRen36kQnZA1einH3xHShMiPMqh/GCk6r/r5uUrg8jh0scimYwrD49y /6UVcn5jJ//rNYjCg9e82J4tVwFmLIQH3vzXy7TG3AtyZ0zbpZwB5mZzKaoJXOW9DZHn 4gUvO3BwnfQkT78m+brVhn5LrTt/gnVg3BoQYZaPlrLaFO4E+lJphU39OqXmmETJW+it zCWngQewvTVp1A7gpaBg2F3RL3mQpGfup4zfcLYkGH8nVb9bHatOC+DmcueeUh+PZzdg J0JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@svenpeter.dev header.s=fm3 header.b=G+cOvYkJ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TsctoJvw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e1-20020aa78241000000b0056c231e4447si5122271pfn.198.2022.10.28.08.12.29; Fri, 28 Oct 2022 08:13:19 -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; dkim=pass header.i=@svenpeter.dev header.s=fm3 header.b=G+cOvYkJ; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=TsctoJvw; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=svenpeter.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229866AbiJ1PJX (ORCPT + 99 others); Fri, 28 Oct 2022 11:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229740AbiJ1PJW (ORCPT ); Fri, 28 Oct 2022 11:09:22 -0400 Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B351320B104; Fri, 28 Oct 2022 08:09:21 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 279445C0063; Fri, 28 Oct 2022 11:09:21 -0400 (EDT) Received: from imap47 ([10.202.2.97]) by compute2.internal (MEProxy); Fri, 28 Oct 2022 11:09:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=svenpeter.dev; h=cc:cc:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1666969761; x=1667056161; bh=Sy 6FI25zRCehPukmtH7/3V5knsC4JumJoR5V84h5kaM=; b=G+cOvYkJUUuGPABiFE zjECEj6bJ8KF8IJsUGHKSG0kkvtJ2VGlxHt/vHL3ot1tcHvmCSHq8Yxsn4jmlio7 b87XcMRi/qNN2Hb+sQrrIZ/MprY+gQcSbAB1QGBlp6tKIsdFXVmWzpQXjwkBy+xO 4NvUlBVNiARkhbYcP5kRP5B0zXk8MJkJINm4XJm8NEnr4Qzbl7givGBykTZzep89 cUxHoMgh2r033YFDu1ONbt6pohcKPJwCy45muRy6CLnu6U5L9/8q6rm0UoXVOE4f JDMshM/hm6kmL+pRMQ9aVtqAhwjY2GOiTOFxCdJtIFMMe1NV8rq+RTaTz7G9SCGw O0AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type: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= fm3; t=1666969761; x=1667056161; bh=Sy6FI25zRCehPukmtH7/3V5knsC4 JumJoR5V84h5kaM=; b=TsctoJvwFdAcmmgfHHKeVjmT4R7aNkVhe6oQqMfWMVbJ 5eenZ0qnr+0i+VeZ4wJBz8Vh/koB0kDeIK1jZa+7vK5IVeaOZdE+MA8+s4RxrBZ+ X592De5wmxSVbMZkK3U06Bco6tBH2UULWY+GgRgGJdh0HdjwVinsImTnjLXK3bAJ Kvn9Ot2VuqzkO4U05kBK9GNBs4Ul0H1ednZr4yCjeLd8Qn7ZYGyCGJvEBWRxUmSn ow91pTIwYpEuEIFXibkL7lxzaZ977U4bzMrtl2gCdWegTSLYhVw5uyD2RhX3rB1A 3yrcm+/abvZP9pUGBNFqCI2vjfocyFju8Dr4PVuyjQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtdeigdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdfuvhgv nhcurfgvthgvrhdfuceoshhvvghnsehsvhgvnhhpvghtvghrrdguvghvqeenucggtffrrg htthgvrhhnpeelvefggeffheevtdeivefhkeehfeettdejteduveeiheevveeilefghfei veeiueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsvhgvnhesshhvvghnphgvthgvrhdruggvvh X-ME-Proxy: Feedback-ID: i51094778:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id EDD5AA6007C; Fri, 28 Oct 2022 11:09:19 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-1087-g968661d8e1-fm-20221021.001-g968661d8 Mime-Version: 1.0 Message-Id: <587611e4-eb08-4b86-a8e8-aaa10f8efee6@app.fastmail.com> In-Reply-To: References: <20221027150822.26120-1-sven@svenpeter.dev> <20221027150822.26120-7-sven@svenpeter.dev> Date: Fri, 28 Oct 2022 17:08:59 +0200 From: "Sven Peter" To: "Luiz Augusto von Dentz" Cc: "Marcel Holtmann" , "Johan Hedberg" , "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: Re: [PATCH v4 6/7] Bluetooth: Add quirk to disable MWS Transport Configuration Content-Type: text/plain X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, 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 Hi Luiz, On Thu, Oct 27, 2022, at 20:59, Luiz Augusto von Dentz wrote: > Hi Sven, > > On Thu, Oct 27, 2022 at 8:09 AM Sven Peter wrote: >> >> 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 >> --- >> 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 8cd89948f961..110d6df1299b 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 76c3107c9f91..91788d356748 100644 >> --- a/net/bluetooth/hci_sync.c >> +++ b/net/bluetooth/hci_sync.c >> @@ -4260,6 +4260,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; > > Let's add a macro that tests both the command and the quirk so we > don't have to test them separately. Sure, I'll add a macro for v5. Best, Sven