Received: by 2002:a05:7412:8d1c:b0:fa:4c10:6cad with SMTP id bj28csp672935rdb; Wed, 17 Jan 2024 13:53:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IFkLnw7v3tO5sOvFiRzYxd0kr4PiK/FIouSUUtI7YVi1nsWDcPACVUh/oSQYWKARqM1MqkG X-Received: by 2002:a17:90a:6c46:b0:28e:8810:d809 with SMTP id x64-20020a17090a6c4600b0028e8810d809mr2171699pjj.48.1705528419594; Wed, 17 Jan 2024 13:53:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705528419; cv=pass; d=google.com; s=arc-20160816; b=QHh+82Ksk6UEcNWY1ze2EkpsT1GO5JvBmn2ROPQ59yT3iP3uiGG3+7vmEodzZfzxbk YteqOt3grjpaEKtrF79lBBYZDZP3MQc8/MSbcIa46qn7qznAehYao8M6Xt0jDO1VMCYW FALp4eAq92Q1Iuzk/xD3lJ1ctIoCTG0Q2tzS0bh+IX2eD53rYJL2nfVjJtKBVzkme28W zjmNbZLRSgy0yt+JtHMyORNKveY38eOolzwwPdVZ0SwHb+Fzk0sHr8qdOhZYveQogozx 5Xqc2lK3X/C9eY8vKQFa+/cmPCrQaiAEikpOlDZbNJTrRxDJ/sIHIKhGmzHkflVhv1+0 SKbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=fgsNp3I1GyR8LKSkgpTGCtUknvU84IXVbgB3bgHNMiQ=; fh=ob2BkF56rz+RgMPcY87jt2hrqv/+rcryP/UXBcE3ixs=; b=ZA4b7rjaJzsv7FEOhAwFPdofWQekU7L3jJ5zK84pmqFyaa9xjYQATuKSj/0FfA21Pj aPKCveHiqeMXN6Zm0SH7zac+5lzlT1fL4dhw31PVJEkG7n75JqTVGBFQ5I0vqxkjza7U ZagmZlb7WfNWuXj89/+qCme/Q54vRXjxrULy2x6UQ8mznVp3h+4Npi5rm7dOSW79/BTK 7SfFFirTABtL00N+s1lx90T8SL2MXx4jzZhSkJtkYZCiWGDLmPudbvqOUjCGpdgQ92J6 7r5q/9THOcRaJp8HXrTpXI8H9cU3ms9lDGWuoReAv8/5DkWJV83c7OxZXgY58AgjXhqo FYCw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3sIgyPcK; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-29474-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id h1-20020a170902704100b001d3e44faf1bsi253133plt.242.2024.01.17.13.53.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Jan 2024 13:53:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-29474-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=3sIgyPcK; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-29474-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-29474-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6839BB25951 for ; Wed, 17 Jan 2024 21:52:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B4492563D; Wed, 17 Jan 2024 21:52:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="3sIgyPcK" Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A83962562E for ; Wed, 17 Jan 2024 21:52:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705528346; cv=none; b=EGEaOM36WkReZ6Mezy6fztNPa8O8r6lnjR/TRANYS+9KRZbc0d05oLDAFrF6PWoY9uALJNTt5u0m1pcwQTrAGz73O99FQ1gaA3qvCcUUsKnQM9NcApUIA7xxBp8fnQTKMkVMmqVkVkuA6HbIOY9rEuGTqtQUN55EKJIc91gS6cM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705528346; c=relaxed/simple; bh=IvStd2xTfDq5Oo+gHa6tUQKtis3gXAShwVPWtd0rtEA=; h=Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Google-Smtp-Source:X-Received:MIME-Version: References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc: Content-Type:Content-Transfer-Encoding; b=k0HhMwFkcsZXUfDzDB3vEhRnEzuyd9KNE/lcmzCQW7KBUNkQ1UMcixlOdsdt9+TaxrbHyXpAtdvUpVT60/wJRU1UlBHtH8W6eHztmZXHMKmpyYeNgF/mcfmCa35/uJsBXT+JwO7MVrmFukevNZApUZRdzND1BaWDuAr1YmjbwiU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=3sIgyPcK; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-40e4afe9ea7so65975e9.1 for ; Wed, 17 Jan 2024 13:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1705528343; x=1706133143; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fgsNp3I1GyR8LKSkgpTGCtUknvU84IXVbgB3bgHNMiQ=; b=3sIgyPcKFiATnmCr4gLRw1tq9VSn2IP+qZK919eCenod9UkRtlC5P56zGLkxpaCV+a GyNUCuklAVdomTHdJ8fueFCo37kmFcgyDZqVZO3dm8e+pvp6/aUSG1GQMIlttfzzARrA Zgonf58FuhDNAhZvSjarE/i2wJEFF+8BSaoLnSxa0HK9aX6wkhD/UVLOYYAkvFHImCRq 7qkjjNHLB4U4ruo4AFbfzvnF8hDU4cEFbRREvWav+eb/jPfQzgP9JN765yd2l/IlP5LU FfFMBdV46pE12wViyfc8np1rRHiOCWv4qnmvigpt2L4P0smNF0AkL6KF8vwqBbnJUYg9 EgOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705528343; x=1706133143; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fgsNp3I1GyR8LKSkgpTGCtUknvU84IXVbgB3bgHNMiQ=; b=vyNIIhFdjUnOkES/TPGoZIQHzk0GTc/gPaI5j55prwOsRlaIwEaCrpPQuNZdXPgPHs sYoOTuOOdS2IK+jLP4JLRP6ZR/h3TB/c96WwjcQ/YItVziltXO7y6xhxD8Iah8IywQMB 6FJ+kV5WGY5bIDuf5qT7+dPaXRzhn2mff+OPQxY/xEKqq3kePFxAgHP7O4wBE99FIE/k xXqcpiq0q3QRmvqMfqG4+6VWjyABGDGlM3xqbEwEnBhFZyhFtQXvTzXF2H/2tHW4aQMu zsOteJMlrc9lHs3t57KkolLY/Dznj6xAEw2DeREiUdI7vYfQgFOdCzOTqQ1ly5kkMjCy Pc3g== X-Gm-Message-State: AOJu0YxG1fW+pd5jQE0aKvNwOkZ2WERJmKUulzPpwNsiYPuMMCdhLDIL Lxdzgj7Vry31brL1mnUWQId/goSqfkEXHR/Klz7cV9M8cgFtuDyslVA/+b5M8ZtmeDrMj6EVjNN 7BeHMm6CCq3sh2IUd+umRZ9L6lS4MSTJy+qNK X-Received: by 2002:a05:600c:310b:b0:40e:61cf:af91 with SMTP id g11-20020a05600c310b00b0040e61cfaf91mr197767wmo.7.1705528342730; Wed, 17 Jan 2024 13:52:22 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231227180306.6319-1-johan+linaro@kernel.org> In-Reply-To: From: Doug Anderson Date: Wed, 17 Jan 2024 13:52:08 -0800 Message-ID: Subject: Re: [PATCH] Bluetooth: qca: fix device-address endianness To: Johan Hovold Cc: Matthias Kaehlcke , 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 , Stephen Boyd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, Jan 10, 2024 at 12:12=E2=80=AFAM Johan Hovold wr= ote: > > > > 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/blue= tooth/local-bd-address > > 00000000 8c fd f0 40 15 dc > > Indeed, this should have been LE order. In case it adds any extra data points, we also do similar with the WiFi MAC address and it also seems to be big endian. lazor-rev9 /proc/device-tree/soc@0/wifi@18800000 # hexdump -C local-mac-add= ress 00000000 8c fd f0 3e 3e 86 |...>>.| 00000006 lazor-rev9 /proc/device-tree/soc@0/wifi@18800000 # ifconfig wlan0 | grep et= her ether 8c:fd:f0:3e:3e:86 txqueuelen 1000 (Ethernet) > > 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 kee= p > > > > working properly. > > > > > > I don't think that would work. If this is something that we really ne= ed > > > to handle, then there's probably no way around introducing new > > > compatible strings for boot firmware that isn't broken while maintain= ing > > > the current broken behaviour with respect to 'local-bd-address' for s= ome > > > 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