linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ] adapter: Fix toggling of experimental features
@ 2021-06-24 22:08 Luiz Augusto von Dentz
  2021-06-24 22:36 ` [BlueZ] " bluez.test.bot
  0 siblings, 1 reply; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2021-06-24 22:08 UTC (permalink / raw)
  To: linux-bluetooth

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

When toggling experimental features it may cause the old value to still
be in effect since it was read after read info which upon completion
would attempt to call adapter_register without first updating the
experimental features which could affect the likes of advertising
instances when LL Privacy is enabled.
---
 src/adapter.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/adapter.c b/src/adapter.c
index 2175120f4..84bc5a1b0 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -9253,14 +9253,15 @@ static void set_exp_debug_complete(uint8_t status, uint16_t len,
 static void exp_debug_func(struct btd_adapter *adapter, uint32_t flags)
 {
 	struct mgmt_cp_set_exp_feature cp;
+	uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
 
-	/* If already enabled don't attempt to set it again */
-	if (flags & BIT(0))
+	/* If already set don't attempt to set it again */
+	if (action == (flags & BIT(0)))
 		return;
 
 	memset(&cp, 0, sizeof(cp));
 	memcpy(cp.uuid, debug_uuid, 16);
-	cp.action = 0x01;
+	cp.action = btd_opts.experimental ? 0x01 : 0x00;
 
 	if (mgmt_send(adapter->mgmt, MGMT_OP_SET_EXP_FEATURE,
 			adapter->dev_id, sizeof(cp), &cp,
@@ -9289,14 +9290,15 @@ static void set_rpa_resolution_complete(uint8_t status, uint16_t len,
 static void rpa_resolution_func(struct btd_adapter *adapter, uint32_t flags)
 {
 	struct mgmt_cp_set_exp_feature cp;
+	uint8_t action = btd_opts.experimental ? 0x01 : 0x00;
 
-	/* If already enabled don't attempt to set it again */
-	if (flags & BIT(0))
+	/* If already set don't attempt to set it again */
+	if (action == (flags & BIT(0)))
 		return;
 
 	memset(&cp, 0, sizeof(cp));
 	memcpy(cp.uuid, rpa_resolution_uuid, 16);
-	cp.action = 0x01;
+	cp.action = action;
 
 	if (mgmt_send(adapter->mgmt, MGMT_OP_SET_EXP_FEATURE,
 			adapter->dev_id, sizeof(cp), &cp,
@@ -9480,10 +9482,6 @@ static void read_info_complete(uint8_t status, uint16_t length,
 			(missing_settings & MGMT_SETTING_FAST_CONNECTABLE))
 		set_mode(adapter, MGMT_OP_SET_FAST_CONNECTABLE, 0x01);
 
-	if (btd_opts.experimental &&
-			btd_has_kernel_features(KERNEL_EXP_FEATURES))
-		read_exp_features(adapter);
-
 	err = adapter_register(adapter);
 	if (err < 0) {
 		btd_error(adapter->dev_id, "Unable to register new adapter");
@@ -9707,6 +9705,9 @@ static void index_added(uint16_t index, uint16_t length, const void *param,
 		return;
 	}
 
+	if (btd_has_kernel_features(KERNEL_EXP_FEATURES))
+		read_exp_features(adapter);
+
 	/*
 	 * Protect against potential two executions of read controller info.
 	 *
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [BlueZ] adapter: Fix toggling of experimental features
  2021-06-24 22:08 [PATCH BlueZ] adapter: Fix toggling of experimental features Luiz Augusto von Dentz
@ 2021-06-24 22:36 ` bluez.test.bot
  2021-06-28 17:35   ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: bluez.test.bot @ 2021-06-24 22:36 UTC (permalink / raw)
  To: linux-bluetooth, luiz.dentz

