Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp460273rdd; Tue, 9 Jan 2024 09:13:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEwwiAx4xwGS6gcfGVlAo3POFOBQd1VceLMAJBa8taGa0GzEqjuv6kBPoeAjDbH+1J/1N+y X-Received: by 2002:a17:906:528e:b0:a28:ce96:4574 with SMTP id c14-20020a170906528e00b00a28ce964574mr779755ejm.46.1704820385937; Tue, 09 Jan 2024 09:13:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704820385; cv=none; d=google.com; s=arc-20160816; b=tswgAhM1KecEVsdbY+oFhhpyPP/WfGKrlOsrehBqqMFzNKJvJIky0rBTLnTdQg5woa OHBRG7gn1nKIMrO8y3ToytTzvaVJIkeJxeVpC9fA7XCZdqurwGCtlE3WSv90cNPkgfab eUWfjhpvC3IYvNx/97XwHrVC8DC1wzyDJwUqSVZSW8ibNVgos/Ef0MPVDDkzTEFDi740 NpUgRlFDTniKDxClnTe/lsHMWUDDjstBiT+nPTEx9o/cEJdXgPERp+DT4M4Yj3kU8aMf vKAjRLVGkzsgyDqGLad0gQY5McBkSgXL6LKhtl1xwuomRvyuVz8ORVq7Le049LfOuvSE piRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1zo5sQHGa8K6SkKJv15qKWEPhB2arrlgllS4Fs1kMAY=; fh=Mk54D4bFX8E5Qwxxs2vmFBN2V8SMEk0TiLRhUKQ7hVI=; b=O+a892gwt15/NyIlYYAg+PZkY4S2537RspZHT/ViED3wJOh9E6Qli0RhU0eNb0qbiI 1nWrwAg7x4/l/OK2mwTcSfsUyGcOkXyysYYqIrp2/YyIvx/AVBWLS9Bx7wNoc+RqKjzG G7jY9hbUFsOgaazX+Xjvt6xzYInc4DFms0qaVZ7RFX+SYHHSzdAlyVihj1utiaBGx30K LjKFo/kg20c0UzrtqkrhbAvXzBx+DnM+cEAOc+n9cx43TYzspMMpWaDBRe8eEz2bpOSt dqOP3JUKjwFV+rkqnuejJjqS5/R90Um+xg2K6015geNc35MvlcpnRIieQm4Fk6ER3B5x XWiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nMjAqNkO; spf=pass (google.com: domain of linux-bluetooth+bounces-1000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1000-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 s4-20020a170906354400b00a2b0c74244csi942051eja.122.2024.01.09.09.13.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 09:13:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1000-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=nMjAqNkO; spf=pass (google.com: domain of linux-bluetooth+bounces-1000-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1000-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 ABD451F247EF for ; Tue, 9 Jan 2024 17:13:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE0FE3B2A2; Tue, 9 Jan 2024 17:12:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nMjAqNkO" 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 19E9D3A8DC; Tue, 9 Jan 2024 17:12:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82155C433C7; Tue, 9 Jan 2024 17:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704820347; bh=R68MSDBYhZXBw3JD8klsX3dJnjsUWkASMAeLu74RGAM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nMjAqNkOT8bGrVlAgY2467bcJ4tXSA624As8/+CoYze0gJLu1e1yk+CJ6waXbTOoh YXP8M+3w8gr6cKZKA9FDWXBn/XxD4IxvhW8E7OALTRrF3ik99qPfFGg9r2925ww9c1 ttssWGQ3Oqsr+ctV2+0izp2L9rpiDx3ls/Y64uE9oU7mxRxUpdhDtJzT4crTnpBRx4 KUTEZkcvZzMkki1TjdoAty9aGYAzL4XAm4h1aEX31KjLdXUlCQzMLGqdoxsk7jgffn JOd+4I+pbwD1ftitAA1FM+cSdmF/6egwP8c9NiQg7ONTkgwEufeTOV1nMT7kQOXTwI Pdpa+N1HPFKDA== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rNFeM-0005Ty-0f; Tue, 09 Jan 2024 18:12:26 +0100 Date: Tue, 9 Jan 2024 18:12:26 +0100 From: Johan Hovold To: Matthias Kaehlcke Cc: Johan Hovold , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Bjorn Andersson , Konrad Dybcio , linux-bluetooth@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Balakrishna Godavarthi , Doug Anderson , Stephen Boyd Subject: Re: [PATCH] Bluetooth: qca: fix device-address endianness Message-ID: References: <20231227180306.6319-1-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=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Jan 09, 2024 at 04:50:59PM +0000, Matthias Kaehlcke wrote: > On Wed, Dec 27, 2023 at 07:03:06PM +0100, Johan Hovold wrote: > > The WCN6855 firmware on the Lenovo ThinkPad X13s expects the Bluetooth > > device address in MSB 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 LSB 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 MSB order. > > We should not break existing devices. Their byte order for > 'local-bd-address' may not adhere to the 'spec', however in practice > it is the correct format for existing kernels. That depends on in what way the current devices are broken. Any machines that correctly specify their address in little-endian order in the devicetree would no longer be configured using the wrong address. So no problem there (except requiring users to re-pair their gadgets). And tools like btgmt is broken on all of these Qualcomm machine in any case and would now start working as expected. So no problem there either (unless user space had adapted an inverted the addresses to btmgmt). So the first question is whether there actually is any boot firmware out there which passes the BD_ADDR in reverse order? > I suggest adding a quirk like 'local-bd-address-msb-quirk' or > 'qcom,local-bd-address-msb-quirk' to make sure existing devices keep > working properly. I don't think that would work. If this is something that we really need to handle, then there's probably no way around introducing new compatible strings for boot firmware that isn't broken while maintaining the current broken behaviour with respect to 'local-bd-address' for some of the current ones. Johan