Skip to content

Conversation

sean-madigan
Copy link
Contributor

  • callback_list was renamed to conn_cbs in commit 3eb975d. However plm callback was missed due to it not being built anywhere.
  • Path loss monitoring was not being enabled anywhere, meaning that issues could be merged in without catching the issue. This commit adds a test case to build the shell with path loss monitoring enabled to catch issues.
  • Path loss monitoring does not work without LE Power Control also enabled in the controller, so update the dependencies in the kconfigs to reflect this.

@sean-madigan sean-madigan changed the title Fix various plm issues bluwtooth: Fix various plm issues Jul 22, 2024
@sean-madigan sean-madigan changed the title bluwtooth: Fix various plm issues bluetooth: Fix various plm issues Jul 22, 2024
@sean-madigan sean-madigan marked this pull request as ready for review July 22, 2024 15:58
@@ -560,6 +560,7 @@ config BT_CTLR_LE_POWER_CONTROL
bool "LE Power Control Request Feature"
depends on BT_CTLR_LE_POWER_CONTROL_SUPPORT
default y if BT_TRANSMIT_POWER_CONTROL
default y if BT_PATH_LOSS_MONITORING
Copy link
Contributor

Choose a reason for hiding this comment

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

You should instead have depends on BT_CTLR_LE_PATH_LOSS_MONITORING_SUPPORT && BT_CTLR_LE_POWER_CONTROL in config BT_CTLR_LE_PATH_LOSS_MONITORING, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that is probably good to have as well. Worth having this default y if BT_PATH_LOSS_MONITORING here though, otherwise it just silently doesn't work.

Copy link
Contributor

Choose a reason for hiding this comment

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

otherwise it just silently doesn't work.

The Kconfig depends on should give build errors or warnings

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah that's what I thought but without this change if I just enable CONFIG_BT_PATH_LOSS_MONITORING=y then I get no warning about the missing dependency for BT_CTLR_LE_PATH_LOSS_MONITORING. However, if I just try and enable CONFIG_BT_CTLR_LE_PATH_LOSS_MONITORING=y directly, then I do get the warning.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I presume this is for cases where CONFIG_BT_CTLR=n to not gives loads of warnings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, not enabled in the .config

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds strange that if it doesn't get enabled but it set to =y in your config file and that you don't get any warnings. How are you building?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

With these changes cherry picked to NCS, and default y if BT_PATH_LOSS_MONITORING removed, build the zephyr shell with west build -b nrf52840dk/nrf52840 -p -- -DCONFIG_BT_PATH_LOSS_MONITORING=y and can see CONFIG_BT_PATH_LOSS_MONITORING=y in the .config file but not CONFIG_BT_CTLR_LE_PATH_LOSS_MONITORING=y. With no warning printed.

If I do west build -b nrf52840dk/nrf52840 -p -- -DCONFIG_BT_PATH_LOSS_MONITORING=y -DCONFIG_BT_CTLR_LE_PATH_LOSS_MONITORING=y then I get the warning.

Copy link
Contributor

Choose a reason for hiding this comment

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

Weird. There really should be a warning if you request a Kconfig value that isn't applied. Sounds like a bug somewhere, and shouldn't be fixed by this approach IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like we use select elsewhere in the file, so have updated to do this

@@ -29,6 +29,13 @@ tests:
platform_allow:
- native_posix
build_only: true
bluetooth.shell.path_loss_monitoring:
extra_configs:
- CONFIG_BT_PATH_LOSS_MONITORING=y
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- CONFIG_BT_PATH_LOSS_MONITORING=y
- CONFIG_BT_TRANSMIT_POWER_CONTROL=y
- CONFIG_BT_PATH_LOSS_MONITORING=y

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you forget this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What is the reason for this? Do you mean I should combine with the testcase above?

Copy link
Contributor

Choose a reason for hiding this comment

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

i thought we were against select BT_CTLR_LE_POWER_CONTROL in favour of depends on.

Refer to: #70251 (comment)

In summary, here are some recommended practices for select:
Avoid selecting symbols with prompts or dependencies. Prefer depends on. If depends on causes annoying bloat in configuration files, consider adding a Kconfig default for the most common value.

@tejlmand FYI

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed here, depends on does not have the desired effect - I presume this is why select has been used on other Kconfigs in the file

Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed here, depends on does not have the desired effect - I presume this is why select has been used on other Kconfigs in the file

"desired effect" has not been a criteria in the "recommended practices", adding new Kconfig default is another recommended practice (does add more Kconfig... but...) and hence will like @tejlmand to provide his comments.

jori-nordic
jori-nordic previously approved these changes Jul 23, 2024
@@ -560,6 +560,7 @@ config BT_CTLR_LE_POWER_CONTROL
bool "LE Power Control Request Feature"
depends on BT_CTLR_LE_POWER_CONTROL_SUPPORT
default y if BT_TRANSMIT_POWER_CONTROL
default y if BT_PATH_LOSS_MONITORING
Copy link
Contributor

Choose a reason for hiding this comment

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

otherwise it just silently doesn't work.

