From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=79.135.106.121 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796255820; b=ECdfk/JW/lrGFNIBoyGFe2nHS+IzQ2noWsn7tTxK8sFe5wkt+U5Im7hvm57Z9PnhuUDn zRUihUPABg0bb+Ypr8H8VcTN3fKu+i8+Nv5e31qbfkiLNAzmunpNCEPf2x1E26HRifIJL BhboUmoe7sQc1qHSPYe8+ydi/g2inRntXZTwKdcBo5ZPtCis0sh0Q5YY4lYP8Od1Oo4Sy Q0QDVHVBOZ/jEZ4tehQGbR9bYMwFxss+uFlqaBySHWrMMhWE4uBk+WenNOW6cSi9AQXZy nVJJGto8mbH6Z1b4wCq2F3dHb49zNoowJqvi6wPcWpu+z1oEFcpqzibeMJ7yP7JWkTQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255820; h=DMARC-Filter:DKIM-Signature:Date:To:From:Cc:Subject:Message-ID: In-Reply-To:References:Feedback-ID:X-Pm-Message-ID:MIME-Version: Content-Type:Content-Transfer-Encoding; bh=zzG7ArbpwJcp3vvg/e85oU91SYzl780ynoO/R7TJMRM=; b=iFxKil31THIhq0N3WsaH/euCqymwDEe7zAn7OQCF+tuT01x0EkdtxxBXjtUCBU2Wra+S DqZE8FiKdLB34aLKrPdoFetxhblbYrurCnjiNUbZ/LW6GzI0vSZ22tygnQrsPTmEcWVsW p7f8SON0KNwknYQZiLEYwq6i3YmVFknnx/WoXhRxBe9sruZ6MIePzpLoLxRYdWDceOZhj KpCYAKEFzhLZcjeZDfMV4k4jc0gjcKWAInsXlU9Z+tKw3XDoE/T63rogFja1pxjdoXcWZ 5yBVE1HgP2aAPxA11ogQfXBMp7NgG01UigVFQSiZPqK6+0o8ucu7Nxtp1bGKvflA6Mg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=proton.me; spf=pass smtp.mailfrom=proton.me; dkim=pass header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=protonmail2 header.b=XtJA0T3Z; arc=none smtp.remote-ip=79.135.106.121 Received: from mail-106121.protonmail.ch (mail-106121.protonmail.ch [79.135.106.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA8F1606A332 for ; Wed, 2 Dec 2026 23:56:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AA8F1606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=proton.me header.i=@proton.me header.a=rsa-sha256 header.s=protonmail2 header.b=XtJA0T3Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail2; t=1796255817; x=1796515017; bh=zzG7ArbpwJcp3vvg/e85oU91SYzl780ynoO/R7TJMRM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=XtJA0T3ZZPEGhZKUFnwNWXJeo+wMsjjWnXbcaYPr3KREJRrBMHcQXrQHE95b+Z1md NOpAunuJdscbWc0u4e/asnSHQ5/ngXfmOAEcthvK810I/casY3DiXLAsrmylf3/fXI aVtd2MPx07yeCPkmeegVIpF0T9IztYUDvpYbH3zeZCqwSsbWhPZ0FibkbIlBx9VpyZ FAerGjddyIQ5o2NGOuEFPayqGhL9mfk0vPkjt0Kw6A9JoYZcVARx/+vD1ErpRDtMa3 o+YUOh6tt1ggCfFfGtCdHcgLRTlp8WLvumPo8B9Hy/uVCJ/zIIBxUYHYyk69tdTIYh wHwRfTfhnxViA== Date: Wed, 02 Dec 2026 23:56:54 +0000 To: linux-bluetooth@vger.kernel.org From: Kyle Pepper Cc: marcel@holtmann.org, luiz.dentz@gmail.com Subject: [RFC PATCH 1/2] Bluetooth: Match LE connection update completions Message-ID: <20261202235641.3242127-2-cochcoder@proton.me> In-Reply-To: <20261202235641.3242127-1-cochcoder@proton.me> References: <20261202235641.3242127-1-cochcoder@proton.me> Feedback-ID: 97716137:user:proton X-Pm-Message-ID: f2d2c14573d21cf8935db985494f9ab13dc03016 X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable LE meta dispatch completes synchronous connection updates on the subevent alone and supplies success without checking the event status. An update for another handle, or a failed or truncated update, can release the wait as successful. Match the requested connection handle and require the complete event body before completing the request. Propagate its status while still dispatching unrelated link updates to their normal handler. AI assistance: Codex (GPT-6). Signed-off-by: Kyle Pepper --- Base: bluetooth-next 7a1a7a5baa1e0f84d0568fc999421ee7dcbccaf5. This is a first public kernel CE RFC; local candidate numbers are not previous public versions. No kernel CE Message-ID is verified. BlueZ companion, already archived: https://lore.kernel.org/linux-bluetooth/20261202160403.226082-1-cochcoder@p= roton.me/ Offline validation: four W=3D1 objects; GCC/Clang source-extracted LE dispa= tch and CE queue tests; getter lengths 0..16 and baseline/negative controls. The exact source has no hardware, PTS or running-kernel lockdep result. Older integrated N8/MT7922 trials do not establish general controller suppo= rt. diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c @@ -8494,11 +8494,29 @@ =09 (hci_opcode_ogf(hci_skb_opcode(hdev->req_skb)) =3D=3D 0x08 || =09 hci_skb_opcode(hdev->req_skb) =3D=3D HCI_OP_NOP) && =09 hci_skb_event(hdev->req_skb) =3D=3D ev->subevent) { +=09=09if (hci_skb_opcode(hdev->req_skb) =3D=3D HCI_OP_LE_CONN_UPDATE) { +=09=09=09struct hci_cp_le_conn_update *cp; +=09=09=09struct hci_ev_le_conn_update_complete *complete; + +=09=09=09if (hdev->req_skb->len < HCI_COMMAND_HDR_SIZE + +=09=09=09=09=09=09=09 sizeof(*cp) || +=09=09=09 skb->len < sizeof(*complete)) +=09=09=09=09goto dispatch; + +=09=09=09cp =3D (void *)(hdev->req_skb->data + HCI_COMMAND_HDR_SIZE); +=09=09=09complete =3D (void *)skb->data; +=09=09=09if (cp->handle !=3D complete->handle) +=09=09=09=09goto dispatch; + +=09=09=09*status =3D complete->status; +=09=09} + =09=09*opcode =3D hci_skb_opcode(hdev->req_skb); -=09=09hci_req_cmd_complete(hdev, *opcode, 0x00, req_complete, +=09=09hci_req_cmd_complete(hdev, *opcode, *status, req_complete, =09=09=09=09 req_complete_skb); =09} =20 +dispatch: =09subev =3D &hci_le_ev_table[ev->subevent]; =09if (!subev->func) =09=09return;