Linux-Bluetooth Archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness
@ 2024-03-20  7:55 Johan Hovold
  2024-03-20  7:55 ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Johan Hovold
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Johan Hovold @ 2024-03-20  7:55 UTC (permalink / raw
  To: Marcel Holtmann, Luiz Augusto von Dentz, Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	cros-qcom-dts-watchers, Konrad Dybcio, Johan Hedberg,
	Balakrishna Godavarthi, Matthias Kaehlcke, Douglas Anderson,
	Rocky Liao, Dmitry Baryshkov, linux-bluetooth, netdev, devicetree,
	linux-arm-msm, linux-kernel, Johan Hovold

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


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken'
  2024-03-20  7:55 [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Johan Hovold
@ 2024-03-20  7:55 ` Johan Hovold
  2024-03-20  8:15   ` Bluetooth: qca: fix device-address endianness bluez.test.bot
  2024-03-20 17:11   ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Rob Herring
  2024-03-20  7:55 ` [PATCH v4 2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken Johan Hovold
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 9+ messages in thread
From: Johan Hovold @ 2024-03-20  7:55 UTC (permalink / raw
  To: Marcel Holtmann, Luiz Augusto von Dentz, Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	cros-qcom-dts-watchers, Konrad Dybcio, Johan Hedberg,
	Balakrishna Godavarthi, Matthias Kaehlcke, Douglas Anderson,
	Rocky Liao, Dmitry Baryshkov, linux-bluetooth, netdev, devicetree,
	linux-arm-msm, linux-kernel, Johan Hovold

Several Qualcomm Bluetooth controllers lack persistent storage for the
device address and instead one can be provided by the boot firmware
using the 'local-bd-address' devicetree property.

The Bluetooth bindings clearly states that the address should be
specified in little-endian order, but due to a long-standing bug in the
Qualcomm driver which reversed the address some boot firmware has been
providing the address in big-endian order instead.

The only device out there that should be affected by this is the WCN3991
used in some Chromebooks.

Add a 'qcom,local-bd-address-broken' property which can be set on these
platforms to indicate that the boot firmware is using the wrong byte
order.

Note that ChromeOS always updates the kernel and devicetree in lockstep
so that there is no need to handle backwards compatibility with older
devicetrees.

Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 .../devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
index eba2f3026ab0..fdaea08e7442 100644
--- a/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
+++ b/Documentation/devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml
@@ -94,6 +94,10 @@ properties:
 
   local-bd-address: true
 
+  qcom,local-bd-address-broken:
+    type: boolean
+    description:
+      boot firmware is incorrectly passing the address in big-endian order
 
 required:
   - compatible
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken
  2024-03-20  7:55 [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Johan Hovold
  2024-03-20  7:55 ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Johan Hovold
@ 2024-03-20  7:55 ` Johan Hovold
  2024-03-22 14:44   ` Bjorn Andersson
  2024-03-20  7:55 ` [PATCH v4 3/4] Bluetooth: add quirk for broken address properties Johan Hovold
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Johan Hovold @ 2024-03-20  7:55 UTC (permalink / raw
  To: Marcel Holtmann, Luiz Augusto von Dentz, Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	cros-qcom-dts-watchers, Konrad Dybcio, Johan Hedberg,
	Balakrishna Godavarthi, Matthias Kaehlcke, Douglas Anderson,
	Rocky Liao, Dmitry Baryshkov, linux-bluetooth, netdev, devicetree,
	linux-arm-msm, linux-kernel, Johan Hovold, stable, Rob Clark

Several Qualcomm Bluetooth controllers lack persistent storage for the
device address and instead one can be provided by the boot firmware
using the 'local-bd-address' devicetree property.

The Bluetooth bindings clearly states that the address should be
specified in little-endian order, but due to a long-standing bug in the
Qualcomm driver which reversed the address some boot firmware has been
providing the address in big-endian order instead.

The boot firmware in SC7180 Trogdor Chromebooks is known to be affected
so mark the 'local-bd-address' property as broken to maintain backwards
compatibility with older firmware when fixing the underlying driver bug.

Note that ChromeOS always updates the kernel and devicetree in lockstep
so that there is no need to handle backwards compatibility with older
devicetrees.

Fixes: 7ec3e67307f8 ("arm64: dts: qcom: sc7180-trogdor: add initial trogdor and lazor dt")
Cc: stable@vger.kernel.org      # 5.10
Cc: Rob Clark <robdclark@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
index 46aaeba28604..ebe37678102f 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
@@ -943,6 +943,8 @@ bluetooth: bluetooth {
 		vddrf-supply = <&pp1300_l2c>;
 		vddch0-supply = <&pp3300_l10c>;
 		max-speed = <3200000>;
+
+		qcom,local-bd-address-broken;
 	};
 };
 
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 3/4] Bluetooth: add quirk for broken address properties
  2024-03-20  7:55 [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Johan Hovold
  2024-03-20  7:55 ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Johan Hovold
  2024-03-20  7:55 ` [PATCH v4 2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken Johan Hovold
@ 2024-03-20  7:55 ` Johan Hovold
  2024-03-20  7:55 ` [PATCH v4 4/4] Bluetooth: qca: fix device-address endianness Johan Hovold
  2024-03-26 15:30 ` [PATCH v4 0/4] " patchwork-bot+bluetooth
  4 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2024-03-20  7:55 UTC (permalink / raw
  To: Marcel Holtmann, Luiz Augusto von Dentz, Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	cros-qcom-dts-watchers, Konrad Dybcio, Johan Hedberg,
	Balakrishna Godavarthi, Matthias Kaehlcke, Douglas Anderson,
	Rocky Liao, Dmitry Baryshkov, linux-bluetooth, netdev, devicetree,
	linux-arm-msm, linux-kernel, Johan Hovold, stable

Some Bluetooth controllers lack persistent storage for the device
address and instead one can be provided by the boot firmware using the
'local-bd-address' devicetree property.

The Bluetooth devicetree bindings clearly states that the address should
be specified in little-endian order, but due to a long-standing bug in
the Qualcomm driver which reversed the address some boot firmware has
been providing the address in big-endian order instead.

Add a new quirk that can be set on platforms with broken firmware and
use it to reverse the address when parsing the property so that the
underlying driver bug can be fixed.

Fixes: 5c0a1001c8be ("Bluetooth: hci_qca: Add helper to set device address")
Cc: stable@vger.kernel.org      # 5.1
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 include/net/bluetooth/hci.h | 9 +++++++++
 net/bluetooth/hci_sync.c    | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index bdee5d649cc6..191077d8d578 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -176,6 +176,15 @@ enum {
 	 */
 	HCI_QUIRK_USE_BDADDR_PROPERTY,
 
+	/* When this quirk is set, the Bluetooth Device Address provided by
+	 * the 'local-bd-address' fwnode property is incorrectly specified in
+	 * big-endian order.
+	 *
+	 * This quirk can be set before hci_register_dev is called or
+	 * during the hdev->setup vendor callback.
+	 */
+	HCI_QUIRK_BDADDR_PROPERTY_BROKEN,
+
 	/* When this quirk is set, the duplicate filtering during
 	 * scanning is based on Bluetooth devices addresses. To allow
 	 * RSSI based updates, restart scanning if needed.
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 5716345a26df..283ae8edc1e5 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3215,7 +3215,10 @@ static void hci_dev_get_bd_addr_from_property(struct hci_dev *hdev)
 	if (ret < 0 || !bacmp(&ba, BDADDR_ANY))
 		return;
 
-	bacpy(&hdev->public_addr, &ba);
+	if (test_bit(HCI_QUIRK_BDADDR_PROPERTY_BROKEN, &hdev->quirks))
+		baswap(&hdev->public_addr, &ba);
+	else
+		bacpy(&hdev->public_addr, &ba);
 }
 
 struct hci_init_stage {
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v4 4/4] Bluetooth: qca: fix device-address endianness
  2024-03-20  7:55 [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Johan Hovold
                   ` (2 preceding siblings ...)
  2024-03-20  7:55 ` [PATCH v4 3/4] Bluetooth: add quirk for broken address properties Johan Hovold
@ 2024-03-20  7:55 ` Johan Hovold
  2024-03-26 15:30 ` [PATCH v4 0/4] " patchwork-bot+bluetooth
  4 siblings, 0 replies; 9+ messages in thread
From: Johan Hovold @ 2024-03-20  7:55 UTC (permalink / raw
  To: Marcel Holtmann, Luiz Augusto von Dentz, Bjorn Andersson
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	cros-qcom-dts-watchers, Konrad Dybcio, Johan Hedberg,
	Balakrishna Godavarthi, Matthias Kaehlcke, Douglas Anderson,
	Rocky Liao, Dmitry Baryshkov, linux-bluetooth, netdev, devicetree,
	linux-arm-msm, linux-kernel, Johan Hovold, stable, Nikita Travkin

The WCN6855 firmware on the Lenovo ThinkPad X13s expects the Bluetooth
device address in big-endian order when setting it using the
EDL_WRITE_BD_ADDR_OPCODE command.

Presumably, this is the case for all non-ROME devices which all use the
EDL_WRITE_BD_ADDR_OPCODE command for this (unlike the ROME devices which
use a different command and expect the address in little-endian order).

Reverse the little-endian address before setting it to make sure that
the address can be configured using tools like btmgmt or using the
'local-bd-address' devicetree property.

Note that this can potentially break systems with boot firmware which
has started relying on the broken behaviour and is incorrectly passing
the address via devicetree in big-endian order.

The only device affected by this should be the WCN3991 used in some
Chromebooks. As ChromeOS updates the kernel and devicetree in lockstep,
the new 'qcom,local-bd-address-broken' property can be used to determine
if the firmware is buggy so that the underlying driver bug can be fixed
without breaking backwards compatibility.

Set the HCI_QUIRK_BDADDR_PROPERTY_BROKEN quirk for such platforms so
that the address is reversed when parsing the address property.

Fixes: 5c0a1001c8be ("Bluetooth: hci_qca: Add helper to set device address")
Cc: stable@vger.kernel.org      # 5.1
Cc: Balakrishna Godavarthi <quic_bgodavar@quicinc.com>
Cc: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Nikita Travkin <nikita@trvn.ru> # sc7180
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
 drivers/bluetooth/btqca.c   |  8 ++++++--
 drivers/bluetooth/hci_qca.c | 10 ++++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
index b40b32fa7f1c..19cfc342fc7b 100644
--- a/drivers/bluetooth/btqca.c
+++ b/drivers/bluetooth/btqca.c
@@ -826,11 +826,15 @@ EXPORT_SYMBOL_GPL(qca_uart_setup);
 
 int qca_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
 {
+	bdaddr_t bdaddr_swapped;
 	struct sk_buff *skb;
 	int err;
 
-	skb = __hci_cmd_sync_ev(hdev, EDL_WRITE_BD_ADDR_OPCODE, 6, bdaddr,
-				HCI_EV_VENDOR, HCI_INIT_TIMEOUT);
+	baswap(&bdaddr_swapped, bdaddr);
+
+	skb = __hci_cmd_sync_ev(hdev, EDL_WRITE_BD_ADDR_OPCODE, 6,
+				&bdaddr_swapped, HCI_EV_VENDOR,
+				HCI_INIT_TIMEOUT);
 	if (IS_ERR(skb)) {
 		err = PTR_ERR(skb);
 		bt_dev_err(hdev, "QCA Change address cmd failed (%d)", err);
diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
index f989c05f8177..c73481c57741 100644
--- a/drivers/bluetooth/hci_qca.c
+++ b/drivers/bluetooth/hci_qca.c
@@ -225,6 +225,7 @@ struct qca_serdev {
 	struct qca_power *bt_power;
 	u32 init_speed;
 	u32 oper_speed;
+	bool bdaddr_property_broken;
 	const char *firmware_name;
 };
 
@@ -1842,6 +1843,7 @@ static int qca_setup(struct hci_uart *hu)
 	const char *firmware_name = qca_get_firmware_name(hu);
 	int ret;
 	struct qca_btsoc_version ver;
+	struct qca_serdev *qcadev;
 	const char *soc_name;
 
 	ret = qca_check_speeds(hu);
@@ -1904,6 +1906,11 @@ static int qca_setup(struct hci_uart *hu)
 	case QCA_WCN6855:
 	case QCA_WCN7850:
 		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks);
+
+		qcadev = serdev_device_get_drvdata(hu->serdev);
+		if (qcadev->bdaddr_property_broken)
+			set_bit(HCI_QUIRK_BDADDR_PROPERTY_BROKEN, &hdev->quirks);
+
 		hci_set_aosp_capable(hdev);
 
 		ret = qca_read_soc_version(hdev, &ver, soc_type);
@@ -2284,6 +2291,9 @@ static int qca_serdev_probe(struct serdev_device *serdev)
 	if (!qcadev->oper_speed)
 		BT_DBG("UART will pick default operating speed");
 
+	qcadev->bdaddr_property_broken = device_property_read_bool(&serdev->dev,
+			"qcom,local-bd-address-broken");
+
 	if (data)
 		qcadev->btsoc_type = data->soc_type;
 	else
-- 
2.43.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* RE: Bluetooth: qca: fix device-address endianness
  2024-03-20  7:55 ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Johan Hovold
@ 2024-03-20  8:15   ` bluez.test.bot
  2024-03-20 17:11   ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Rob Herring
  1 sibling, 0 replies; 9+ messages in thread
From: bluez.test.bot @ 2024-03-20  8:15 UTC (permalink / raw
  To: linux-bluetooth, johan+linaro

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]

This is an automated email and please do not reply to this email.

Dear Submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While preparing the CI tests, the patches you submitted couldn't be applied to the current HEAD of the repository.

----- Output -----

error: patch failed: drivers/bluetooth/hci_qca.c:1904
error: drivers/bluetooth/hci_qca.c: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch

Please resolve the issue and submit the patches again.


---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken'
  2024-03-20  7:55 ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Johan Hovold
  2024-03-20  8:15   ` Bluetooth: qca: fix device-address endianness bluez.test.bot
@ 2024-03-20 17:11   ` Rob Herring
  1 sibling, 0 replies; 9+ messages in thread
From: Rob Herring @ 2024-03-20 17:11 UTC (permalink / raw
  To: Johan Hovold
  Cc: linux-arm-msm, Rob Herring, Conor Dooley, Konrad Dybcio,
	Marcel Holtmann, Krzysztof Kozlowski, Johan Hedberg,
	Luiz Augusto von Dentz, Rocky Liao, linux-bluetooth,
	cros-qcom-dts-watchers, linux-kernel, Bjorn Andersson,
	Dmitry Baryshkov, devicetree, netdev, Douglas Anderson,
	Matthias Kaehlcke, Balakrishna Godavarthi


On Wed, 20 Mar 2024 08:55:51 +0100, Johan Hovold wrote:
> Several Qualcomm Bluetooth controllers lack persistent storage for the
> device address and instead one can be provided by the boot firmware
> using the 'local-bd-address' devicetree property.
> 
> The Bluetooth bindings clearly states that the address should be
> specified in little-endian order, but due to a long-standing bug in the
> Qualcomm driver which reversed the address some boot firmware has been
> providing the address in big-endian order instead.
> 
> The only device out there that should be affected by this is the WCN3991
> used in some Chromebooks.
> 
> Add a 'qcom,local-bd-address-broken' property which can be set on these
> platforms to indicate that the boot firmware is using the wrong byte
> order.
> 
> Note that ChromeOS always updates the kernel and devicetree in lockstep
> so that there is no need to handle backwards compatibility with older
> devicetrees.
> 
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
> ---
>  .../devicetree/bindings/net/bluetooth/qualcomm-bluetooth.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 

Reviewed-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4 2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken
  2024-03-20  7:55 ` [PATCH v4 2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken Johan Hovold
@ 2024-03-22 14:44   ` Bjorn Andersson
  0 siblings, 0 replies; 9+ messages in thread
From: Bjorn Andersson @ 2024-03-22 14:44 UTC (permalink / raw
  To: Johan Hovold
  Cc: Marcel Holtmann, Luiz Augusto von Dentz, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, cros-qcom-dts-watchers,
	Konrad Dybcio, Johan Hedberg, Balakrishna Godavarthi,
	Matthias Kaehlcke, Douglas Anderson, Rocky Liao, Dmitry Baryshkov,
	linux-bluetooth, netdev, devicetree, linux-arm-msm, linux-kernel,
	stable, Rob Clark

On Wed, Mar 20, 2024 at 08:55:52AM +0100, Johan Hovold wrote:
> Several Qualcomm Bluetooth controllers lack persistent storage for the
> device address and instead one can be provided by the boot firmware
> using the 'local-bd-address' devicetree property.
> 
> The Bluetooth bindings clearly states that the address should be
> specified in little-endian order, but due to a long-standing bug in the
> Qualcomm driver which reversed the address some boot firmware has been
> providing the address in big-endian order instead.
> 
> The boot firmware in SC7180 Trogdor Chromebooks is known to be affected
> so mark the 'local-bd-address' property as broken to maintain backwards
> compatibility with older firmware when fixing the underlying driver bug.
> 
> Note that ChromeOS always updates the kernel and devicetree in lockstep
> so that there is no need to handle backwards compatibility with older
> devicetrees.
> 
> Fixes: 7ec3e67307f8 ("arm64: dts: qcom: sc7180-trogdor: add initial trogdor and lazor dt")
> Cc: stable@vger.kernel.org      # 5.10
> Cc: Rob Clark <robdclark@chromium.org>
> Reviewed-by: Douglas Anderson <dianders@chromium.org>
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Acked-by: Bjorn Andersson <andersson@kernel.org>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>

Please merge this through the BT tree, together with the other patches.

Regards,
Bjorn

> ---
>  arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
> index 46aaeba28604..ebe37678102f 100644
> --- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
> @@ -943,6 +943,8 @@ bluetooth: bluetooth {
>  		vddrf-supply = <&pp1300_l2c>;
>  		vddch0-supply = <&pp3300_l10c>;
>  		max-speed = <3200000>;
> +
> +		qcom,local-bd-address-broken;
>  	};
>  };
>  
> -- 
> 2.43.2
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness
  2024-03-20  7:55 [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Johan Hovold
                   ` (3 preceding siblings ...)
  2024-03-20  7:55 ` [PATCH v4 4/4] Bluetooth: qca: fix device-address endianness Johan Hovold
@ 2024-03-26 15:30 ` patchwork-bot+bluetooth
  4 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+bluetooth @ 2024-03-26 15:30 UTC (permalink / raw
  To: Johan Hovold
  Cc: marcel, luiz.dentz, andersson, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, cros-qcom-dts-watchers, konrad.dybcio, johan.hedberg,
	quic_bgodavar, mka, dianders, quic_rjliao, dmitry.baryshkov,
	linux-bluetooth, netdev, devicetree, linux-arm-msm, linux-kernel

Hello:

This series was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:

On Wed, 20 Mar 2024 08:55:50 +0100 you wrote:
> 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.
> 
> [...]

Here is the summary with links:
  - [v4,1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken'
    https://git.kernel.org/bluetooth/bluetooth-next/c/ea56aab91231
  - [v4,2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken
    https://git.kernel.org/bluetooth/bluetooth-next/c/c4406d97b78c
  - [v4,3/4] Bluetooth: add quirk for broken address properties
    https://git.kernel.org/bluetooth/bluetooth-next/c/ddaa064664fe
  - [v4,4/4] Bluetooth: qca: fix device-address endianness
    https://git.kernel.org/bluetooth/bluetooth-next/c/ff2ed85c0122

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-26 15:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-20  7:55 [PATCH v4 0/4] Bluetooth: qca: fix device-address endianness Johan Hovold
2024-03-20  7:55 ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Johan Hovold
2024-03-20  8:15   ` Bluetooth: qca: fix device-address endianness bluez.test.bot
2024-03-20 17:11   ` [PATCH v4 1/4] dt-bindings: bluetooth: add 'qcom,local-bd-address-broken' Rob Herring
2024-03-20  7:55 ` [PATCH v4 2/4] arm64: dts: qcom: sc7180-trogdor: mark bluetooth address as broken Johan Hovold
2024-03-22 14:44   ` Bjorn Andersson
2024-03-20  7:55 ` [PATCH v4 3/4] Bluetooth: add quirk for broken address properties Johan Hovold
2024-03-20  7:55 ` [PATCH v4 4/4] Bluetooth: qca: fix device-address endianness Johan Hovold
2024-03-26 15:30 ` [PATCH v4 0/4] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).