The Kconfig depends on should give build errors or warnings

@sean-madigan sean-madigan force-pushed the fix_plm_issues branch 2 times, most recently from 69489cb to 4a260bf Compare July 30, 2024 09:26
@Thalley Thalley requested a review from cvinayak July 30, 2024 13:25
@@ -29,6 +29,13 @@ tests:
platform_allow:
- native_posix
build_only: true
bluetooth.shell.path_loss_monitoring:
extra_configs:
- CONFIG_BT_PATH_LOSS_MONITORING=y
Copy link
Contributor

Choose a reason for hiding this comment

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

i thought we were against select BT_CTLR_LE_POWER_CONTROL in favour of depends on.

Refer to: #70251 (comment)

In summary, here are some recommended practices for select:
Avoid selecting symbols with prompts or dependencies. Prefer depends on. If depends on causes annoying bloat in configuration files, consider adding a Kconfig default for the most common value.

@tejlmand FYI

@cvinayak cvinayak dismissed their stale review August 5, 2024 11:52

As, I myself had used select of Kconfigs with prompt to have dependencies enabled. I am on the side with select being allowed on Kconfigs with prompt, these Kconfig with prompt are optional features when standalone but mandatory when dependee is enabled.

callback_list was renamed to conn_cbs in commit 3eb975d.

However plm callback was missed due to it not being built
anywhere.

Signed-off-by: Sean Madigan <[email protected]>
Path loss monitoring was not being enabled anywhere, meaning
that issues could be merged in without catching the issue.

This commit adds a test case to build the shell with path
loss monitoring enabled to catch issues.

Signed-off-by: Sean Madigan <[email protected]>
Path loss monitoring does not work without LE Power Control
also enabled in the controller, so update the dependencies
in the kconfigs so path loss monitoring selects power
control.

Signed-off-by: Sean Madigan <[email protected]>
@sean-madigan
Copy link
Contributor Author

Where are we up to with this PR @cvinayak? Does it require any changes do you think?

@Thalley
Copy link
Contributor

Thalley commented Aug 16, 2024

Where are we up to with this PR @cvinayak? Does it require any changes do you think?

Ideally it would be refactored to use depends on rather than select, but I'll leave it up to @cvinayak

@cvinayak
Copy link
Contributor

Where are we up to with this PR @cvinayak? Does it require any changes do you think?

We have not got any comments from @tejlmand, but approving for now as I am ok with use of select for this Kconfig option.

@nashif nashif merged commit 2a46ede into zephyrproject-rtos:main Aug 17, 2024
25 checks passed
sean-madigan added a commit to sean-madigan/sdk-zephyr that referenced this pull request Aug 19, 2024
callback_list was renamed to conn_cbs in commit 3eb975d.

However plm callback was missed due to it not being built
anywhere.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 2e7c488)
Upstream PR: zephyrproject-rtos/zephyr#76175
Signed-off-by: Sean Madigan <[email protected]>
sean-madigan added a commit to sean-madigan/sdk-zephyr that referenced this pull request Aug 19, 2024
…with plm

Path loss monitoring was not being enabled anywhere, meaning
that issues could be merged in without catching the issue.

This commit adds a test case to build the shell with path
loss monitoring enabled to catch issues.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 022d339)
Upstream PR: zephyrproject-rtos/zephyr#76175
Signed-off-by: Sean Madigan <[email protected]>
sean-madigan added a commit to sean-madigan/sdk-zephyr that referenced this pull request Aug 19, 2024
…or plm

Path loss monitoring does not work without LE Power Control
also enabled in the controller, so update the dependencies
in the kconfigs so path loss monitoring selects power
control.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 2a46ede)
Upstream PR: zephyrproject-rtos/zephyr#76175
Signed-off-by: Sean Madigan <[email protected]>
nordicjm pushed a commit to nrfconnect/sdk-zephyr that referenced this pull request Aug 20, 2024
callback_list was renamed to conn_cbs in commit 3eb975d.

However plm callback was missed due to it not being built
anywhere.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 2e7c488)
Upstream PR: zephyrproject-rtos/zephyr#76175
Signed-off-by: Sean Madigan <[email protected]>
nordicjm pushed a commit to nrfconnect/sdk-zephyr that referenced this pull request Aug 20, 2024
…with plm

Path loss monitoring was not being enabled anywhere, meaning
that issues could be merged in without catching the issue.

This commit adds a test case to build the shell with path
loss monitoring enabled to catch issues.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 022d339)
Upstream PR: zephyrproject-rtos/zephyr#76175
Signed-off-by: Sean Madigan <[email protected]>
nordicjm pushed a commit to nrfconnect/sdk-zephyr that referenced this pull request Aug 20, 2024
…or plm

Path loss monitoring does not work without LE Power Control
also enabled in the controller, so update the dependencies
in the kconfigs so path loss monitoring selects power
control.

Signed-off-by: Sean Madigan <[email protected]>
(cherry picked from commit 2a46ede)
Upstream PR: zephyrproject-rtos/zephyr#76175
Signed-off-by: Sean Madigan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants