Skip to content

Conversation

@cvinayak
Copy link
Contributor

Port the fix for the controller implementation to make start
encryption queueable if there is any control procedure in
progress.

Refer to #15335.
Relates to #15335, #15186, #15958 and #14636.

Signed-off-by: Vinayak Kariappa Chettimada vich@nordicsemi.no

@cvinayak cvinayak requested review from aescolar and joerchan May 29, 2019 20:07
@cvinayak cvinayak added area: Bluetooth bug The issue is a bug, or the PR is fixing a bug labels May 29, 2019
@cvinayak cvinayak force-pushed the github_port_enc_queueable branch from 5440e8a to bd1e8fb Compare May 29, 2019 22:04
@aescolar aescolar removed their request for review June 4, 2019 11:08
Copy link
Contributor

@joerchan joerchan left a comment

Choose a reason for hiding this comment

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

looks good, left a few small comments.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why -= 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The state is maintained as a differential value:
0. Request lock is idle

  1. Thread acquires a lock on the request, if req == ack then req +=1;
  2. Thread commits the request, req +=1 or (req-ack) == 2

If ISR occurs between the thread checking for req == ack and req +=1, then in the thead the differential will be (req-ack) == 3, indicating a race condition. In this case, thread will back-off by reverting req -= 1, resulting in a final (req-ack) == 2 (i.e. ISR request supercedes).

On the contrary, if ISR detects that request is acquired it backs-off to retry later.

Copy link
Contributor

Choose a reason for hiding this comment

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

move this pause_tx into llcp_enc?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agreed. Will give a try.

Port the fix for the controller implementation to make start
encryption queueable if there is any control procedure in
progress.

Refer to zephyrproject-rtos#15335.
Relates to zephyrproject-rtos#15335, zephyrproject-rtos#15186, zephyrproject-rtos#15958 and zephyrproject-rtos#14636.

Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
@cvinayak cvinayak force-pushed the github_port_enc_queueable branch from bd1e8fb to 24c72ab Compare June 4, 2019 14:01
@carlescufi carlescufi closed this Jun 5, 2019
@carlescufi carlescufi reopened this Jun 5, 2019
@cvinayak cvinayak added the RFC Request For Comments: want input from the community label Jun 5, 2019
@cvinayak
Copy link
Contributor Author

cvinayak commented Jun 5, 2019

We wait for review from @thoh-ot

Copy link
Contributor

@thoh-ot thoh-ot left a comment

Choose a reason for hiding this comment

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

LGTM

@carlescufi carlescufi merged commit 79cb615 into zephyrproject-rtos:master Jun 6, 2019
@cvinayak cvinayak deleted the github_port_enc_queueable branch March 1, 2021 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Bluetooth bug The issue is a bug, or the PR is fixing a bug RFC Request For Comments: want input from the community

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants