Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp105247ybc; Mon, 18 Nov 2019 21:18:15 -0800 (PST) X-Google-Smtp-Source: APXvYqyuQT/SExTu4YzTXpa80uaNhGZAMHvhqPSAvBPGoTkYtcrOn6RAq7IuN1Tj7FUi0/cmvQ/i X-Received: by 2002:a17:906:c57:: with SMTP id t23mr32195199ejf.240.1574140695195; Mon, 18 Nov 2019 21:18:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574140695; cv=none; d=google.com; s=arc-20160816; b=hqH0u+w/ZVvJM7+ub3fGVgCob3GFSvlUhFJRVeAjiy30sFFA9HxZ+fK8PR0ygWPPcF 4sa5sKAWF2TjBklsxN7tjd8tBseYg0Z0YEZydvj51ttqzd/NMFGGk5M44gulwUE6ojhY DLE8i682TVWnrvO26/t4+xf+jwPYw6ha44p8MXMDAdRvcapMtwg/zu0h7vlfRWP9FxMg jsb8m+HmDhBGRg1mP3Noou6zTH5qNbZKed/tVlKlYT+P+C2qjQbTpiR2HoxW93HrU25d u+g5KVgY5Mvd/QAGTl/B/DLD8CLiUK0fnk2JTDZwumjvPZpXxalfxN02a87eg+xjPT/F Bz/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=pCqb3QUXc/j1lEDFY60PcuayFCGmGwP98nPuhuLk6Q8=; b=ue6bIsectKY6iDwEMKVkxf1WH5gMl/tbwLIuue5DiKpxTIaHF2fU2zIPAOjU3jZyzx 5PFw1ie0d7vntfTmfdeaaXLj3OOQjGOAaIMH9R/slAmYo8iXqEBA++/1r2D2/9HER4++ y6bllnpzzkrSe0AW6ITEitIuNr4S0hoyHfUEWrSDirCKOgtirvyRPAdLt7+Pm7H0jN9t fi/D0oYjteN4/Hy3HBxaLP2KLXz55FcoYpeTxxHxgX+lpk1MRREA18YJYcyk3Mw9hYOd AbBG9egXLlzDZs6+LwsVJV/btLIWCpacVfvrNeQXLyUTjJytaRTbPc0f3ngcBb/jKw1b je1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p37si14389046eda.405.2019.11.18.21.17.44; Mon, 18 Nov 2019 21:18:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726840AbfKSFRf convert rfc822-to-8bit (ORCPT + 99 others); Tue, 19 Nov 2019 00:17:35 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:33642 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726836AbfKSFRf (ORCPT ); Tue, 19 Nov 2019 00:17:35 -0500 Received: from marcel-macbook.holtmann.net (p4FF9F0D1.dip0.t-ipconnect.de [79.249.240.209]) by mail.holtmann.org (Postfix) with ESMTPSA id 28E48CECED; Tue, 19 Nov 2019 06:26:40 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3601.0.10\)) Subject: Re: [PATCH] bluetooth: bcm: Set HCI_QUIRK_USE_BDADDR_PROPERTY for default addresses From: Marcel Holtmann In-Reply-To: <20191118124930.2138112-1-a.heider@gmail.com> Date: Tue, 19 Nov 2019 06:17:33 +0100 Cc: Johan Hedberg , linux-bluetooth@vger.kernel.org, Ondrej Jirman , Jernej Skrabec Content-Transfer-Encoding: 8BIT Message-Id: References: <20191118124930.2138112-1-a.heider@gmail.com> To: Andre Heider X-Mailer: Apple Mail (2.3601.0.10) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Andre, > Some devices ship with the controller default address, like the > Orange Pi 3 (BCM4345C5). > > Allow the bootloader to set a valid address through the device tree. > > Signed-off-by: Andre Heider > --- > drivers/bluetooth/btbcm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c > index 2d2e6d862068..e1471777486e 100644 > --- a/drivers/bluetooth/btbcm.c > +++ b/drivers/bluetooth/btbcm.c > @@ -79,7 +79,7 @@ int btbcm_check_bdaddr(struct hci_dev *hdev) > !bacmp(&bda->bdaddr, BDADDR_BCM43341B)) { > bt_dev_info(hdev, "BCM: Using default device address (%pMR)", > &bda->bdaddr); > - set_bit(HCI_QUIRK_INVALID_BDADDR, &hdev->quirks); > + set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hdev->quirks); > } I am not sure the change is this simple. What happens if you run on a boot-loader that doesn’t provide the address and has an invalid address. When I allowed HCI_QUIRK_USE_BDADDR_PROPERTY to be added, I stated clearly that the intent was that userspace can handle the address setup and this was pretty much just for the existing hardware where we have some magic boot-loader to do this. Anyhow, I am fine allowing this here as well. However the HCI_QUIRK_USE_BDADDR_PROPERTY needs to be set unconditionally in the hdev->setup routine. And in case there still is an invalid address we need to stick with invalid address. Right now the code in hci_dev_do_open() operates differently. Regards Marcel