Skip to content

Bluetooth: Controller: Fix missing window widening in ull_periph_setup #88906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Tronil
Copy link
Collaborator

@Tronil Tronil commented Apr 22, 2025

No window widening was applied to conn_offset_us causing the initial ticker_cb to get called slightly too late

Apply window_widening_periodic_us to conn_offset_us, since this is the worst-case window widening (win_offset is not allowed to be larger than a connection interval) and is applied in the LLL window size already

Fixes EBQ failure in LL/TIM/PER/BV-02-C

No window widening was applied to conn_offset_us causing the initial
ticker_cb to get called slightly too late

Apply window_widening_periodic_us to conn_offset_us, since this is the
worst-case window widening (win_offset is not allowed to be larger than
a connection interval) and is applied in the LLL window size already

Fixes EBQ failure in LL/TIM/PER/BV-02-C

Signed-off-by: Troels Nilsson <[email protected]>
@@ -418,6 +418,7 @@ void ull_periph_setup(struct node_rx_pdu *rx, struct node_rx_ftr *ftr,
conn_offset_us -= EVENT_TICKER_RES_MARGIN_US;
conn_offset_us -= EVENT_JITTER_US;
conn_offset_us -= ready_delay_us;
conn_offset_us -= lll->periph.window_widening_periodic_us;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be something like below?

Suggested change
conn_offset_us -= lll->periph.window_widening_periodic_us;
conn_offset_us -=
DIV_ROUND_UP(((lll_clock_ppm_local_get() +
lll_clock_ppm_get(conn->periph.sca)) *
(win_offset * CONN_INT_UNIT_US + win_delay_us)), USEC_PER_SEC);

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that would be the correct value to use; However, LLL does not know that and will apply window_widening_periodic_us anyway, so I thought we may as well use that value here as well. Adding another value for LLL to use seems overkill for this one case, although that would be the completely correct approach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Bluetooth Controller area: Bluetooth size: XS A PR changing only a single line of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants