Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1305666lqm; Thu, 2 May 2024 10:33:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1EEx05cGZELPnMYvIOaTMYb3FNS2KDB+w+zSwAgYNlcorcVWyNHdSFrDUvTz7GlgNdKI0QUPMYqDMtoIO+THFTFtGF5pWdz6j39rIIw== X-Google-Smtp-Source: AGHT+IE/yuWGzA4Hk32JFBDf05M4bk4LaIeRkYoeD78Oq42bAMK3yCLuyFpBWAv/qoNqfoy8+3vi X-Received: by 2002:a05:6a20:a105:b0:1ad:7ff5:cb38 with SMTP id q5-20020a056a20a10500b001ad7ff5cb38mr450267pzk.60.1714671184414; Thu, 02 May 2024 10:33:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714671184; cv=pass; d=google.com; s=arc-20160816; b=e4O0NaUiEQ6I7U5Ds3o71Cs/rg4upvUKF3kr/mYF/s19wHQdJttbQpErYLDynitxCZ JDhBZ3DvJfSopWdTVwuYNC3P3km496vpyglSdpwOMzRjqJjNhB7WVk3s3vXFNVCYxPLJ cWbZ7bHQOZ+gunaXxL5nQnsYjxs9H80tBafhkQ3r/ai9zeeCuyZlHut5oJnBBFF2cncA VyfSJ7n2niKVjXqjthf+f4PXRXrwQm7cj6pRXMIzgr8zJMSvla0YD1eALnnoQUOA9WEW Yau+Xl5QV1Pe/tQoEOnNApq/MoQNP3Jiip7miBUq4G8qMjOzVIh2IQhHk3UYijB1SirE fcmQ== 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=hzDPMLK50g1/uZWi+ccEKF7L+IuktgQW6zVbM/w/fwo=; fh=OwVovmjktTb+a77AvM6y3W3YP+h62MEJpt9FtVnA650=; b=c+RwXTcboIrUfng3qs+QkSrEv3nDBmTBXvcUn2hgw8qmuMsEu9Ksmm3pP8lfX+sLse YycbnYhm3Jb8060ZMwwAUMWJCH0rwXhcqzD6LekXRzpWqSxETZpV4c3P+6X9SRQsJ8tm YzRJqe3XG7TQnVUFoUEFVAk0usNGTiTBMJ9RVQe4M/FVG86X1if17H+8O/wTBdiHGqwH T95Z8i8dOgOczxI1LsE7E773njDKgBG0f+3lL6K/8+0l9u7WJ+4z1RPJ5elvIIC1BwJt srEeHlkQpEptVSVFhGsbi1SlwjQoFRq+qeLcwaUUmGnn6lFqFEskhvOEktI2zlnsJEcO Ki4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=a0Zx2djf; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4282-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bx38-20020a056a02052600b005f8062d3808si1469518pgb.105.2024.05.02.10.33.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 10:33:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4282-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=@gmail.com header.s=20230601 header.b=a0Zx2djf; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4282-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4282-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id BB59F28C256 for ; Thu, 2 May 2024 17:33:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFCCD16FF58; Thu, 2 May 2024 17:32:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="a0Zx2djf" X-Original-To: linux-bluetooth@vger.kernel.org Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 BF37916FF43; Thu, 2 May 2024 17:32:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714671175; cv=none; b=jWD6BQuu/mZPoG9GAERsYQP01oWPrm+xjLQFOd2a/vjI0/VrqQ3E2dOuJhzF966y5OAqPVaIghcbfk3M225h0oAkrvjkgfLAZD25OlpfMRopW9rsHGD2iBtjcWly97+p/3NeI2rrogLNZofOx070iz7k0QAGbE8JUanfLMPk3QI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714671175; c=relaxed/simple; bh=hzDPMLK50g1/uZWi+ccEKF7L+IuktgQW6zVbM/w/fwo=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pREBcx21CJvcs56AKLFJZ5UikxT83I/Ipwyj8Dpivwwvpp9KXUcZ14tiWYHd7N4hcGaIxcXXUEs+p5Sx3OEMozy5T1+efmgX/bHinprsMdEF3IlYVYyPuUszqNb/2ijJLRHwEbZW94sj6lBBdvvvk1PY5bwDjq+t/Um8hcK/5h4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=a0Zx2djf; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-2dd041acff1so97866181fa.1; Thu, 02 May 2024 10:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714671172; x=1715275972; 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=hzDPMLK50g1/uZWi+ccEKF7L+IuktgQW6zVbM/w/fwo=; b=a0Zx2djfVXQ1Fcy23MGbzYauJ1gDChb0LIvem/m6ogLRn3HEkZ3c+tvssmBltqo0qA XJLKr3AMogbNj0OhG22ng0DUns3YEogVVV6hOIfV3TtPV49G1wih8C+mvBrjg/t4Wjxl 7T48HKngq777iGRznTQD7zcy9xeMDP2tyllhyRJ07DWznes4+QYpa6Es94VJ4uc6Ml3R a0Sgyyl70zJT6I2vA6nbyT9m/Ppx1SiRs9TYEg20BN1s4p4TXdWqnKsJ7r/jqphlvcwb JfTi2xpweqDARTtQVOYwCcbHXqdaBIYifz6b5fcs2ApZmM0mMX45AV7elC6EUTpAlHSJ UgZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714671172; x=1715275972; 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=hzDPMLK50g1/uZWi+ccEKF7L+IuktgQW6zVbM/w/fwo=; b=kv9J02MSdJrnhfJZESiwvQ7tjjdsTkSguCcmExg3Z9D/j62Y7zUSS7jYu+Jm3RhOWz jbJFSMC03dNTTEH015HPsNiJ9B7Q5sz8TsW1iak1nIg2eZdNS7WOYcIsiTtjoon4YX/u h1kDCRE024qPdtZSg0tc1va7IPKTadT3XAPnDRV8poJ3W4DIYAqm+5m+fF0MPSqW21bo +ZbpWKrue9Uj1hsfenCrNZClgcs09G1SpxG51IyBiPLqQyyUrnXY2NiqBwedKwqC6btd T/c7IiLSFcOZTolOrw+D1BzMHsIJqTMwA2MuD2JETVwr/kolTtwDH+B0yX4FaTFmacPl 4pSQ== X-Forwarded-Encrypted: i=1; AJvYcCXyBG2BzXgjsad4hIRzerd3tvjOYDIXye8r9eP2casTpXrf5C36KsHkI7c8zRqaxNJEw4EtaCaSypxxOSqCpAdbYysajMkQlbWvvFQumsMhzSL7W/gSAJpSEcx/JO8z9Tpht/eVz42kr7yjX/DbY6AenE1DjkxzdsSWYGXqh5rlDP8Ep8tI X-Gm-Message-State: AOJu0YzH9qJbbr8NyNm6SOu5aIdskYWsCmD4kO9rJ6xqmJ81j3MBAu67 nWjsz82PjdqfzxkUpsqIiORcTIbuXuCDR4K8ITy22AMExDA0rLWx9FdU130dYx/qVAG5sNwjX/+ u42uyrxis9ytXl2E3ncUSPajg2i0= X-Received: by 2002:a2e:7d07:0:b0:2de:809c:c67b with SMTP id y7-20020a2e7d07000000b002de809cc67bmr234714ljc.24.1714671171615; Thu, 02 May 2024 10:32:51 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <9eebd77b-c070-4260-a979-9b97f14eb5b1@quicinc.com> <1feddcbc-205d-4c9b-bde2-7a2daace71a9@quicinc.com> In-Reply-To: <1feddcbc-205d-4c9b-bde2-7a2daace71a9@quicinc.com> From: Luiz Augusto von Dentz Date: Thu, 2 May 2024 13:32:38 -0400 Message-ID: Subject: Re: [PATCH] Bluetooth: qca: generalise device address check To: Janaki Ramaiah Thota Cc: Johan Hovold , Doug Anderson , Johan Hovold , Marcel Holtmann , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, quic_mohamull@quicinc.com, quic_hbandi@quicinc.com, quic_anubhavg@quicinc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Janaki, On Thu, May 2, 2024 at 1:03=E2=80=AFPM Janaki Ramaiah Thota wrote: > > Hi Johan, > > On 5/2/2024 3:41 PM, Johan Hovold wrote: > > On Thu, May 02, 2024 at 12:35:19PM +0530, Janaki Ramaiah Thota wrote: > >> On 4/30/2024 6:37 PM, Johan Hovold wrote: > > > >>> But here we disagree. A non-unique address is not a valid one as it w= ill > >>> cause collisions if you have more than one such controller. > >>> > >>> I understand that this may be convenient/good enough for developers i= n > >>> some cases, but this can hurt end users that do not realise why thing= s > >>> break. > >>> > >>> And a developer can always configure an address manually or patch the > >>> driver as needed for internal use. > >>> > >>> Are there any other reasons that makes you want to keep the option to > >>> configure the device address through NVM files? I'm assuming you're n= ot > >>> relying on patching NVM files to provision device-specific addresses > >>> after installation on target? > > > >> We prefer unique address to be flashed on OTP (persistent) memory of > >> BT-Chip, which is supported by almost all QC BT-chips. > > > > Yes, that is certainly the best option for everyone. > > > >> If someone is not able to do that/ does not prefer that, they still > >> have an option to flash unique address in firmware binary (NVM)file. > >> This does not require setting BD address from user space. > >> > >> Also until a developer flashes OTP/ keep unique BD-Address in NVM, > >> he should be able to run most of the use cases from Device, that's > >> why we want to make it as configured. > > > > Ok, but a developer can still do this since they can patch the driver t= o > > disable the check temporarily or, alternatively, just update the > > devicetree with a valid unique address. > > > >> In our opinion this provides best Out of box experience. > > > > If a developer has to patch a code/update device-tree, that is not > a "out of box" experience. By "out of box" we meant, things should > work without much changes required. > > > You can also look into improving support in user space (e.g. bluez) for > > providing a valid unique address in a simple text-based configuration > > file. > > > > We don't think putting a must-have dependency in user space is the > right thing to do, especially when we own a code in kernel space. > > > That would be useful for all Linux users and not require having access > > to Qualcomm specific tools to update the NVM configuration file (which > > could also be in a read-only file system, e.g. on Android). > > > > Having a non-unique valid address allows a developer to handle all > scenarios where he/she is dealing with DUT + commercial device and > in such case, default BD-Address from nvm file should also be okay. > Only when 2/more similar devices are in the mix, they need unique > address. In that case we are providing end developers with a NVM > utility(part of Qcom build Not open source tool)to change this > default BD-Address. And we don't agree with doing that, that is why the controller shall be marked as unconfigured when a non-unique address is used and if you insist in doing that I will probably have to escalate that you guys are intentionally using addresses that can clash over the air. If the firmware is intended for developer, it shall be kept private, public firmware shall never use duplicate addresses, ever, and don't come back with arguments like that only when 2/more similar devices are in the mix but that would just stress even more the point that you are breaking stuff _on purpose_, which is pretty bad by itself, and then suggesting to use a non-open-source tool to fix the address is making things worse because end users can be affected by this, that really fills like you don't care if your hardware works on regular Linux distros and in that case I will probably move it to driver/staging. > > Johan > > -Janaki Ram --=20 Luiz Augusto von Dentz