-
Notifications
You must be signed in to change notification settings - Fork 7.8k
bluetooth: Fix various plm issues #76175
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
Conversation
sean-madigan
commented
Jul 22, 2024
- 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.
e0706cb
to
b50098a
Compare
subsys/bluetooth/controller/Kconfig
Outdated
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- CONFIG_BT_PATH_LOSS_MONITORING=y | |
- CONFIG_BT_TRANSMIT_POWER_CONTROL=y | |
- CONFIG_BT_PATH_LOSS_MONITORING=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you forget this?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 whyselect
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.
b50098a
to
8dbddf9
Compare
subsys/bluetooth/controller/Kconfig
Outdated
@@ -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 |
There was a problem hiding this comment.
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
69489cb
to
4a260bf
Compare
@@ -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 |
There was a problem hiding this comment.
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
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]>
4a260bf
to
54496e5
Compare
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]>
54496e5
to
3b13880
Compare
Where are we up to with this PR @cvinayak? Does it require any changes do you think? |
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]>
…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]>
…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]>
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]>
…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]>
…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]>