Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp830370rdd; Wed, 10 Jan 2024 00:12:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IEHP07P0BzJQa4Q39/0mEvrjwF4i4A6PEDaQ20LM5414D6oaL54ADjECH+tF60l+XMK9m7G X-Received: by 2002:a17:903:26cc:b0:1d4:ebf1:cbb4 with SMTP id jg12-20020a17090326cc00b001d4ebf1cbb4mr445023plb.47.1704874338477; Wed, 10 Jan 2024 00:12:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704874338; cv=none; d=google.com; s=arc-20160816; b=XccKtgr+doCwP6qimY70vEIX9xxTc9qmcKAsQbZeHW1pxVJu13iCY7GgreONtJM+pn i+8LNNAwQGzd6wWJ8AckF1qfBW/lA4MFZbOXMzjXLpkX21QtBfA803iCyzersveyoNrj y2mENiTKfr5VkV+j3dLs3dCMdisWBZa/ehmjEtcTVoQWoWt2TddA6wqaBv0O4ActSPvh pspV50zMOgYknY7fRYHMWpw+boARxRm3lzBPZiZsOAGEksYYXCJ2mnjkzTGbZlxGlAUS 6eNZs3YwesXZxck9F1xlnqayb9tcXgqFRuC5EpGoqQumfwh/upLfqqyJRzPR9IdQtw/0 pf9w== 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=FA+7AM1TUWnoqMIJ9201esBUOssj1moV8W5bZju6qCM=; fh=Mk54D4bFX8E5Qwxxs2vmFBN2V8SMEk0TiLRhUKQ7hVI=; b=k3nkEFL0mDvYzd79SCCb3mNmS24kxcj+r2Mba0pnkc5Aa7JZUJfXtkEZIOFg/jg5gi 9qu5yKMgBRLpXGo8Nni/sTAQEnhtYak8M8HjbZ2euGhTIvuywXZ6rVc1JDoPTTutuLzI uyMVEKPvffKx3k6h3ZLbJ60TH4rhl9Ok1C2NpTdU/4dk8TyN72pyQXE1TV4PdZktN1Su rIcmbe2a5LaryCksqwRrBKgf4xC0InsALUJ/v93TM1XQtaNaI40PROu6fgIKqUkMpQWW u3YnjRLbKUCtuEnaHLOThf5ptYIglB4jkvioHdJwAV6/LHVgsGFfMbwu+qddKkEoHPva 55ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SQlp1VWr; spf=pass (google.com: domain of linux-bluetooth+bounces-1020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1020-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. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id jc3-20020a17090325c300b001d3e11d5cf4si3071154plb.109.2024.01.10.00.12.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 00:12:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-1020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SQlp1VWr; spf=pass (google.com: domain of linux-bluetooth+bounces-1020-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-1020-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 2A60B288487 for ; Wed, 10 Jan 2024 08:12:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A674F3DBBF; Wed, 10 Jan 2024 08:12:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SQlp1VWr" 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 065753EA70; Wed, 10 Jan 2024 08:12:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BB37C433F1; Wed, 10 Jan 2024 08:12:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704874326; bh=R1kRyvFyie9bKSVcbmLw40Yht8pGWPEU2b8QAHOxWHQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQlp1VWrNtN5sqOM/Q21XGCkCRIJ51Cm9y4InIlGy6zFI1LtK9h1hKXQuIZu+Aknu Mqp6WcYpif4RMZi3CvhSAL/4fsysfOi6Cif/njrdgAcgti+OxL1uBZ2Ls8AJTUhzMy e6uDISvtKraYM7U/8/kLuIPoPKFSs/KOUdqA6ndeQH6P+PJRUBHspDEyUJ74MpKhTi j7wmFeZUJR9WBt7KMIP/l0BOjqjhYP21f43dOxOSx+Nf8T7jP1F5abcPxRBhkSo655 KzM0FNx4SD5wIW2Gy2CoWr9kNyZjtZhAvTC3S03bs0SC8kpy5TEP/Ja/JZ0kRdLn5x LzMJi9ttPpf7w== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from ) id 1rNTh0-0007J5-21; Wed, 10 Jan 2024 09:12:07 +0100 Date: Wed, 10 Jan 2024 09:12:06 +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 05:54:01PM +0000, Matthias Kaehlcke wrote: > On Tue, Jan 09, 2024 at 06:12:26PM +0100, Johan Hovold wrote: > > 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? > > Yes, (at least) the boot firmware for sc7180-trogdor devices. > > hexdump -C /proc/device-tree/soc\@0/geniqup\@8c0000/serial\@88c000/bluetooth/local-bd-address > 00000000 8c fd f0 40 15 dc Indeed, this should have been LE order. > hciconfig > hci0: Type: Primary Bus: UART > BD Address: 8C:FD:F0:40:15:DC ACL MTU: 1024:8 SCO MTU: 240:8 > UP RUNNING > RX bytes:1700 acl:0 sco:0 events:95 errors:0 > TX bytes:128949 acl:0 sco:0 commands:578 errors:0 And any user space tool overriding the address would currently need to provide the address in reverse order on Qualcomm platforms like this one (e.g. if generating the address for privacy reasons). > > > 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. > > I think it should work for sc7180-trogdor. For these devices the device tree > is bundled with the kernel image and can be updated. That might not be true > for other devices though. Thanks for confirming. I'm still hoping we can get away with not having to add quirks to Bluetooth core for broken Qualcomm boot firmware. Let's see if anyone knows of a use case that makes that impossible to avoid. Johan