Skip to content
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

Bluetooth: Controller: Consolidated Periodic Advertising Sync PR changes #41091

Closed

Conversation

cvinayak
Copy link
Contributor

@cvinayak cvinayak commented Dec 12, 2021

Relates to analysis of #39438, #40317 and a periodic synchronization related conformance test failure. And blocks analysis of #41465.

@github-actions github-actions bot added area: API Changes to public APIs area: Bluetooth area: Bluetooth Controller area: Tests Issues related to a particular existing or missing test labels Dec 12, 2021
@cvinayak cvinayak force-pushed the github_periodic_chain_fix branch 7 times, most recently from 54c2692 to e540696 Compare December 14, 2021 16:40
@cvinayak cvinayak force-pushed the github_periodic_chain_fix branch 4 times, most recently from 44bf63e to cf883b8 Compare December 21, 2021 01:57
@cvinayak cvinayak force-pushed the github_periodic_chain_fix branch 4 times, most recently from 788a604 to c1d1940 Compare December 23, 2021 08:38
Avoid reporting IQ samples after terminate.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add defines for Extended Advertising Common Extended Payload
Format field offsets.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix duplicate release of auxiliary context when scanning
uses LLL scheduling for reception of auxiliary PDU but the
reception fails.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix race condition in sync create cancel that assigned NULL
scan context's associated periodic sync context which caused
ULL to dereference NULL pointer.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Periodic Sync Terminate implementation for race
conditions with ULL scheduling by using a flag to stop any
new ULL scheduling to receive chain PDUs.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update ull_disable implementation to return -EALREADY if
LLL event is already disabled.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix any stray Extended Auxiliary PDU from being scanned
when disabling Extended Scanning.

Updated Extended Scan disable implementation to find any
active auxiliary scan context and stop them.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Do not implicitly allocate Rx buffers for maximum chain PDU
reception. Instead let applications increase as required the
Kconfig CONFIG_BT_CTLR_RX_BUFFERS.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Update implementation to generate Periodic Sync Failed to be
Established when Sync Established message could not be
generate due to lack of free node rx buffers and when there
is sync lost before sync established message could be
generated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Implementation to continue Periodic Sync Chain reception
when overlapping with scan events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Implementation to continue Auxiliary PDU reception when
overlapping with scan events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add development assert to check the validity of auxiliary
context's parent. This is to ensure a released auxiliary
context is not reused without allocation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add development assert to check the validity of auxiliary
context allocation. This is to ensure that primary PDU
reception does not have an auxiliary context allocated until
ULL has processed the node rx.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add assertion check to detect sync aux context leak.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix reset of is_aux_sched flag when closing the primary and
auxiliary PDU reception. Without this fix when scan window
is closed there would be duplicate auxiliary release message
generated causing memory corruption.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix auxiliary context release on scan done, do not wait for
reference count to reduce when Periodic Sync events overlap.

Regression introduced in commit 624e003 ("Bluetooth:
controller: Fix auxiliary scan context release").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing use of auxiliary context to generate done event
which caused leak in release of auxiliary context being not
release when reference count that should decrease to zero.

Regression in 'commit 665a8d2 ("Bluetooth: Controller:
Fix repeated per sync drift compensations").

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix Periodic Advertising Synchronization lost implementation
to avoid processing done event twice in cases of overlapping
events.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Add assert to check IQ sample allocation.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix generating IQ report if not populated.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix duplicate incomplete data status generated for Periodic
Advertising Report when LLL scheduling is used but auxiliary
context failed to be allocated in ULL.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix advertising pdu latest get to defer release of stale
PDU chain buffers. Returning NULL after some buffers where
released causes LLL to assert when chained PDUs are
switched.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix missing auxiliary context release message on abort of
LLL scheduling scheduling used by scan context.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Minor change to remove redundant assignment statement.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
Fix race condition in setting up ISR callback and parameter
caused between ULL_HIGH and LLL context. As LLL IRQ is not
disabled the parameter and ISR callback would get out of
sync causing incorrect parameter supplied to callback and
hence leading to development assert in ull_scan_done().

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
@cvinayak
Copy link
Contributor Author

Closing this most essential commits from this PR are upstream now.

@cvinayak cvinayak closed this Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: API Changes to public APIs area: Bluetooth Controller area: Bluetooth Host area: Bluetooth area: Tests Issues related to a particular existing or missing test
Projects
None yet
1 participant