[-- Attachment #1: Type: text/plain, Size: 1953 bytes --]

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=506771

---Test result---

Test Summary:
CheckPatch                    PASS      0.41 seconds
GitLint                       PASS      0.11 seconds
Prep - Setup ELL              PASS      43.31 seconds
Build - Prep                  PASS      0.14 seconds
Build - Configure             PASS      7.61 seconds
Build - Make                  PASS      188.57 seconds
Make Check                    PASS      8.56 seconds
Make Distcheck                PASS      222.79 seconds
Build w/ext ELL - Configure   PASS      7.66 seconds
Build w/ext ELL - Make        PASS      177.18 seconds

Details
##############################
Test: CheckPatch - PASS
Desc: Run checkpatch.pl script with rule in .checkpatch.conf

##############################
Test: GitLint - PASS
Desc: Run gitlint with rule in .gitlint

##############################
Test: Prep - Setup ELL - PASS
Desc: Clone, build, and install ELL

##############################
Test: Build - Prep - PASS
Desc: Prepare environment for build

##############################
Test: Build - Configure - PASS
Desc: Configure the BlueZ source tree

##############################
Test: Build - Make - PASS
Desc: Build the BlueZ source tree

##############################
Test: Make Check - PASS
Desc: Run 'make check'

##############################
Test: Make Distcheck - PASS
Desc: Run distcheck to check the distribution

##############################
Test: Build w/ext ELL - Configure - PASS
Desc: Configure BlueZ source with '--enable-external-ell' configuration

##############################
Test: Build w/ext ELL - Make - PASS
Desc: Build BlueZ source with '--enable-external-ell' configuration



---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BlueZ] adapter: Fix toggling of experimental features
  2021-06-24 22:36 ` [BlueZ] " bluez.test.bot
@ 2021-06-28 17:35   ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2021-06-28 17:35 UTC (permalink / raw)
  To: linux-bluetooth

Hi,

On Thu, Jun 24, 2021 at 3:36 PM <bluez.test.bot@gmail.com> wrote:
>
> This is automated email and please do not reply to this email!
>
> Dear submitter,
>
> Thank you for submitting the patches to the linux bluetooth mailing list.
> This is a CI test results with your patch series:
> PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=506771
>
> ---Test result---
>
> Test Summary:
> CheckPatch                    PASS      0.41 seconds
> GitLint                       PASS      0.11 seconds
> Prep - Setup ELL              PASS      43.31 seconds
> Build - Prep                  PASS      0.14 seconds
> Build - Configure             PASS      7.61 seconds
> Build - Make                  PASS      188.57 seconds
> Make Check                    PASS      8.56 seconds
> Make Distcheck                PASS      222.79 seconds
> Build w/ext ELL - Configure   PASS      7.66 seconds
> Build w/ext ELL - Make        PASS      177.18 seconds
>
> Details
> ##############################
> Test: CheckPatch - PASS
> Desc: Run checkpatch.pl script with rule in .checkpatch.conf
>
> ##############################
> Test: GitLint - PASS
> Desc: Run gitlint with rule in .gitlint
>
> ##############################
> Test: Prep - Setup ELL - PASS
> Desc: Clone, build, and install ELL
>
> ##############################
> Test: Build - Prep - PASS
> Desc: Prepare environment for build
>
> ##############################
> Test: Build - Configure - PASS
> Desc: Configure the BlueZ source tree
>
> ##############################
> Test: Build - Make - PASS
> Desc: Build the BlueZ source tree
>
> ##############################
> Test: Make Check - PASS
> Desc: Run 'make check'
>
> ##############################
> Test: Make Distcheck - PASS
> Desc: Run distcheck to check the distribution
>
> ##############################
> Test: Build w/ext ELL - Configure - PASS
> Desc: Configure BlueZ source with '--enable-external-ell' configuration
>
> ##############################
> Test: Build w/ext ELL - Make - PASS
> Desc: Build BlueZ source with '--enable-external-ell' configuration
>
>
>
> ---
> Regards,
> Linux Bluetooth

Pushed.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-28 17:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-24 22:08 [PATCH BlueZ] adapter: Fix toggling of experimental features Luiz Augusto von Dentz
2021-06-24 22:36 ` [BlueZ] " bluez.test.bot
2021-06-28 17:35   ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).