Linux bluetooth development
 help / color / mirror / Atom feed
From: Simon Mikuda <simon.mikuda@streamunlimited.com>
To: linux-bluetooth@vger.kernel.org
Cc: Simon Mikuda <simon.mikuda@streamunlimited.com>,
	Marcel Holtmann <marcel@holtmann.org>,
	Luiz Augusto von Dentz <luiz.dentz@gmail.com>
Subject: [PATCH] Bluetooth: hci_event: Terminate PA sync transferred while not pending
Date: Sun, 22 Nov 2026 21:13:19 +0100	[thread overview]
Message-ID: <20261122201320.2851760-1-simon.mikuda@streamunlimited.com> (raw)

hci_le_past_params_sync() sets the PAST parameters of the ACL connection
so the controller synchronizes to the PA train transferred by the peer,
but nothing resets them once the PA sync has completed, so a later
transfer from the same peer is synchronized to as well.

HCI_LE_Periodic_Advertising_Sync_Transfer_Received is then received
with no connection having HCI_CONN_CREATE_PA_SYNC set and is only
logged, leaving the sync established in the controller, using its
resources, without the host knowing about it. Terminate it instead.

Fixes: 33b2835f0b7e ("Bluetooth: HCI: Add initial support for PAST")
Signed-off-by: Simon Mikuda <simon.mikuda@streamunlimited.com>
---
 net/bluetooth/hci_event.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 039bcea98a5a..4b8fd3bfeba4 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -6279,6 +6279,12 @@ static void hci_le_past_received_evt(struct hci_dev *hdev, void *data,
 		bt_dev_err(hdev,
 			   "Unable to find connection for dst %pMR sid 0x%2.2x",
 			   &ev->bdaddr, ev->sid);
+		/* No PA sync is pending, the PAST parameters are just left
+		 * set from a previous one, so terminate the sync instead of
+		 * leaving it behind in the controller.
+		 */
+		if (!ev->status)
+			hci_le_pa_term_sync(hdev, ev->sync_handle);
 		goto unlock;
 	}
 

base-commit: 4fe38719e6738feaa90486e36b0790dd5d960a96
-- 
2.43.0


             reply	other threads:[~2026-11-22 20:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-22 20:13 Simon Mikuda [this message]
2026-11-22 22:54 ` Bluetooth: hci_event: Terminate PA sync transferred while not pending bluez.test.bot

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=20261122201320.2851760-1-simon.mikuda@streamunlimited.com \
    --to=simon.mikuda@streamunlimited.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.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