Linux bluetooth development
 help / color / mirror / Atom feed
From: Kyle Pepper <cochcoder@proton.me>
To: linux-bluetooth@vger.kernel.org
Cc: luiz.dentz@gmail.com
Subject: [RFC PATCH v5] Bluetooth: l2cap: prefer compatible local LE intervals
Date: Tue, 24 Nov 2026 14:04:18 +0000	[thread overview]
Message-ID: <20261124140405.3096828-1-cochcoder@proton.me> (raw)
In-Reply-To: <b6847b841127362e423b49f9e48118f97985865d.1795497229.git.cochcoder@proton.me>

Prefer the intersection of a valid peer interval range and local
preferences when they overlap. Otherwise retain the peer request
instead of treating an initial preference as a hard supported bound.

Validate the original request before narrowing its interval range.
Leave latency, timeout and disjoint-range acceptance unchanged.

OpenCode and Codex assisted with source review, tests and wording.

Signed-off-by: Kyle Pepper <cochcoder@proton.me>
---
Changes in this revision: disclose AI assistance in the changelog.
No source changes.
Previous version: https://lore.kernel.org/r/b6847b841127362e423b49f9e48118f97985865d.1795497229.git.cochcoder@proton.me/

GCC/Clang W=1 builds and source-extracted sanitizer tests passed.
Fresh native interval/VM/controller tests were unavailable.
Policy acceptance and interoperability remain open.

diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index 943effc86..4f4625b97 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -5089,6 +5089,17 @@ static inline int l2cap_conn_param_update_req(struct l2cap_conn *conn,
 	memset(&rsp, 0, sizeof(rsp));
 
 	err = hci_check_conn_params(min, max, latency, to_multiplier);
+	if (!err) {
+		u16 pref_min = max_t(u16, min, hcon->le_conn_min_interval);
+		u16 pref_max = min_t(u16, max, hcon->le_conn_max_interval);
+
+		/* Local preferences must not reject a valid peer request. */
+		if (pref_min <= pref_max) {
+			min = pref_min;
+			max = pref_max;
+		}
+	}
+
 	if (err)
 		rsp.result = cpu_to_le16(L2CAP_CONN_PARAM_REJECTED);
 	else

base-commit: ffb95458a0f70dcab620eee0ecf5ef7750971b2f


      parent reply	other threads:[~2026-11-24 14:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13  3:31 [RFC PATCH] Bluetooth: l2cap: honor local LE connection interval range Kyle Pepper
2026-10-13  4:26 ` [RFC] " bluez.test.bot
2026-10-13 14:33 ` [RFC PATCH] " Luiz Augusto von Dentz
2026-10-15 18:12   ` cochcoder
2026-10-15  4:34 ` [RFC PATCH v2] Bluetooth: l2cap: prefer compatible local LE intervals Kyle Pepper
2026-10-15  7:12   ` [RFC,v2] " bluez.test.bot
2026-10-15 18:11   ` [RFC PATCH v3] " Kyle Pepper
2026-10-15 20:17     ` [RFC,v3] " bluez.test.bot
2026-10-31 18:09     ` [RFC PATCH v3] " cochcoder
2026-11-06  2:18     ` [PATCH 1/1] Bluetooth: reject invalid LE supervision timeout relationships Kyle Pepper
2026-11-06  3:26       ` [1/1] " bluez.test.bot
2026-11-06  4:28       ` [PATCH 1/1] " cochcoder
2026-11-06 16:28       ` Luiz Augusto von Dentz
2026-11-06 17:24       ` [PATCH v2 " Kyle Pepper
2026-11-06 20:20         ` patchwork-bot+bluetooth
2026-11-24  5:23     ` [RFC PATCH v4] Bluetooth: l2cap: prefer compatible local LE intervals Kyle Pepper
2026-11-24  7:00       ` [RFC,v4] " bluez.test.bot
2026-11-24 14:04       ` Kyle Pepper [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=20261124140405.3096828-1-cochcoder@proton.me \
    --to=cochcoder@proton.me \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=luiz.dentz@gmail.com \
    /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