bluetooth: host: investigate Telink legacy adv resume after disconnect - #805
Draft
damien0x0023 wants to merge 1 commit into
Draft
bluetooth: host: investigate Telink legacy adv resume after disconnect#805damien0x0023 wants to merge 1 commit into
damien0x0023 wants to merge 1 commit into
Conversation
Commit 83a59d1 ("bluetooth: Fix Bluetooth reconnection") skipped the whole BT_ADV_PERSIST && !BT_ADV_ENABLED guard in bt_le_adv_resume() for Telink TLSR, leaving only the BT_ADV_CONNECTABLE check. That fixed reconnection for persistent (PERSIST=1) advertising, but it also broke the stop semantics for one-shot (PERSIST=0) advertising: an explicit bt_le_adv_stop() clears BT_ADV_PERSIST but not BT_ADV_CONNECTABLE, so on disconnect bt_conn_unref() -> bt_le_adv_resume() still re-enabled advertising, forcing upper layers to add a bt_le_adv_stop() fallback. The reliable intent flag here is BT_ADV_PERSIST, which the host itself sets on bt_le_adv_start() and clears on bt_le_adv_stop(); it does not depend on controller events. The !BT_ADV_ENABLED condition, on the other hand, is what was unreliable on the Telink vendor controller. Rely only on BT_ADV_PERSIST for Telink TLSR: - persistent advertising implicitly paused by an established connection is resumed on disconnect (reconnection preserved); - one-shot advertising (PERSIST=0) or an explicit bt_le_adv_stop() is no longer resumed (stop semantics restored). Standard Zephyr behavior is unchanged. Signed-off-by: Damien Ji <yinghao.ji@telink-semi.com>
damien0x0023
requested review from
Jackie-Kilby,
andriy-bilynskyy,
strandingneko-vivi and
wuhaoTelink
August 19, 2026 10:16
damien0x0023
marked this pull request as draft
August 20, 2026 12:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
This is an issue that needs to be fixed in our Telink fork Zephyr.
On Telink TLSR SoCs (TL7218X), a BLE peripheral cannot be reconnected after
a disconnect when using legacy connectable advertising.
project-chip/connectedhomeip@229070a#r3805029716
Information collected
From Andrii @andriy-bilynskyy (earlier debugging on B91):
The connection state transitions are:
The final
disconnected -> adv-connectabletransition never happens, so nofurther connection is possible.
After disconnect,
bt_conn_unref()triggersbt_le_adv_resume()insubsys/bluetooth/host/adv.c. The guardevaluates to "true" on Telink, so resume is skipped and the device stays
disconnected. Commenting out the whole guard fixes reconnection, but is a
hack. The flags need to be understood correctly since this is the common
vendor file.
From Zhihan @strandingneko-vivi :
Suggested configuring the controller with
blc_ll_configLegacyAdvEnableStrategy(LEG_ADV_EN_STRATEGY_2)in the TelinkSDK during
bt_init, instead of the defaultLEG_ADV_EN_STRATEGY_3.Experiments on TL7218X (peripheral_ht sample)
LEG_ADV_EN_STRATEGY_2+ upstreambt_le_adv_resume()guardThe connection stays in "connecting" and the host repeatedly logs:
STRATEGY_2keeps advertising running regardless of connection state(only
blc_ll_setAdvEnablecontrols it), which conflicts with Zephyrhost's legacy-connectable state machine, so the host cannot match the
LE Connection Completeevent to a pending conn. Incompatible.LEG_ADV_EN_STRATEGY_3+ PERSIST-only resume guard (this branch)Connects once, but advertising is not resumed after disconnect. This
reproduces Andrii's original observation. Skipping the unreliable
!BT_ADV_ENABLEDcheck does not help, so the root cause is not the resumeguard itself but the host<->controller state sync after connect/disconnect
under
STRATEGY_3.@strandingneko-vivi @Jackie-Kilby
Please help investigate how to modify our Telink controller to match the Zephyr common Host.