Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp950795lqt; Tue, 19 Mar 2024 08:30:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVrMBG4LjXm0igNd3LKWJs1Pj9kl1M/BNZ2/DlNCLTv/txCbDQtxfxEiCnkK38jz1v8sOtF5VbxQHcAVBPL29zvnSVepm3qBEfhklV3Og== X-Google-Smtp-Source: AGHT+IHYS8mpdhFfMwgmawA+Fl8WEeZIxw/sp/z+GaGsTqYeBnOO9OIgcFKTQbpljzg/1Q1dd3We X-Received: by 2002:a67:eb4f:0:b0:474:ca0e:5a22 with SMTP id x15-20020a67eb4f000000b00474ca0e5a22mr2204132vso.13.1710862249619; Tue, 19 Mar 2024 08:30:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710862249; cv=pass; d=google.com; s=arc-20160816; b=O3Bunoi86KC4tvZsl7DQXkExmcHvqepylxSVca4tBzZ6OxA9kqG3TcShrCUPsczb8l wvhDhs8kvkgvNhED0FEgyBR1+0S9TNJ9uhSbonFlkK3rD/dnCa+S0xjmtk4pSIpsMWSH QWQKwK34/utJ4lSR2j6Wkg0QAGvw3cLVI1O7rs3B3JTqeuYyeIczzuLS3LZIAbNmbf9r AA8Ce07w9aSkw4zFOe5MzZXSZyybP39qzvPn2aop92nyL2E++uiuNba4EJdpztk1pjQV BT4EaFws63NDSwL+slaLPu60EwyMNSbosZBQ+Bs5hzBqSc8ZRuTMcvdKm12l0ViYACL6 xIHw== 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=NUvTwo5cuephnJX8olFPmdwzlafPX+/eqZ9FoiI0K70=; fh=KhnvXj9wNACRHsGM1CvOrN/pRB1vU8aTK81JzIVJuyE=; b=UfueTJasa4hbmj9b9b/YGU5shDQk4pR+XMKz+yxBfI17oDqfnqKgRC4b32mOJHDvua GA1wOTLKc2tvydO7nl5gP77QqT71oflWlmUPHj8acvM9DIb9QUC8sgCM4Ws1U2Wt1I/l VHbHrdoH+k7VOtN4lS9pmNWhL+FOAFsfsqq0RQ58vtGwvzi28A24hnl0/NB8Xjvx/IrS CMhTj1JzggkhOA2ENdF/RHLEezG8VhE2lBVFk1UZi14b+QtG9xrTJQVab5iVwGs2j4Gs /7i9vb3ghWJtnnGJfJcsz1h1y5odawR5t0+0wV5CIcwf8f9vL6f2aFcK1H8MaJ1KMdsC fU3Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=epZgzaIC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-2615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2615-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id iy1-20020a0562140f6100b00690bba8c5casi11180706qvb.116.2024.03.19.08.30.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 08:30:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=epZgzaIC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-2615-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2615-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 593481C22180 for ; Tue, 19 Mar 2024 15:30:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D1B9823DF; Tue, 19 Mar 2024 15:29:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="epZgzaIC" 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 9B122657AF; Tue, 19 Mar 2024 15:29:53 +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=1710862193; cv=none; b=JQmT+GYZLOZPwwOIw/Pd9qXxbmhSS7MBffGRDkFUeEwAIp8xUiSSe7Z5MTyeuBPWexVzHEfALmM7UNZANkPs/i5/Rbhy14ILJ1lxmrwXjZC5HZfWWmkqcjpQjYYuQLUEA16SfYTLKv9cXSdq7XRBWzU9eAZ/j6Q86byA9macOMg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710862193; c=relaxed/simple; bh=GjYHvVQZs23pb77305b3S3FHd2IrH9UGYK67GbcU8xg=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SmE99KEY2jGDRwpfgClLRM2Swjnn8jTC2yoLUjAJ9qCLCjs/Z8hoE3QNUl7p7bIfVUHJdtOXxTJTyerkFWI3SMuoZZvlQzmtqoRCUiXRp+56Oj2TwgMYBzdadh0WdsJBngeCsYeIBornEYBMb22SCV4RFKpTmDMkCMbqmVd2G7U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=epZgzaIC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 408EDC433F1; Tue, 19 Mar 2024 15:29:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710862193; bh=GjYHvVQZs23pb77305b3S3FHd2IrH9UGYK67GbcU8xg=; h=From:To:Cc:Subject:Date:From; b=epZgzaICmHiX6Rut66VHxi31UFGSx7PhZOxb4l7UGOqBQkzLQjHK/J9cM4WyLtcHf 1nwCt+gqfIGoljaTmCwMFy+75QnqKjkNXi5s0vmAHn/HO/qVAsYk3ngsISyL3zWRIR 9aQL5+WSd0EAcoEhlLqIGNlSd0sndWMZqEobUSbpl3M45Ncycn9CTrGxje5ePWWcMY CwjrAMyHl4FujQxJJGj6btJmTx7JcInwUkv5zKadPIrEVDbo7fnip2YqcZ2LQ9FwN8 gkrBUzkCKOWcIu1/rN+/VCKaDZBkaqYF4ERwKWNOLFl98UoUBTRBjy/GOV9FXIHqVB 24gY89pq++hEQ== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rmbPa-000000000LC-44WP; Tue, 19 Mar 2024 16:29:59 +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 v3 0/5] Bluetooth: qca: fix device-address endianness Date: Tue, 19 Mar 2024 16:29:21 +0100 Message-ID: <20240319152926.1288-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 final patch is expected to be merged through the Qualcomm SoC tree once the first four patches have been picked up by the Bluetooth maintainers. 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 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 (5): dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Bluetooth: add quirk for broken address properties Bluetooth: qca: fix device-address endianness Bluetooth: qca: add workaround for broken address properties arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken .../bindings/net/bluetooth/qualcomm-bluetooth.yaml | 3 +++ 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, 34 insertions(+), 3 deletions(-) -- 2.43.2