Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1356952lqt; Wed, 20 Mar 2024 00:59:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVevR30+ngw7jfNJlmU5Gyjwr7u8FeVsB3zAnqO/VYBcHOlMs76nVQXmYMsBY3S3Y/uYqBdp/916IITrT2pNFLo66P6K1lOCdT1kXdDXg== X-Google-Smtp-Source: AGHT+IEoYwo+kBnbA96en7mmMETRqIuHtmTOkCBtcFfbJNEIxAAMI51RSnF81zKWvYUgORuT1+q4 X-Received: by 2002:a05:6402:3647:b0:568:9995:d14c with SMTP id em7-20020a056402364700b005689995d14cmr932376edb.18.1710921549630; Wed, 20 Mar 2024 00:59:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710921549; cv=pass; d=google.com; s=arc-20160816; b=yP0D/891KF5VOwzRddhuUANliFRnMutqsSvNUY0z9kl8cx+7/6I5qR7Ol5dRTsdE14 Cw0bfgyHR45KFzydODymsvbPuvlQ4J3zjXzGwZY1lfWbWPoilxW1eo6ItDLW7nOsPvOO 3IoGsLwZExmKyquS6nnbdR/ioPKiYc1H+tHAXaXNvF76fwDn3ZO9E/35XIa1yVPbxLIv f52c+c3IPVUgD2onsPZQ8hmC/9tPWuS7UfihmePo0hK9DoX8thRVabRTu2yc/zwd2ITj wyzjaYs+6pHKcDp5Zo2naPY1iWGKiAq7maC0IG3KGKlf0f++4vaUxzd8zQqyZE1QmuxF 0jJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=dHJ+A7+wfAPsQa8eiE9R1D1vxR5XKt/5vO6cqRDwxaI=; fh=KhnvXj9wNACRHsGM1CvOrN/pRB1vU8aTK81JzIVJuyE=; b=Qsh3OKDkSQCVUpsX0jTtbsKZXwIu3e0wwtXSBf1vULJsmWoiE4cmYJ4p4rVzyqFj81 hDcle+zzCudVL7wBR9GXN3+pslo3arfeuvj2qZsjVxJWJplNr/9neuT+vz9AE7xC70k9 MUdzSoLQYrBcSUSMR47heDpiQhE8bN1ovM3BEePpIBr2gVbbTfUJVNJmuA+gWLBENgO0 2gneTIyi/7rSjnlUeeafWnwtDps4fSL9Jusi8M2M8HfuvUm3kyqR5fcQHnfsimRXBaoo MEuwZeSILtiRbn2qITGJjpsX1ZjyQDrzBltI5FeqcSJqp56AOx8/ls40YS8AfTdnEnON hZ5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gi/g16Rm"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-2649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n8-20020a056402434800b00567229ec651si6440671edc.316.2024.03.20.00.59.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 00:59:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="gi/g16Rm"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-2649-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2649-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 5EFF11F22EA7 for ; Wed, 20 Mar 2024 07:59:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E4AC3A1BE; Wed, 20 Mar 2024 07:58:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gi/g16Rm" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7D82B29D05; Wed, 20 Mar 2024 07:58:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710921499; cv=none; b=fdGUCds96FTdPXPAx0h/9F58JFlfvdAEiYFeoN04bLLYZ4rbHx35rSmialeZygHXAJJLt/CH57INc5sTAS09E7RVp4T0qxHqnQKsQ14YGYujvvUcwGMQaA1nPbXPzxSkhI3rJbqsIhWouXSIMCnGWdtxJlJOgnqfKRsjDTWDJsU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710921499; c=relaxed/simple; bh=yZx/K20JjSPqfrFqUfwkuy4b3Gm7kIvXWo3FmGJp2ck=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=pwOaIwnh+6PILfrEguW2Py2bdOF1A+KJUiFnDdRo5ecMwEsyr8xm5h60KeoAO5Hbb7RKMtAiYpmG3wv5HBm6hb/EDO9swSejqXZVidDkQOdtIcLhuACCx5qm3/FZajJU8+z67iBzyw8DQ2BiAr3b/FJvMPTg02oedJWxdBR07oQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gi/g16Rm; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A2E4C433F1; Wed, 20 Mar 2024 07:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710921499; bh=yZx/K20JjSPqfrFqUfwkuy4b3Gm7kIvXWo3FmGJp2ck=; h=From:To:Cc:Subject:Date:From; b=gi/g16Rm+GYdFT7LTMupu97ovAAxMYjApGXVMs4hTL4Uh+800w8LgChiwv9Nw2Sy/ rTWPFpRZJASJyNWt+Ud742tI39RnzcFWm2ROsklJBZjKg1WTssYjssfR8QMqVZiwLI WtEJ9gsKPEcqcQenpT3C/IplOUpT7/mU+QRywpClvvGpC2aDn9X3z6mV2RYuTOwix3 dZgClgWjciRpyjVpZRT2WaVGN6Cc8O8GtbqSd34d/dC/Jut4esjSHPs+m2q3HZ6elI ytTnv04uwV81EhyAVOYVX0Na6ZSDlZlwxx77O7IZ1q2mf06tj44QvO84EcAPv8e974 Raxs+myHg+OKw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rmqq8-0000000029K-2Bv6; Wed, 20 Mar 2024 08:58:25 +0100 From: Johan Hovold To: Marcel Holtmann , Luiz Augusto von Dentz , Bjorn Andersson Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Konrad Dybcio , Johan Hedberg , Balakrishna Godavarthi , Matthias Kaehlcke , Douglas Anderson , Rocky Liao , Dmitry Baryshkov , linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Date: Wed, 20 Mar 2024 08:55:50 +0100 Message-ID: <20240320075554.8178-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The Qualcomm Bluetooth driver is configuring the device address in reverse order for none-ROME devices, which breaks user space tools like btmgmt and the 'local-bd-address' devicetree property. As these Qualcomm controllers lack persistent storage for the device address, boot firmware can use the 'local-bd-address' devicetree property to provide a valid address. The property should specify the address in little endian order but instead some boot firmware has been reversing the address to match the buggy Qualcomm driver. This specifically affects some Chromebook devices for which we now need to maintain compatibility with the current boot firmware. As ChromeOS updates the kernel and devicetree in lockstep, this can be done by adding a new 'qcom,local-bd-address-broken' property that can be used to determine if the firmware passes the address in the wrong byte order. [1][2] Note that this series depends on the following revert: https://lore.kernel.org/lkml/20240314084412.1127-1-johan+linaro@kernel.org/ Also note that the devicetree patch (patch 2/4) is expected to be merged through the Qualcomm SoC tree once the other three patches have been picked up by the Bluetooth maintainers. An alternative would be if Bjorn could ack the DT patch so that everything can go in through the Bluetooth tree. Johan [1] https://lore.kernel.org/lkml/ZcuWQkmYK4Ax9kam@google.com/ [2] https://lore.kernel.org/lkml/CAD=FV=WCzrh926mkiyBnKRG_+KGuOkGN6v0DgPiXhQCD3PSQ9w@mail.gmail.com/ Changes in v4 - add the missing type for the new vendor property to the binding - move the Trogdor DT patch after the binding patch and combine the endianness fix and Chromium workaround to avoid having any point in the series where the address is reversed on those platforms as requested by Doug Changes in v3 - add a 'qcom,local-bd-address-broken' property instead of deprecating the current WCN3991 binding - mark the bluetooth address on SC7180 Trogdor Chromebooks as broken Changes in v2 - add quirk to handle deprecated devicetree compatibles that expect broken address properties - deprecate 'qcom,wcn3991-bt' and mark it as broken Johan Hovold (4): dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken Bluetooth: add quirk for broken address properties Bluetooth: qca: fix device-address endianness .../bindings/net/bluetooth/qualcomm-bluetooth.yaml | 4 ++++ arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 2 ++ drivers/bluetooth/btqca.c | 8 ++++++-- drivers/bluetooth/hci_qca.c | 10 ++++++++++ include/net/bluetooth/hci.h | 9 +++++++++ net/bluetooth/hci_sync.c | 5 ++++- 6 files changed, 35 insertions(+), 3 deletions(-) -- 2.43.2