Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp994306lqt; Tue, 19 Mar 2024 09:39:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVJj5xsmwhOZvfL8uaIFVAnN2sN80S/pXOR86IJGDm+qCjqZfFAmA3iRX+KsNZMhQvMiH5WuNuumwtOu5HSFak07QPlpx/PBxNqQcUdUQ== X-Google-Smtp-Source: AGHT+IH2lwVEjwKL6HGytXLVZKT9gKuAsgLPD441ZHabjVq9tL/MrrZkXld7mwOU0+dxiVDviL+D X-Received: by 2002:a17:902:d2c4:b0:1de:fbc8:53af with SMTP id n4-20020a170902d2c400b001defbc853afmr15037950plc.25.1710866345335; Tue, 19 Mar 2024 09:39:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710866345; cv=pass; d=google.com; s=arc-20160816; b=ci1hvao3Rp7GaNYrvJX75u3IMXXf6KgRYHvq5er1Hiq1UO+RtqG4/LulaV9LFx5IxK PYhAYffo0+6DMvZ9tH6hHPj1cvEOv7SC+kicw/Gy7VzEQYWzhKRPG7DGqeJ6GViKfsQ8 rxgZ0Sk7ZrQksQI1u02JVxp/HkeJnoRjUjdha4iQHLXFvPiJxkZkcpEKdnliUpU8JBP9 xrMkdKO9XJXB+f5bjs9SD2rtklkDXo0RoCp7oKSNRYBaXe8GPiMHlDP6xR6lyGuW3Lcn mfDf+KsU5SI6pwi3PuA6i5Cfur4ADLJhSQz34kWI0rBnyWQcgoSCtIl9evQXbSxEUwqL 0T/Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=cPgd2zm4EeJXcfO7XG4m2VJ0pNV5g/+txdkKN8Obxp0=; fh=M0fyaM8BbVb1+5JClAzspLSskP8rXZ7GUx86eYNQIiw=; b=y8DesCqSHsRyseI48fy9IFta4lUZvuY1S0MEQdrk380FkwgPJyV/yjKSM6dZUy4BuK M7MvhtGkYQW+3w1SypJHFJpRPZFoBORyabd2x2iYQH9lEknJs7XRjdcxxEV/hq+VIODq HL0bUUf3ogWhzKWkXEt8+fKbKNze9G3EWqf09RSbK6FTY/bDBRiAp+WyBK9ZvJyl0gIz t0J/8HiiQ+t7dgMK2ZW/8ms0EIO/sRw18a7ybonPKuGD66AQZLONDp6P4Ib2FsvjTr09 dK2DyP6k8RP+cDV9rhqR1Ewv/cKG/JLvMvuH4lbkZAxjp0Of8+CZ5LYT5Zo/o+ILDm6d WSRQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pJY+9+pS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-2631-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2631-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id b1-20020a170902d50100b001dd606a64edsi11674380plg.323.2024.03.19.09.39.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 09:39:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2631-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pJY+9+pS; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-bluetooth+bounces-2631-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2631-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E9C702852C6 for ; Tue, 19 Mar 2024 16:39:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3CD410A1C; Tue, 19 Mar 2024 16:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pJY+9+pS" 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 10BF27470; Tue, 19 Mar 2024 16:38:50 +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=1710866331; cv=none; b=n7GEtrU6Dmlo+vxNWVdp0evU16q+28JCA7uVyOlR940fmSZeRF43tsc+Sr0g78mlPI5WYeHUv+wtGBBywkyGl7lBPqHDlnZCz6CDEtZoLb9VccB8WjFrpUehIY1Nd2cMgXMJWGq2ofq9HQ/oNKDkbsRIJUggQDNbTNd/Cz/rhPw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710866331; c=relaxed/simple; bh=dYsylaBpQOp3sMEqxBcd5E0VBO1SUJjmx6IkRhLuU/w=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cNmYiXpgMCopPBR1OZmHmHbyc9um6HsR5Rt85FMZ0MnvFXmR0QXGSalsKALDRuu0PxXxcIp4r7JwKwsQ/uBdpNFiVx3ZNk6EPqQrEJqAjtiDtJ5B+Z+5RbIdzzlZ7oWsDvuQHF4OykUsR9iliXa6dbAJ5b/Mb8gk6h0GZrW0P0w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pJY+9+pS; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81801C43394; Tue, 19 Mar 2024 16:38:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710866330; bh=dYsylaBpQOp3sMEqxBcd5E0VBO1SUJjmx6IkRhLuU/w=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pJY+9+pSarDhpFmWIuEdBfUThaZYx4IzquJlP5O64VzWFDoFioQINcZi4p+yopd6F ErebcMpVyh4KjLRkxscbDd7pdoed6R/I3g9++/WFyZQPcZ8z17rWY3gKGmaeCYZk64 hn+/Y64HGirKPes9zYqyBKvE/jnlNtWaKjws6jjAhQ1G4V31ooEJqiMm4m0c33GZBa 6NWaIKh5JXdu1eel98bZoLAH92veFrGvDHWgbuyrJSiSjmlVz95bjBEweJdwkSCB8T mVKrcpSYzfMonTbtZj6OW2xbxjp/3XC8WWfwU3MvA5UJx3oYj8gJ9VE339DdVziiOI X470z+WxwiZlg== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rmcUK-000000000ul-22u3; Tue, 19 Mar 2024 17:38:57 +0100 Date: Tue, 19 Mar 2024 17:38:56 +0100 From: Johan Hovold To: Doug Anderson Cc: Johan Hovold , Marcel Holtmann , Luiz Augusto von Dentz , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , cros-qcom-dts-watchers@chromium.org, Konrad Dybcio , Johan Hedberg , Balakrishna Godavarthi , Matthias Kaehlcke , 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, stable@vger.kernel.org, Nikita Travkin Subject: Re: [PATCH v3 3/5] Bluetooth: qca: fix device-address endianness Message-ID: References: <20240319152926.1288-1-johan+linaro@kernel.org> <20240319152926.1288-4-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Mar 19, 2024 at 09:10:38AM -0700, Doug Anderson wrote: > On Tue, Mar 19, 2024 at 8:30 AM Johan Hovold wrote: > > > > 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. > > > > Fixes: 5c0a1001c8be ("Bluetooth: hci_qca: Add helper to set device address") > > Cc: stable@vger.kernel.org # 5.1 > > Cc: Balakrishna Godavarthi > > Cc: Matthias Kaehlcke > > Tested-by: Nikita Travkin # sc7180 > > Signed-off-by: Johan Hovold > > --- > > drivers/bluetooth/btqca.c | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > Personally, I'd prefer it if you didn't break bisectability with your > series. As it is, if someone applies just the first 3 patches they'll > end up with broken Bluetooth. It doesn't break the build, but yes, the device address would be reversed for Trogdor machines for two commits and possible break any previous pairings. That's hardly something to worry about. So I consider this to be acceptable for sake of clarity, and especially since these patches will be coming in from separate trees anyway. > IMO the order should be: > 1. Binding (currently patch #1) > 2. Trogdor dt patch, which won't hurt on its own (currently patch #5) > 3. Bluetooth subsystem patch handling the quirk (currently patch #2) > 4. Qualcomm change to fix the endianness and handle the quirk squashed > into 1 patch (currently patch #3 + #4) > > ..and the patch that changes the Qualcomm driver should make it > obvious that it depends on the trogdor DT patch in the change > description. > > With patches #3 and #4 combined, feel free to add my Reviewed-by tag > as both patches look fine to me. I don't think it's worth spending more time and effort on this issue (which should have been caught and fixed years ago) for this. Johan