mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Johan Hovold <johan+linaro@kernel.org>,
	Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Cc: Matthias Kaehlcke <mka@chromium.org>,
	linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: hci_bcm: do not mark valid bd_addr as invalid
Date: Fri, 2 Jun 2023 10:47:28 +0200	[thread overview]
Message-ID: <428e37b4-7fb6-7026-8ad9-91218b034a12@samsung.com> (raw)
In-Reply-To: <20230602081912.4708-1-johan+linaro@kernel.org>

On 02.06.2023 10:19, Johan Hovold wrote:
> A recent commit restored the original (and still documented) semantics
> for the HCI_QUIRK_USE_BDADDR_PROPERTY quirk so that the device address
> is considered invalid unless an address is provided by firmware.
>
> This specifically means that this flag must only be set for devices with
> invalid addresses, but the Broadcom driver has so far been setting this
> flag unconditionally.
>
> Fortunately the driver already checks for invalid addresses during setup
> and sets the HCI_QUIRK_INVALID_BDADDR flag. Use this flag to indicate
> when the address can be overridden by firmware (long term, this should
> probably just always be allowed).
>
> Fixes: 6ac517d8cf8b ("Bluetooth: fix use-bdaddr-property quirk")
> Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Link: https://lore.kernel.org/lkml/ecef83c8-497f-4011-607b-a63c24764867@samsung.com
> Signed-off-by: Johan Hovold <johan+linaro@kernel.org>

Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

> ---
>   drivers/bluetooth/hci_bcm.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
> index 83bf5d4330c4..874d23089b39 100644
> --- a/drivers/bluetooth/hci_bcm.c
> +++ b/drivers/bluetooth/hci_bcm.c
> @@ -643,7 +643,8 @@ static int bcm_setup(struct hci_uart *hu)
>   	 * Allow the bootloader to set a valid address through the
>   	 * device tree.
>   	 */
> -	set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks);
> +	if (test_bit(HCI_QUIRK_INVALID_BDADDR, &hu->hdev->quirks))
> +		set_bit(HCI_QUIRK_USE_BDADDR_PROPERTY, &hu->hdev->quirks);
>   
>   	if (!bcm_request_irq(bcm))
>   		err = bcm_setup_sleep(hu);

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland


  reply	other threads:[~2023-06-02  8:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20230602081950eucas1p22a82f91f361fb64e23ecddada3173534@eucas1p2.samsung.com>
2023-06-02  8:19 ` Johan Hovold
2023-06-02  8:47   ` Marek Szyprowski [this message]
2023-06-02 20:30   ` patchwork-bot+bluetooth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=428e37b4-7fb6-7026-8ad9-91218b034a12@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=johan+linaro@kernel.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=mka@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®