Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Christian Eggers <ceggers@arri.de>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 6.6.y v2] Bluetooth: HCI: Set extended advertising data synchronously
Date: Thu, 10 Jul 2025 11:27:35 -0400	[thread overview]
Message-ID: <20250709082432-54f63a70d53ba090@stable.kernel.org> (raw)
In-Reply-To: <20250709090551.9089-2-ceggers@arri.de>

[ Sasha's backport helper bot ]

Hi,

✅ All tests passed successfully. No issues detected.
No action required from the submitter.

The upstream commit SHA1 provided is correct: 89fb8acc38852116d38d721ad394aad7f2871670

Status in newer kernel trees:
6.15.y | Present (different SHA1: db2d6aa98a23)
6.12.y | Present (different SHA1: 6e5dc6c4581c)

Note: The patch differs from the upstream commit:
---
1:  89fb8acc38852 ! 1:  2986967377cd5 Bluetooth: HCI: Set extended advertising data synchronously
    @@ Metadata
      ## Commit message ##
         Bluetooth: HCI: Set extended advertising data synchronously
     
    +    commit 89fb8acc38852116d38d721ad394aad7f2871670 upstream.
    +
    +    [This patch deviates from the upstream version because 3 functions in
    +    hci_sync.c (hci_set_ext_adv_data_sync, hci_set_adv_data_sync and
    +    hci_update_adv_data_sync) had to be moved up within the file. The
    +    content of these functions differs between 6.6 and newer kernels.]
    +
         Currently, for controllers with extended advertising, the advertising
         data is set in the asynchronous response handler for extended
         adverstising params. As most advertising settings are performed in a
    @@ net/bluetooth/hci_sync.c: static int hci_set_adv_set_random_addr_sync(struct hci
     +
     +static int hci_set_ext_adv_data_sync(struct hci_dev *hdev, u8 instance)
     +{
    -+	DEFINE_FLEX(struct hci_cp_le_set_ext_adv_data, pdu, data, length,
    -+		    HCI_MAX_EXT_AD_LENGTH);
    ++	struct {
    ++		struct hci_cp_le_set_ext_adv_data cp;
    ++		u8 data[HCI_MAX_EXT_AD_LENGTH];
    ++	} pdu;
     +	u8 len;
     +	struct adv_info *adv = NULL;
     +	int err;
     +
    ++	memset(&pdu, 0, sizeof(pdu));
    ++
     +	if (instance) {
     +		adv = hci_find_adv_instance(hdev, instance);
     +		if (!adv || !adv->adv_data_changed)
     +			return 0;
     +	}
     +
    -+	len = eir_create_adv_data(hdev, instance, pdu->data,
    -+				  HCI_MAX_EXT_AD_LENGTH);
    ++	len = eir_create_adv_data(hdev, instance, pdu.data);
     +
    -+	pdu->length = len;
    -+	pdu->handle = adv ? adv->handle : instance;
    -+	pdu->operation = LE_SET_ADV_DATA_OP_COMPLETE;
    -+	pdu->frag_pref = LE_SET_ADV_DATA_NO_FRAG;
    ++	pdu.cp.length = len;
    ++	pdu.cp.handle = instance;
    ++	pdu.cp.operation = LE_SET_ADV_DATA_OP_COMPLETE;
    ++	pdu.cp.frag_pref = LE_SET_ADV_DATA_NO_FRAG;
     +
     +	err = __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_EXT_ADV_DATA,
    -+				    struct_size(pdu, data, len), pdu,
    ++				    sizeof(pdu.cp) + len, &pdu.cp,
     +				    HCI_CMD_TIMEOUT);
     +	if (err)
     +		return err;
    @@ net/bluetooth/hci_sync.c: static int hci_set_adv_set_random_addr_sync(struct hci
     +	if (adv) {
     +		adv->adv_data_changed = false;
     +	} else {
    -+		memcpy(hdev->adv_data, pdu->data, len);
    ++		memcpy(hdev->adv_data, pdu.data, len);
     +		hdev->adv_data_len = len;
     +	}
     +
    @@ net/bluetooth/hci_sync.c: static int hci_set_adv_set_random_addr_sync(struct hci
     +
     +	memset(&cp, 0, sizeof(cp));
     +
    -+	len = eir_create_adv_data(hdev, instance, cp.data, sizeof(cp.data));
    ++	len = eir_create_adv_data(hdev, instance, cp.data);
     +
     +	/* There's nothing to do if the data hasn't changed */
     +	if (hdev->adv_data_len == len &&
    @@ net/bluetooth/hci_sync.c: int hci_le_terminate_big_sync(struct hci_dev *hdev, u8
      
     -static int hci_set_ext_adv_data_sync(struct hci_dev *hdev, u8 instance)
     -{
    --	DEFINE_FLEX(struct hci_cp_le_set_ext_adv_data, pdu, data, length,
    --		    HCI_MAX_EXT_AD_LENGTH);
    +-	struct {
    +-		struct hci_cp_le_set_ext_adv_data cp;
    +-		u8 data[HCI_MAX_EXT_AD_LENGTH];
    +-	} pdu;
     -	u8 len;
     -	struct adv_info *adv = NULL;
     -	int err;
     -
    +-	memset(&pdu, 0, sizeof(pdu));
    +-
     -	if (instance) {
     -		adv = hci_find_adv_instance(hdev, instance);
     -		if (!adv || !adv->adv_data_changed)
     -			return 0;
     -	}
     -
    --	len = eir_create_adv_data(hdev, instance, pdu->data,
    --				  HCI_MAX_EXT_AD_LENGTH);
    +-	len = eir_create_adv_data(hdev, instance, pdu.data);
     -
    --	pdu->length = len;
    --	pdu->handle = adv ? adv->handle : instance;
    --	pdu->operation = LE_SET_ADV_DATA_OP_COMPLETE;
    --	pdu->frag_pref = LE_SET_ADV_DATA_NO_FRAG;
    +-	pdu.cp.length = len;
    +-	pdu.cp.handle = instance;
    +-	pdu.cp.operation = LE_SET_ADV_DATA_OP_COMPLETE;
    +-	pdu.cp.frag_pref = LE_SET_ADV_DATA_NO_FRAG;
     -
     -	err = __hci_cmd_sync_status(hdev, HCI_OP_LE_SET_EXT_ADV_DATA,
    --				    struct_size(pdu, data, len), pdu,
    +-				    sizeof(pdu.cp) + len, &pdu.cp,
     -				    HCI_CMD_TIMEOUT);
     -	if (err)
     -		return err;
    @@ net/bluetooth/hci_sync.c: int hci_le_terminate_big_sync(struct hci_dev *hdev, u8
     -	if (adv) {
     -		adv->adv_data_changed = false;
     -	} else {
    --		memcpy(hdev->adv_data, pdu->data, len);
    +-		memcpy(hdev->adv_data, pdu.data, len);
     -		hdev->adv_data_len = len;
     -	}
     -
    @@ net/bluetooth/hci_sync.c: int hci_le_terminate_big_sync(struct hci_dev *hdev, u8
     -
     -	memset(&cp, 0, sizeof(cp));
     -
    --	len = eir_create_adv_data(hdev, instance, cp.data, sizeof(cp.data));
    +-	len = eir_create_adv_data(hdev, instance, cp.data);
     -
     -	/* There's nothing to do if the data hasn't changed */
     -	if (hdev->adv_data_len == len &&
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.6.y        |  Success    |  Success   |

      reply	other threads:[~2025-07-10 15:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-06 11:50 FAILED: patch "[PATCH] Bluetooth: HCI: Set extended advertising data synchronously" failed to apply to 6.6-stable tree gregkh
2025-07-07  8:02 ` [PATCH 6.6.y] Bluetooth: HCI: Set extended advertising data synchronously Christian Eggers
2025-07-07  8:11   ` Greg KH
2025-07-07  8:13 ` Christian Eggers
2025-07-08 15:36   ` Greg KH
2025-07-08 15:56     ` Luiz Augusto von Dentz
2025-07-08 21:14       ` Christian Eggers
2025-07-09  6:19         ` Greg KH
2025-07-09  9:05 ` [PATCH 6.6.y v2] " Christian Eggers
2025-07-10 15:27   ` Sasha Levin [this message]

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=20250709082432-54f63a70d53ba090@stable.kernel.org \
    --to=sashal@kernel.org \
    --cc=ceggers@arri.de \
    --cc=stable@vger.kernel.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