* [PATCH BlueZ 2/4] tools/6lowpan-tester: fix race in Client Connect - Disable
2026-07-13 13:50 [PATCH BlueZ 1/4] tools/sco-tester: fix missing clear of io_id in callbacks Pauli Virtanen
@ 2026-07-13 13:50 ` Pauli Virtanen
2026-07-13 13:50 ` [PATCH BlueZ 3/4] tools/6lowpan-tester: add test for VHCI teardown without disable Pauli Virtanen
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Pauli Virtanen @ 2026-07-13 13:50 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Pauli Virtanen
It's possible client_l2cap_disconnect_cb() is called after 6lowpan
disable on connect. Prevent failing test in finish_step() in this case.
---
tools/6lowpan-tester.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/tools/6lowpan-tester.c b/tools/6lowpan-tester.c
index 95fdf206f..738714d68 100644
--- a/tools/6lowpan-tester.c
+++ b/tools/6lowpan-tester.c
@@ -648,8 +648,11 @@ static void client_l2cap_connect_cb(uint16_t handle, uint16_t cid,
if (cdata->disable_on_connect) {
if (write_6lowpan("6lowpan_enable", "0"))
tester_test_failed();
- else
+ else {
+ data->handle = 0;
+ data->dcid = 0;
tester_test_passed();
+ }
}
}
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH BlueZ 3/4] tools/6lowpan-tester: add test for VHCI teardown without disable
2026-07-13 13:50 [PATCH BlueZ 1/4] tools/sco-tester: fix missing clear of io_id in callbacks Pauli Virtanen
2026-07-13 13:50 ` [PATCH BlueZ 2/4] tools/6lowpan-tester: fix race in Client Connect - Disable Pauli Virtanen
@ 2026-07-13 13:50 ` Pauli Virtanen
2026-07-13 13:50 ` [PATCH BlueZ 4/4] tools/l2cap-tester: fix Set PHY test spurious failures Pauli Virtanen
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Pauli Virtanen @ 2026-07-13 13:50 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Pauli Virtanen
Check 6lowpan teardown when controller disappers with active devices.
Add test
Client Connect - No Disable
---
tools/6lowpan-tester.c | 28 +++++++++++++++++++++++-----
1 file changed, 23 insertions(+), 5 deletions(-)
diff --git a/tools/6lowpan-tester.c b/tools/6lowpan-tester.c
index 738714d68..a8faf6eb5 100644
--- a/tools/6lowpan-tester.c
+++ b/tools/6lowpan-tester.c
@@ -76,6 +76,9 @@ struct client_data {
/* Interface listener socket type, SOCK_RAW / DGRAM */
int sk_type;
+
+ /* Don't disable 6lowpan before adapter teardown */
+ bool no_teardown_disable;
};
static void print_debug(const char *str, void *user_data)
@@ -264,6 +267,7 @@ static void test_pre_setup(const void *test_data)
static void test_post_teardown(const void *test_data)
{
struct test_data *data = tester_get_data();
+ const struct client_data *cdata = data->test_data;
int ret;
if (data->io_id > 0) {
@@ -276,11 +280,13 @@ static void test_post_teardown(const void *test_data)
data->packet_fd = -1;
}
- ret = write_6lowpan("6lowpan_enable", "0");
- if (ret < 0) {
- tester_warn("Failed to disable 6lowpan");
- tester_post_teardown_failed();
- return;
+ if (!cdata || !cdata->no_teardown_disable) {
+ ret = write_6lowpan("6lowpan_enable", "0");
+ if (ret < 0) {
+ tester_warn("Failed to disable 6lowpan");
+ tester_post_teardown_failed();
+ return;
+ }
}
hciemu_unref(data->hciemu);
@@ -317,6 +323,10 @@ static const struct client_data client_connect_disable = {
.disable_on_connect = true,
};
+static const struct client_data client_connect_no_disable = {
+ .no_teardown_disable = true,
+};
+
static const struct client_data client_connect_disconnect = {
.disconnect = true,
};
@@ -653,6 +663,10 @@ static void client_l2cap_connect_cb(uint16_t handle, uint16_t cid,
data->dcid = 0;
tester_test_passed();
}
+ } else if (cdata->no_teardown_disable) {
+ data->handle = 0;
+ data->dcid = 0;
+ tester_test_passed();
}
}
@@ -708,6 +722,10 @@ int main(int argc, char *argv[])
setup_powered_client,
test_connect);
+ test_6lowpan("Client Connect - No Disable", &client_connect_no_disable,
+ setup_powered_client,
+ test_connect);
+
test_6lowpan("Client Connect - Disconnect", &client_connect_disconnect,
setup_powered_client,
test_connect);
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* [PATCH BlueZ 4/4] tools/l2cap-tester: fix Set PHY test spurious failures
2026-07-13 13:50 [PATCH BlueZ 1/4] tools/sco-tester: fix missing clear of io_id in callbacks Pauli Virtanen
2026-07-13 13:50 ` [PATCH BlueZ 2/4] tools/6lowpan-tester: fix race in Client Connect - Disable Pauli Virtanen
2026-07-13 13:50 ` [PATCH BlueZ 3/4] tools/6lowpan-tester: add test for VHCI teardown without disable Pauli Virtanen
@ 2026-07-13 13:50 ` Pauli Virtanen
2026-07-13 16:27 ` [BlueZ,1/4] tools/sco-tester: fix missing clear of io_id in callbacks bluez.test.bot
2026-07-13 20:10 ` [PATCH BlueZ 1/4] " patchwork-bot+bluetooth
4 siblings, 0 replies; 6+ messages in thread
From: Pauli Virtanen @ 2026-07-13 13:50 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Pauli Virtanen
Setting BT_PHY does not take effect instantaneously as kernel waits for
controller, so checking getsockopt() sometimes fails here. In PHY tests,
use retry with timeout to check again later.
---
tools/l2cap-tester.c | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/tools/l2cap-tester.c b/tools/l2cap-tester.c
index a8cac3902..2771aee65 100644
--- a/tools/l2cap-tester.c
+++ b/tools/l2cap-tester.c
@@ -277,7 +277,7 @@ static void test_data_free(void *test_data)
#define test_l2cap(name, type, data, setup, func) \
do { \
struct test_data *user; \
- user = malloc(sizeof(struct test_data)); \
+ user = calloc(1, sizeof(struct test_data)); \
if (!user) \
break; \
user->hciemu_type = type; \
@@ -1657,8 +1657,10 @@ static gboolean socket_closed_cb(GIOChannel *io, GIOCondition cond,
tester_print("err %d != %d expected_err", -err,
l2data->expect_err);
tester_test_failed();
- } else
+ } else if (!data->step)
tester_test_passed();
+ else
+ tester_test_failed();
return FALSE;
}
@@ -1729,12 +1731,13 @@ static gboolean check_phy(gpointer args)
}
if (l2data->phy && l2data->phy != data->phys) {
- tester_warn("phy 0x%08x != 0x%08x", l2data->phy, data->phys);
- tester_test_failed();
- goto done;
+ tester_print("phy 0x%08x != 0x%08x", l2data->phy, data->phys);
+
+ /* Retry */
+ return TRUE;
}
- tester_test_passed();
+ data->step--;
done:
shutdown(sk, SHUT_WR);
@@ -1770,7 +1773,8 @@ static int check_phys(struct test_data *data, int sk)
}
/* Wait for the PHY to change */
- g_idle_add(check_phy, INT_TO_PTR(sk));
+ data->step++;
+ g_timeout_add(50, check_phy, INT_TO_PTR(sk));
return -EINPROGRESS;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* RE: [BlueZ,1/4] tools/sco-tester: fix missing clear of io_id in callbacks
2026-07-13 13:50 [PATCH BlueZ 1/4] tools/sco-tester: fix missing clear of io_id in callbacks Pauli Virtanen
` (2 preceding siblings ...)
2026-07-13 13:50 ` [PATCH BlueZ 4/4] tools/l2cap-tester: fix Set PHY test spurious failures Pauli Virtanen
@ 2026-07-13 16:27 ` bluez.test.bot
2026-07-13 20:10 ` [PATCH BlueZ 1/4] " patchwork-bot+bluetooth
4 siblings, 0 replies; 6+ messages in thread
From: bluez.test.bot @ 2026-07-13 16:27 UTC (permalink / raw)
To: linux-bluetooth, pav
[-- Attachment #1: Type: text/plain, Size: 1123 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=1126713
---Test result---
Test Summary:
CheckPatch PASS 1.18 seconds
GitLint PASS 0.83 seconds
BuildEll PASS 20.14 seconds
BluezMake PASS 528.98 seconds
CheckSmatch WARNING 306.73 seconds
bluezmakeextell PASS 99.74 seconds
IncrementalBuild PASS 530.68 seconds
ScanBuild PASS 945.67 seconds
Details
##############################
Test: CheckSmatch - WARNING
Desc: Run smatch tool with source
Output:
tools/sco-tester.c: note: in included file:./lib/bluetooth/bluetooth.h:232:15: warning: array of flexible structures./lib/bluetooth/bluetooth.h:237:31: warning: array of flexible structures
https://github.com/bluez/bluez/pull/2303
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH BlueZ 1/4] tools/sco-tester: fix missing clear of io_id in callbacks
2026-07-13 13:50 [PATCH BlueZ 1/4] tools/sco-tester: fix missing clear of io_id in callbacks Pauli Virtanen
` (3 preceding siblings ...)
2026-07-13 16:27 ` [BlueZ,1/4] tools/sco-tester: fix missing clear of io_id in callbacks bluez.test.bot
@ 2026-07-13 20:10 ` patchwork-bot+bluetooth
4 siblings, 0 replies; 6+ messages in thread
From: patchwork-bot+bluetooth @ 2026-07-13 20:10 UTC (permalink / raw)
To: Pauli Virtanen; +Cc: linux-bluetooth
Hello:
This series was applied to bluetooth/bluez.git (master)
by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>:
On Mon, 13 Jul 2026 16:50:23 +0300 you wrote:
> Fixes issues
>
> GLib-CRITICAL **: Source ID 126 was not found when attempting to remove it
> ---
> tools/sco-tester.c | 2 ++
> 1 file changed, 2 insertions(+)
Here is the summary with links:
- [BlueZ,1/4] tools/sco-tester: fix missing clear of io_id in callbacks
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=0f2f53fd04d4
- [BlueZ,2/4] tools/6lowpan-tester: fix race in Client Connect - Disable
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=9353c0ea9f6c
- [BlueZ,3/4] tools/6lowpan-tester: add test for VHCI teardown without disable
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=ba08e0f6be0f
- [BlueZ,4/4] tools/l2cap-tester: fix Set PHY test spurious failures
https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=1cfe2d8b2cbb
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 6+ messages in thread