Skip to contentSkip to conversation

Bluetooth: Fixes for BR/EDR connection idle timeout configuration

PATCH Superseded Stefan Sørensen 5 participants 11 messages Dec 16, 2025 – Dec 20, 2025

Subsystems (2)

v1 of 2 Superseded 2 of 3 applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Bluetooth: Fixes for BR/EDR connection idle timeout configuration

This series addresses issues with how Bluetooth BR/EDR connections handle idle timeouts (entering Sniff mode) and exposes the timeout value to userspace:

1. Ensure the active mode timeout is correctly updated using mod_delayed_work(), preventing the timer from being ignored if already queued.
2. Apply the link policy to incoming ACL connections (previously only applied to outgoing), ensuring incoming connections can also enter idle modes.
3. Add idle_timeout to the configurable system parameters in the Management interface. This allows userspace to control when the Sniff mode is triggered, complementing the existing ability to control the Sniff parameters themselves.

Stefan Sørensen (3):
Bluetooth: hci_conn: use mod_delayed_work for active mode timeout
Bluetooth: hci_conn: Set link_policy on incoming ACL connections
Bluetooth: mgmt: Add idle_timeout to configurable system parameters

 net/bluetooth/hci_conn.c    |  3 ++-
 net/bluetooth/hci_sync.c    |  2 --
 net/bluetooth/mgmt_config.c | 21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 3 deletions(-)
Signature · 1 line
2.52.0
#1 lore raw

PATCH 1/3 Bluetooth: hci_conn: use mod_delayed_work for active mode timeout

hci_conn_enter_active_mode() uses queue_delayed_work() with the intention that the work will run after the given timeout. However, queue_delayed_work() does nothing if the work is already queued, so depending on the link policy we may end up putting the connection into idle mode every hdev->idle_timeout ms.

Use mod_delayed_work() instead so the work is queued if not already queued, and the timeout is updated otherwise.

---
 net/bluetooth/hci_conn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/hci_conn.c +1 -1
index 5a4374ccf8e84..837038b5c5681 100644
@@ -2619,7 +2619,7 @@ void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active)
 
 timer:
 	if (hdev->idle_timeout > 0)
-		queue_delayed_work(hdev->workqueue, &conn->idle_work,
+		mod_delayed_work(hdev->workqueue, &conn->idle_work,
 				   msecs_to_jiffies(hdev->idle_timeout));
 }
 
Signature · 1 line
2.52.0
#2 lore raw

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=1033698

---Test result---

Test Summary:

CheckPatch                    PENDING   0.36 seconds
GitLint                       PENDING   0.27 seconds
SubjectPrefix                 PASS      0.33 seconds
BuildKernel                   PASS      25.25 seconds
CheckAllWarning               PASS      27.92 seconds
CheckSparse                   WARNING   31.32 seconds
BuildKernel32                 PASS      25.31 seconds
TestRunnerSetup               PASS      551.71 seconds
TestRunner_l2cap-tester       PASS      25.41 seconds
TestRunner_iso-tester         PASS      80.01 seconds
TestRunner_bnep-tester        PASS      6.24 seconds
TestRunner_mgmt-tester        FAIL      115.42 seconds
TestRunner_rfcomm-tester      PASS      9.40 seconds
TestRunner_sco-tester         FAIL      14.50 seconds
TestRunner_ioctl-tester       PASS      10.44 seconds
TestRunner_mesh-tester        FAIL      11.56 seconds
TestRunner_smp-tester         PASS      8.57 seconds
TestRunner_userchan-tester    PASS      6.59 seconds
IncrementalBuild              PENDING   0.79 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel Output:
net/bluetooth/mgmt_config.c:127:17: warning: incorrect type in initializer (different base types)net/bluetooth/mgmt_config.c:127:17: expected restricted __le16 [usertype] typenet/bluetooth/mgmt_config.c:127:17: got restricted __le32 [usertype]
##############################
Test: TestRunner_mgmt-tester - FAIL
Desc: Run mgmt-tester with test-runner Output:
Total: 494, Passed: 488 (98.8%), Failed: 2, Not Run: 4

Failed Test Cases

Read Exp Feature - Success                           Failed       0.103 seconds
LL Privacy - Set Flags 1 (Add to RL)                 Failed       0.153 seconds

##############################
Test: TestRunner_sco-tester - FAIL
Desc: Run sco-tester with test-runner
Output:
WARNING: possible circular locking dependency detected

BUG: sleeping function called from invalid context at net/core/sock.c:3782

Total: 30, Passed: 30 (100.0%), Failed: 0, Not Run: 0
##############################
Test: TestRunner_mesh-tester - FAIL
Desc: Run mesh-tester with test-runner Output:
Total: 10, Passed: 8 (80.0%), Failed: 2, Not Run: 0

Failed Test Cases

Mesh - Send cancel - 1                               Timed out    1.850 seconds
Mesh - Send cancel - 2                               Timed out    1.997 seconds

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#3 lore raw

PATCH 2/3 Bluetooth: hci_conn: Set link_policy on incoming ACL connections

In reply to Stefan Sørensen

The connection link policy is only set when establishing an outgoing ACL connection causing connection idle modes not to be available on incoming connections. Move the setting of the link policy to the creation of the connection so all ACL connection will use the link policy set on the HCI device.

---
 net/bluetooth/hci_conn.c | 1 +
 net/bluetooth/hci_sync.c | 2 --
 2 files changed, 1 insertion(+), 2 deletions(-)
net/bluetooth/hci_conn.c +1 -0
index 837038b5c5681..fe73528ce2bf0 100644
@@ -1002,6 +1002,7 @@ static struct hci_conn *__hci_conn_add(struct hci_dev *hdev, int type,
 	switch (type) {
 	case ACL_LINK:
 		conn->pkt_type = hdev->pkt_type & ACL_PTYPE_MASK;
+		conn->link_policy = hdev->link_policy;
 		conn->mtu = hdev->acl_mtu;
 		break;
 	case LE_LINK:
net/bluetooth/hci_sync.c +0 -2
index a9f5b1a68356e..3b620c6eed70c 100644
@@ -6896,8 +6896,6 @@ static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data)
 
 	conn->attempt++;
 
-	conn->link_policy = hdev->link_policy;
-
 	memset(&cp, 0, sizeof(cp));
 	bacpy(&cp.bdaddr, &conn->dst);
 	cp.pscan_rep_mode = 0x02;
Signature · 1 line
2.52.0
#4 lore raw

PATCH 3/3 Bluetooth: mgmt: Add idle_timeout to configurable system parameters

In reply to Stefan Sørensen

While the configurable system parameters allow controlling the SNIFF mode parameters, they do not include the idle_timeout parameter responsible for enabling SNIFF mode.

Add the idle_timeout parameter to allow controlling the idle timeout of BR/EDR connections.

---
 net/bluetooth/mgmt_config.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
net/bluetooth/mgmt_config.c +21 -0
index c4063d200c0a6..4ec6c008cb7e6 100644
@@ -11,6 +11,12 @@
 #include "mgmt_util.h"
 #include "mgmt_config.h"
 
+#define HDEV_PARAM_U32(_param_name_) \
+	struct {\
+		struct mgmt_tlv_hdr entry; \
+		__le32 value; \
+	} __packed _param_name_
+
 #define HDEV_PARAM_U16(_param_name_) \
 	struct {\
 		struct mgmt_tlv_hdr entry; \
@@ -29,6 +35,12 @@
 		cpu_to_le16(hdev->_param_name_) \
 	}
 
+#define TLV_SET_U32(_param_code_, _param_name_) \
+	{ \
+		{ cpu_to_le32(_param_code_), sizeof(__u32) }, \
+		cpu_to_le32(hdev->_param_name_) \
+	}
+
 #define TLV_SET_U8(_param_code_, _param_name_) \
 	{ \
 		{ cpu_to_le16(_param_code_), sizeof(__u8) }, \
@@ -78,6 +90,7 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
 		HDEV_PARAM_U16(advmon_allowlist_duration);
 		HDEV_PARAM_U16(advmon_no_filter_duration);
 		HDEV_PARAM_U8(enable_advmon_interleave_scan);
+		HDEV_PARAM_U32(idle_timeout);
 	} __packed rp = {
 		TLV_SET_U16(0x0000, def_page_scan_type),
 		TLV_SET_U16(0x0001, def_page_scan_int),
@@ -111,6 +124,7 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
 		TLV_SET_U16(0x001d, advmon_allowlist_duration),
 		TLV_SET_U16(0x001e, advmon_no_filter_duration),
 		TLV_SET_U8(0x001f, enable_advmon_interleave_scan),
+		TLV_SET_U32(0x0020, idle_timeout),
 	};
 
 	bt_dev_dbg(hdev, "sock %p", sk);
@@ -122,6 +136,7 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
 }
 
 #define TO_TLV(x)		((struct mgmt_tlv *)(x))
+#define TLV_GET_LE32(tlv)	le32_to_cpu(*((__le32 *)(TO_TLV(tlv)->value)))
 #define TLV_GET_LE16(tlv)	le16_to_cpu(*((__le16 *)(TO_TLV(tlv)->value)))
 #define TLV_GET_U8(tlv)		(*((__u8 *)(TO_TLV(tlv)->value)))
 
@@ -191,6 +206,9 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
 		case 0x001f:
 			exp_type_len = sizeof(u8);
 			break;
+		case 0x0020:
+			exp_type_len = sizeof(u32);
+			break;
 		default:
 			exp_type_len = 0;
 			bt_dev_warn(hdev, "unsupported parameter %u", type);
@@ -314,6 +332,9 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
 		case 0x0001f:
 			hdev->enable_advmon_interleave_scan = TLV_GET_U8(buffer);
 			break;
+		case 0x00020:
+			hdev->idle_timeout = TLV_GET_LE32(buffer);
+			break;
 		default:
 			bt_dev_warn(hdev, "unsupported parameter %u", type);
 			break;
Signature · 1 line
2.52.0
#5 lore raw

Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters

Hi Stefan,

Quoted 7 lines · Stefan Sørensen

While the configurable system parameters allow controlling the SNIFF mode parameters, they do not include the idle_timeout parameter responsible for enabling SNIFF mode.

Add the idle_timeout parameter to allow controlling the idle timeout of BR/EDR connections.

While the implementation seem quite simple and elegant you will need to first update the MGMT documentation:

https://github.com/bluez/bluez/blob/master/doc/mgmt.rst#read-default-system-configuration-since-118

And it is also a good idea to implement proper decoding for the new option in btmon, but it doesn't seem we currently decode its parameters:

https://github.com/bluez/bluez/blob/master/monitor/packet.c#L16577

I'm fine if you don't have free time to introduce decoding for the existing opcodes we can leave it for later, but that would be great for debugging purposes.

Quoted 82 lines
---
 net/bluetooth/mgmt_config.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
net/bluetooth/mgmt_config.c +21 -1
index c4063d200c0a6..4ec6c008cb7e6 100644
@@ -11,6 +11,12 @@
 #include "mgmt_util.h"
 #include "mgmt_config.h"
 
+#define HDEV_PARAM_U32(_param_name_) \
+       struct {\
+               struct mgmt_tlv_hdr entry; \
+               __le32 value; \
+       } __packed _param_name_
+
 #define HDEV_PARAM_U16(_param_name_) \
        struct {\
                struct mgmt_tlv_hdr entry; \
@@ -29,6 +35,12 @@
                cpu_to_le16(hdev->_param_name_) \
        }
 
+#define TLV_SET_U32(_param_code_, _param_name_) \
+       { \
+               { cpu_to_le32(_param_code_), sizeof(__u32) }, \
+               cpu_to_le32(hdev->_param_name_) \
+       }
+
 #define TLV_SET_U8(_param_code_, _param_name_) \
        { \
                { cpu_to_le16(_param_code_), sizeof(__u8) }, \
@@ -78,6 +90,7 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
                HDEV_PARAM_U16(advmon_allowlist_duration);
                HDEV_PARAM_U16(advmon_no_filter_duration);
                HDEV_PARAM_U8(enable_advmon_interleave_scan);
+               HDEV_PARAM_U32(idle_timeout);
        } __packed rp = {
                TLV_SET_U16(0x0000, def_page_scan_type),
                TLV_SET_U16(0x0001, def_page_scan_int),
@@ -111,6 +124,7 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
                TLV_SET_U16(0x001d, advmon_allowlist_duration),
                TLV_SET_U16(0x001e, advmon_no_filter_duration),
                TLV_SET_U8(0x001f, enable_advmon_interleave_scan),
+               TLV_SET_U32(0x0020, idle_timeout),
        };
 
        bt_dev_dbg(hdev, "sock %p", sk);
@@ -122,6 +136,7 @@ int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
 }
 
 #define TO_TLV(x)              ((struct mgmt_tlv *)(x))
+#define TLV_GET_LE32(tlv)      le32_to_cpu(*((__le32 *)(TO_TLV(tlv)->value)))
 #define TLV_GET_LE16(tlv)      le16_to_cpu(*((__le16 *)(TO_TLV(tlv)->value)))
 #define TLV_GET_U8(tlv)                (*((__u8 *)(TO_TLV(tlv)->value)))
 
@@ -191,6 +206,9 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
                case 0x001f:
                        exp_type_len = sizeof(u8);
                        break;
+               case 0x0020:
+                       exp_type_len = sizeof(u32);
+                       break;
                default:
                        exp_type_len = 0;
                        bt_dev_warn(hdev, "unsupported parameter %u", type);
@@ -314,6 +332,9 @@ int set_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
                case 0x0001f:
                        hdev->enable_advmon_interleave_scan = TLV_GET_U8(buffer);
                        break;
+               case 0x00020:
+                       hdev->idle_timeout = TLV_GET_LE32(buffer);
+                       break;
                default:
                        bt_dev_warn(hdev, "unsupported parameter %u", type);
                        break;
--

2.52.0

Signature · 1 line
Luiz Augusto von Dentz
#6 lore raw

Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters

In reply to Stefan Sørensen
kernel test robot noticed the following build warnings:

Hi Stefan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth/master]
[also build test WARNING on linus/master v6.19-rc1]
[cannot apply to bluetooth-next/master next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Stefan-S-rensen/Bluetooth-hci_conn-use-mod_delayed_work-for-active-mode-timeout/20251216-172823
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
patch link:    https://lore.kernel.org/r/20251216092011.111208-4-ssorensen%40roku.com
patch subject: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
config: x86_64-randconfig-121-20251217 (https://download.01.org/0day-ci/archive/20251220/[email protected]/config)
compiler: gcc-12 (Debian 12.4.0-5) 12.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251220/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)

>> net/bluetooth/mgmt_config.c:127:17: sparse: sparse: incorrect type in initializer (different base types) @@     expected restricted __le16 [usertype] type @@     got restricted __le32 [usertype] @@

net/bluetooth/mgmt_config.c:127:17: sparse: expected restricted __le16 [usertype] type
net/bluetooth/mgmt_config.c:127:17: sparse: got restricted __le32 [usertype]

vim +127 net/bluetooth/mgmt_config.c

    13	
    14	#define HDEV_PARAM_U32(_param_name_) \
    15		struct {\
    16			struct mgmt_tlv_hdr entry; \
    17			__le32 value; \
    18		} __packed _param_name_
    19	
    20	#define HDEV_PARAM_U16(_param_name_) \
    21		struct {\
    22			struct mgmt_tlv_hdr entry; \
    23			__le16 value; \
    24		} __packed _param_name_
    25	
    26	#define HDEV_PARAM_U8(_param_name_) \
    27		struct {\
    28			struct mgmt_tlv_hdr entry; \
    29			__u8 value; \
    30		} __packed _param_name_
    31	
    32	#define TLV_SET_U16(_param_code_, _param_name_) \
    33		{ \
    34			{ cpu_to_le16(_param_code_), sizeof(__u16) }, \
    35			cpu_to_le16(hdev->_param_name_) \
    36		}
    37	
    38	#define TLV_SET_U32(_param_code_, _param_name_) \
    39		{ \
    40			{ cpu_to_le32(_param_code_), sizeof(__u32) }, \
    41			cpu_to_le32(hdev->_param_name_) \
    42		}
    43	
    44	#define TLV_SET_U8(_param_code_, _param_name_) \
    45		{ \
    46			{ cpu_to_le16(_param_code_), sizeof(__u8) }, \
    47			hdev->_param_name_ \
    48		}
    49	
    50	#define TLV_SET_U16_JIFFIES_TO_MSECS(_param_code_, _param_name_) \
    51		{ \
    52			{ cpu_to_le16(_param_code_), sizeof(__u16) }, \
    53			cpu_to_le16(jiffies_to_msecs(hdev->_param_name_)) \
    54		}
    55	
    56	int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
    57				   u16 data_len)
    58	{
    59		int ret;
    60		struct mgmt_rp_read_def_system_config {
    61			/* Please see mgmt-api.txt for documentation of these values */
    62			HDEV_PARAM_U16(def_page_scan_type);
    63			HDEV_PARAM_U16(def_page_scan_int);
    64			HDEV_PARAM_U16(def_page_scan_window);
    65			HDEV_PARAM_U16(def_inq_scan_type);
    66			HDEV_PARAM_U16(def_inq_scan_int);
    67			HDEV_PARAM_U16(def_inq_scan_window);
    68			HDEV_PARAM_U16(def_br_lsto);
    69			HDEV_PARAM_U16(def_page_timeout);
    70			HDEV_PARAM_U16(sniff_min_interval);
    71			HDEV_PARAM_U16(sniff_max_interval);
    72			HDEV_PARAM_U16(le_adv_min_interval);
    73			HDEV_PARAM_U16(le_adv_max_interval);
    74			HDEV_PARAM_U16(def_multi_adv_rotation_duration);
    75			HDEV_PARAM_U16(le_scan_interval);
    76			HDEV_PARAM_U16(le_scan_window);
    77			HDEV_PARAM_U16(le_scan_int_suspend);
    78			HDEV_PARAM_U16(le_scan_window_suspend);
    79			HDEV_PARAM_U16(le_scan_int_discovery);
    80			HDEV_PARAM_U16(le_scan_window_discovery);
    81			HDEV_PARAM_U16(le_scan_int_adv_monitor);
    82			HDEV_PARAM_U16(le_scan_window_adv_monitor);
    83			HDEV_PARAM_U16(le_scan_int_connect);
    84			HDEV_PARAM_U16(le_scan_window_connect);
    85			HDEV_PARAM_U16(le_conn_min_interval);
    86			HDEV_PARAM_U16(le_conn_max_interval);
    87			HDEV_PARAM_U16(le_conn_latency);
    88			HDEV_PARAM_U16(le_supv_timeout);
    89			HDEV_PARAM_U16(def_le_autoconnect_timeout);
    90			HDEV_PARAM_U16(advmon_allowlist_duration);
    91			HDEV_PARAM_U16(advmon_no_filter_duration);
    92			HDEV_PARAM_U8(enable_advmon_interleave_scan);
    93			HDEV_PARAM_U32(idle_timeout);
    94		} __packed rp = {
    95			TLV_SET_U16(0x0000, def_page_scan_type),
    96			TLV_SET_U16(0x0001, def_page_scan_int),
    97			TLV_SET_U16(0x0002, def_page_scan_window),
    98			TLV_SET_U16(0x0003, def_inq_scan_type),
    99			TLV_SET_U16(0x0004, def_inq_scan_int),
   100			TLV_SET_U16(0x0005, def_inq_scan_window),
   101			TLV_SET_U16(0x0006, def_br_lsto),
   102			TLV_SET_U16(0x0007, def_page_timeout),
   103			TLV_SET_U16(0x0008, sniff_min_interval),
   104			TLV_SET_U16(0x0009, sniff_max_interval),
   105			TLV_SET_U16(0x000a, le_adv_min_interval),
   106			TLV_SET_U16(0x000b, le_adv_max_interval),
   107			TLV_SET_U16(0x000c, def_multi_adv_rotation_duration),
   108			TLV_SET_U16(0x000d, le_scan_interval),
   109			TLV_SET_U16(0x000e, le_scan_window),
   110			TLV_SET_U16(0x000f, le_scan_int_suspend),
   111			TLV_SET_U16(0x0010, le_scan_window_suspend),
   112			TLV_SET_U16(0x0011, le_scan_int_discovery),
   113			TLV_SET_U16(0x0012, le_scan_window_discovery),
   114			TLV_SET_U16(0x0013, le_scan_int_adv_monitor),
   115			TLV_SET_U16(0x0014, le_scan_window_adv_monitor),
   116			TLV_SET_U16(0x0015, le_scan_int_connect),
   117			TLV_SET_U16(0x0016, le_scan_window_connect),
   118			TLV_SET_U16(0x0017, le_conn_min_interval),
   119			TLV_SET_U16(0x0018, le_conn_max_interval),
   120			TLV_SET_U16(0x0019, le_conn_latency),
   121			TLV_SET_U16(0x001a, le_supv_timeout),
   122			TLV_SET_U16_JIFFIES_TO_MSECS(0x001b,
   123						     def_le_autoconnect_timeout),
   124			TLV_SET_U16(0x001d, advmon_allowlist_duration),
   125			TLV_SET_U16(0x001e, advmon_no_filter_duration),
   126			TLV_SET_U8(0x001f, enable_advmon_interleave_scan),
 > 127			TLV_SET_U32(0x0020, idle_timeout),

128 };
129
130 bt_dev_dbg(hdev, "sock %p", sk);
131
132 ret = mgmt_cmd_complete(sk, hdev->id,
133 MGMT_OP_READ_DEF_SYSTEM_CONFIG,
134 0, &rp, sizeof(rp));
135 return ret;
136 }
137

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#7 lore raw

Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters

In reply to Stefan Sørensen
kernel test robot noticed the following build warnings:

Hi Stefan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth/master]
[also build test WARNING on linus/master v6.19-rc1]
[cannot apply to bluetooth-next/master next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Stefan-S-rensen/Bluetooth-hci_conn-use-mod_delayed_work-for-active-mode-timeout/20251216-172823
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
patch link:    https://lore.kernel.org/r/20251216092011.111208-4-ssorensen%40roku.com
patch subject: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
config: powerpc-randconfig-002-20251217 (https://download.01.org/0day-ci/archive/20251220/[email protected]/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251220/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

>> net/bluetooth/mgmt_config.c:127:3: warning: implicit conversion from '__le32' (aka 'unsigned int') to '__le16' (aka 'unsigned short') changes value from 536870912 to 0 [-Wconstant-conversion]
     127 |                 TLV_SET_U32(0x0020, idle_timeout),
         |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/bluetooth/mgmt_config.c:40:5: note: expanded from macro 'TLV_SET_U32'
      40 |                 { cpu_to_le32(_param_code_), sizeof(__u32) }, \
         |                 ~ ^~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/byteorder/generic.h:88:21: note: expanded from macro 'cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^
   include/uapi/linux/byteorder/big_endian.h:34:27: note: expanded from macro '__cpu_to_le32'
      34 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

1 warning generated.

vim +127 net/bluetooth/mgmt_config.c

    13	
    14	#define HDEV_PARAM_U32(_param_name_) \
    15		struct {\
    16			struct mgmt_tlv_hdr entry; \
    17			__le32 value; \
    18		} __packed _param_name_
    19	
    20	#define HDEV_PARAM_U16(_param_name_) \
    21		struct {\
    22			struct mgmt_tlv_hdr entry; \
    23			__le16 value; \
    24		} __packed _param_name_
    25	
    26	#define HDEV_PARAM_U8(_param_name_) \
    27		struct {\
    28			struct mgmt_tlv_hdr entry; \
    29			__u8 value; \
    30		} __packed _param_name_
    31	
    32	#define TLV_SET_U16(_param_code_, _param_name_) \
    33		{ \
    34			{ cpu_to_le16(_param_code_), sizeof(__u16) }, \
    35			cpu_to_le16(hdev->_param_name_) \
    36		}
    37	
    38	#define TLV_SET_U32(_param_code_, _param_name_) \
    39		{ \
    40			{ cpu_to_le32(_param_code_), sizeof(__u32) }, \
    41			cpu_to_le32(hdev->_param_name_) \
    42		}
    43	
    44	#define TLV_SET_U8(_param_code_, _param_name_) \
    45		{ \
    46			{ cpu_to_le16(_param_code_), sizeof(__u8) }, \
    47			hdev->_param_name_ \
    48		}
    49	
    50	#define TLV_SET_U16_JIFFIES_TO_MSECS(_param_code_, _param_name_) \
    51		{ \
    52			{ cpu_to_le16(_param_code_), sizeof(__u16) }, \
    53			cpu_to_le16(jiffies_to_msecs(hdev->_param_name_)) \
    54		}
    55	
    56	int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
    57				   u16 data_len)
    58	{
    59		int ret;
    60		struct mgmt_rp_read_def_system_config {
    61			/* Please see mgmt-api.txt for documentation of these values */
    62			HDEV_PARAM_U16(def_page_scan_type);
    63			HDEV_PARAM_U16(def_page_scan_int);
    64			HDEV_PARAM_U16(def_page_scan_window);
    65			HDEV_PARAM_U16(def_inq_scan_type);
    66			HDEV_PARAM_U16(def_inq_scan_int);
    67			HDEV_PARAM_U16(def_inq_scan_window);
    68			HDEV_PARAM_U16(def_br_lsto);
    69			HDEV_PARAM_U16(def_page_timeout);
    70			HDEV_PARAM_U16(sniff_min_interval);
    71			HDEV_PARAM_U16(sniff_max_interval);
    72			HDEV_PARAM_U16(le_adv_min_interval);
    73			HDEV_PARAM_U16(le_adv_max_interval);
    74			HDEV_PARAM_U16(def_multi_adv_rotation_duration);
    75			HDEV_PARAM_U16(le_scan_interval);
    76			HDEV_PARAM_U16(le_scan_window);
    77			HDEV_PARAM_U16(le_scan_int_suspend);
    78			HDEV_PARAM_U16(le_scan_window_suspend);
    79			HDEV_PARAM_U16(le_scan_int_discovery);
    80			HDEV_PARAM_U16(le_scan_window_discovery);
    81			HDEV_PARAM_U16(le_scan_int_adv_monitor);
    82			HDEV_PARAM_U16(le_scan_window_adv_monitor);
    83			HDEV_PARAM_U16(le_scan_int_connect);
    84			HDEV_PARAM_U16(le_scan_window_connect);
    85			HDEV_PARAM_U16(le_conn_min_interval);
    86			HDEV_PARAM_U16(le_conn_max_interval);
    87			HDEV_PARAM_U16(le_conn_latency);
    88			HDEV_PARAM_U16(le_supv_timeout);
    89			HDEV_PARAM_U16(def_le_autoconnect_timeout);
    90			HDEV_PARAM_U16(advmon_allowlist_duration);
    91			HDEV_PARAM_U16(advmon_no_filter_duration);
    92			HDEV_PARAM_U8(enable_advmon_interleave_scan);
    93			HDEV_PARAM_U32(idle_timeout);
    94		} __packed rp = {
    95			TLV_SET_U16(0x0000, def_page_scan_type),
    96			TLV_SET_U16(0x0001, def_page_scan_int),
    97			TLV_SET_U16(0x0002, def_page_scan_window),
    98			TLV_SET_U16(0x0003, def_inq_scan_type),
    99			TLV_SET_U16(0x0004, def_inq_scan_int),
   100			TLV_SET_U16(0x0005, def_inq_scan_window),
   101			TLV_SET_U16(0x0006, def_br_lsto),
   102			TLV_SET_U16(0x0007, def_page_timeout),
   103			TLV_SET_U16(0x0008, sniff_min_interval),
   104			TLV_SET_U16(0x0009, sniff_max_interval),
   105			TLV_SET_U16(0x000a, le_adv_min_interval),
   106			TLV_SET_U16(0x000b, le_adv_max_interval),
   107			TLV_SET_U16(0x000c, def_multi_adv_rotation_duration),
   108			TLV_SET_U16(0x000d, le_scan_interval),
   109			TLV_SET_U16(0x000e, le_scan_window),
   110			TLV_SET_U16(0x000f, le_scan_int_suspend),
   111			TLV_SET_U16(0x0010, le_scan_window_suspend),
   112			TLV_SET_U16(0x0011, le_scan_int_discovery),
   113			TLV_SET_U16(0x0012, le_scan_window_discovery),
   114			TLV_SET_U16(0x0013, le_scan_int_adv_monitor),
   115			TLV_SET_U16(0x0014, le_scan_window_adv_monitor),
   116			TLV_SET_U16(0x0015, le_scan_int_connect),
   117			TLV_SET_U16(0x0016, le_scan_window_connect),
   118			TLV_SET_U16(0x0017, le_conn_min_interval),
   119			TLV_SET_U16(0x0018, le_conn_max_interval),
   120			TLV_SET_U16(0x0019, le_conn_latency),
   121			TLV_SET_U16(0x001a, le_supv_timeout),
   122			TLV_SET_U16_JIFFIES_TO_MSECS(0x001b,
   123						     def_le_autoconnect_timeout),
   124			TLV_SET_U16(0x001d, advmon_allowlist_duration),
   125			TLV_SET_U16(0x001e, advmon_no_filter_duration),
   126			TLV_SET_U8(0x001f, enable_advmon_interleave_scan),
 > 127			TLV_SET_U32(0x0020, idle_timeout),

128 };
129
130 bt_dev_dbg(hdev, "sock %p", sk);
131
132 ret = mgmt_cmd_complete(sk, hdev->id,
133 MGMT_OP_READ_DEF_SYSTEM_CONFIG,
134 0, &rp, sizeof(rp));
135 return ret;
136 }
137

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#8 lore raw

Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters

In reply to Stefan Sørensen
kernel test robot noticed the following build warnings:

Hi Stefan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth/master]
[also build test WARNING on linus/master v6.19-rc1]
[cannot apply to bluetooth-next/master next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Stefan-S-rensen/Bluetooth-hci_conn-use-mod_delayed_work-for-active-mode-timeout/20251216-172823
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
patch link:    https://lore.kernel.org/r/20251216092011.111208-4-ssorensen%40roku.com
patch subject: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
config: parisc-randconfig-002-20251217 (https://download.01.org/0day-ci/archive/20251220/[email protected]/config)
compiler: hppa-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251220/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

All warnings (new ones prefixed by >>):

In file included from include/linux/byteorder/big_endian.h:5,
from arch/parisc/include/uapi/asm/byteorder.h:5, from arch/parisc/include/asm/bitops.h:11, from include/linux/bitops.h:67,
from include/linux/kernel.h:23,
from arch/parisc/include/asm/bug.h:5, from include/linux/ktime.h:24,
from include/linux/poll.h:7,
from include/net/bluetooth/bluetooth.h:29, from net/bluetooth/mgmt_config.c:7:
net/bluetooth/mgmt_config.c: In function 'read_def_system_config':

>> include/uapi/linux/byteorder/big_endian.h:34:26: warning: conversion from 'unsigned int' to 'short unsigned int' changes value from '536870912' to '0' [-Woverflow]
      34 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                          ^
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   net/bluetooth/mgmt_config.c:40:19: note: in expansion of macro 'cpu_to_le32'
      40 |                 { cpu_to_le32(_param_code_), sizeof(__u32) }, \
         |                   ^~~~~~~~~~~
   net/bluetooth/mgmt_config.c:127:17: note: in expansion of macro 'TLV_SET_U32'
     127 |                 TLV_SET_U32(0x0020, idle_timeout),
         |                 ^~~~~~~~~~~

--
In file included from include/linux/byteorder/big_endian.h:5,
from arch/parisc/include/uapi/asm/byteorder.h:5, from arch/parisc/include/asm/bitops.h:11, from include/linux/bitops.h:67,
from include/linux/kernel.h:23,
from arch/parisc/include/asm/bug.h:5, from include/linux/ktime.h:24,
from include/linux/poll.h:7,
from include/net/bluetooth/bluetooth.h:29, from mgmt_config.c:7:
mgmt_config.c: In function 'read_def_system_config':

>> include/uapi/linux/byteorder/big_endian.h:34:26: warning: conversion from 'unsigned int' to 'short unsigned int' changes value from '536870912' to '0' [-Woverflow]
      34 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
         |                          ^
   include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
      88 | #define cpu_to_le32 __cpu_to_le32
         |                     ^~~~~~~~~~~~~
   mgmt_config.c:40:19: note: in expansion of macro 'cpu_to_le32'
      40 |                 { cpu_to_le32(_param_code_), sizeof(__u32) }, \
         |                   ^~~~~~~~~~~
   mgmt_config.c:127:17: note: in expansion of macro 'TLV_SET_U32'
     127 |                 TLV_SET_U32(0x0020, idle_timeout),
         |                 ^~~~~~~~~~~

vim +34 include/uapi/linux/byteorder/big_endian.h

5921e6f8809b16 David Howells 2012-10-13  15  
5921e6f8809b16 David Howells 2012-10-13  16  #define __constant_htonl(x) ((__force __be32)(__u32)(x))
5921e6f8809b16 David Howells 2012-10-13  17  #define __constant_ntohl(x) ((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells 2012-10-13  18  #define __constant_htons(x) ((__force __be16)(__u16)(x))
5921e6f8809b16 David Howells 2012-10-13  19  #define __constant_ntohs(x) ((__force __u16)(__be16)(x))
5921e6f8809b16 David Howells 2012-10-13  20  #define __constant_cpu_to_le64(x) ((__force __le64)___constant_swab64((x)))
5921e6f8809b16 David Howells 2012-10-13  21  #define __constant_le64_to_cpu(x) ___constant_swab64((__force __u64)(__le64)(x))
5921e6f8809b16 David Howells 2012-10-13  22  #define __constant_cpu_to_le32(x) ((__force __le32)___constant_swab32((x)))
5921e6f8809b16 David Howells 2012-10-13  23  #define __constant_le32_to_cpu(x) ___constant_swab32((__force __u32)(__le32)(x))
5921e6f8809b16 David Howells 2012-10-13  24  #define __constant_cpu_to_le16(x) ((__force __le16)___constant_swab16((x)))
5921e6f8809b16 David Howells 2012-10-13  25  #define __constant_le16_to_cpu(x) ___constant_swab16((__force __u16)(__le16)(x))
5921e6f8809b16 David Howells 2012-10-13  26  #define __constant_cpu_to_be64(x) ((__force __be64)(__u64)(x))
5921e6f8809b16 David Howells 2012-10-13  27  #define __constant_be64_to_cpu(x) ((__force __u64)(__be64)(x))
5921e6f8809b16 David Howells 2012-10-13  28  #define __constant_cpu_to_be32(x) ((__force __be32)(__u32)(x))
5921e6f8809b16 David Howells 2012-10-13  29  #define __constant_be32_to_cpu(x) ((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells 2012-10-13  30  #define __constant_cpu_to_be16(x) ((__force __be16)(__u16)(x))
5921e6f8809b16 David Howells 2012-10-13  31  #define __constant_be16_to_cpu(x) ((__force __u16)(__be16)(x))
5921e6f8809b16 David Howells 2012-10-13  32  #define __cpu_to_le64(x) ((__force __le64)__swab64((x)))
5921e6f8809b16 David Howells 2012-10-13  33  #define __le64_to_cpu(x) __swab64((__force __u64)(__le64)(x))
5921e6f8809b16 David Howells 2012-10-13 @34  #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
5921e6f8809b16 David Howells 2012-10-13  35  #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
5921e6f8809b16 David Howells 2012-10-13  36  #define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
5921e6f8809b16 David Howells 2012-10-13  37  #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
5921e6f8809b16 David Howells 2012-10-13  38  #define __cpu_to_be64(x) ((__force __be64)(__u64)(x))
5921e6f8809b16 David Howells 2012-10-13  39  #define __be64_to_cpu(x) ((__force __u64)(__be64)(x))
5921e6f8809b16 David Howells 2012-10-13  40  #define __cpu_to_be32(x) ((__force __be32)(__u32)(x))
5921e6f8809b16 David Howells 2012-10-13  41  #define __be32_to_cpu(x) ((__force __u32)(__be32)(x))
5921e6f8809b16 David Howells 2012-10-13  42  #define __cpu_to_be16(x) ((__force __be16)(__u16)(x))
5921e6f8809b16 David Howells 2012-10-13  43  #define __be16_to_cpu(x) ((__force __u16)(__be16)(x))

5921e6f8809b16 David Howells 2012-10-13 44

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#9 lore raw

Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters

In reply to Stefan Sørensen
kernel test robot noticed the following build warnings:

Hi Stefan,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bluetooth/master]
[also build test WARNING on linus/master v6.19-rc1]
[cannot apply to bluetooth-next/master next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Stefan-S-rensen/Bluetooth-hci_conn-use-mod_delayed_work-for-active-mode-timeout/20251216-172823
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth.git master
patch link:    https://lore.kernel.org/r/20251216092011.111208-4-ssorensen%40roku.com
patch subject: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
config: sparc-randconfig-r131-20251217 (https://download.01.org/0day-ci/archive/20251221/[email protected]/config)
compiler: sparc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
net/bluetooth/mgmt_config.c:127:17: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le16 [usertype] type @@ got restricted __le32 [usertype] @@
net/bluetooth/mgmt_config.c:127:17: sparse: expected restricted __le16 [usertype] type
net/bluetooth/mgmt_config.c:127:17: sparse: got restricted __le32 [usertype]

>> net/bluetooth/mgmt_config.c:127:17: sparse: sparse: cast truncates bits from constant value (20000000 becomes 0)

vim +127 net/bluetooth/mgmt_config.c

    13	
    14	#define HDEV_PARAM_U32(_param_name_) \
    15		struct {\
    16			struct mgmt_tlv_hdr entry; \
    17			__le32 value; \
    18		} __packed _param_name_
    19	
    20	#define HDEV_PARAM_U16(_param_name_) \
    21		struct {\
    22			struct mgmt_tlv_hdr entry; \
    23			__le16 value; \
    24		} __packed _param_name_
    25	
    26	#define HDEV_PARAM_U8(_param_name_) \
    27		struct {\
    28			struct mgmt_tlv_hdr entry; \
    29			__u8 value; \
    30		} __packed _param_name_
    31	
    32	#define TLV_SET_U16(_param_code_, _param_name_) \
    33		{ \
    34			{ cpu_to_le16(_param_code_), sizeof(__u16) }, \
    35			cpu_to_le16(hdev->_param_name_) \
    36		}
    37	
    38	#define TLV_SET_U32(_param_code_, _param_name_) \
    39		{ \
    40			{ cpu_to_le32(_param_code_), sizeof(__u32) }, \
    41			cpu_to_le32(hdev->_param_name_) \
    42		}
    43	
    44	#define TLV_SET_U8(_param_code_, _param_name_) \
    45		{ \
    46			{ cpu_to_le16(_param_code_), sizeof(__u8) }, \
    47			hdev->_param_name_ \
    48		}
    49	
    50	#define TLV_SET_U16_JIFFIES_TO_MSECS(_param_code_, _param_name_) \
    51		{ \
    52			{ cpu_to_le16(_param_code_), sizeof(__u16) }, \
    53			cpu_to_le16(jiffies_to_msecs(hdev->_param_name_)) \
    54		}
    55	
    56	int read_def_system_config(struct sock *sk, struct hci_dev *hdev, void *data,
    57				   u16 data_len)
    58	{
    59		int ret;
    60		struct mgmt_rp_read_def_system_config {
    61			/* Please see mgmt-api.txt for documentation of these values */
    62			HDEV_PARAM_U16(def_page_scan_type);
    63			HDEV_PARAM_U16(def_page_scan_int);
    64			HDEV_PARAM_U16(def_page_scan_window);
    65			HDEV_PARAM_U16(def_inq_scan_type);
    66			HDEV_PARAM_U16(def_inq_scan_int);
    67			HDEV_PARAM_U16(def_inq_scan_window);
    68			HDEV_PARAM_U16(def_br_lsto);
    69			HDEV_PARAM_U16(def_page_timeout);
    70			HDEV_PARAM_U16(sniff_min_interval);
    71			HDEV_PARAM_U16(sniff_max_interval);
    72			HDEV_PARAM_U16(le_adv_min_interval);
    73			HDEV_PARAM_U16(le_adv_max_interval);
    74			HDEV_PARAM_U16(def_multi_adv_rotation_duration);
    75			HDEV_PARAM_U16(le_scan_interval);
    76			HDEV_PARAM_U16(le_scan_window);
    77			HDEV_PARAM_U16(le_scan_int_suspend);
    78			HDEV_PARAM_U16(le_scan_window_suspend);
    79			HDEV_PARAM_U16(le_scan_int_discovery);
    80			HDEV_PARAM_U16(le_scan_window_discovery);
    81			HDEV_PARAM_U16(le_scan_int_adv_monitor);
    82			HDEV_PARAM_U16(le_scan_window_adv_monitor);
    83			HDEV_PARAM_U16(le_scan_int_connect);
    84			HDEV_PARAM_U16(le_scan_window_connect);
    85			HDEV_PARAM_U16(le_conn_min_interval);
    86			HDEV_PARAM_U16(le_conn_max_interval);
    87			HDEV_PARAM_U16(le_conn_latency);
    88			HDEV_PARAM_U16(le_supv_timeout);
    89			HDEV_PARAM_U16(def_le_autoconnect_timeout);
    90			HDEV_PARAM_U16(advmon_allowlist_duration);
    91			HDEV_PARAM_U16(advmon_no_filter_duration);
    92			HDEV_PARAM_U8(enable_advmon_interleave_scan);
    93			HDEV_PARAM_U32(idle_timeout);
    94		} __packed rp = {
    95			TLV_SET_U16(0x0000, def_page_scan_type),
    96			TLV_SET_U16(0x0001, def_page_scan_int),
    97			TLV_SET_U16(0x0002, def_page_scan_window),
    98			TLV_SET_U16(0x0003, def_inq_scan_type),
    99			TLV_SET_U16(0x0004, def_inq_scan_int),
   100			TLV_SET_U16(0x0005, def_inq_scan_window),
   101			TLV_SET_U16(0x0006, def_br_lsto),
   102			TLV_SET_U16(0x0007, def_page_timeout),
   103			TLV_SET_U16(0x0008, sniff_min_interval),
   104			TLV_SET_U16(0x0009, sniff_max_interval),
   105			TLV_SET_U16(0x000a, le_adv_min_interval),
   106			TLV_SET_U16(0x000b, le_adv_max_interval),
   107			TLV_SET_U16(0x000c, def_multi_adv_rotation_duration),
   108			TLV_SET_U16(0x000d, le_scan_interval),
   109			TLV_SET_U16(0x000e, le_scan_window),
   110			TLV_SET_U16(0x000f, le_scan_int_suspend),
   111			TLV_SET_U16(0x0010, le_scan_window_suspend),
   112			TLV_SET_U16(0x0011, le_scan_int_discovery),
   113			TLV_SET_U16(0x0012, le_scan_window_discovery),
   114			TLV_SET_U16(0x0013, le_scan_int_adv_monitor),
   115			TLV_SET_U16(0x0014, le_scan_window_adv_monitor),
   116			TLV_SET_U16(0x0015, le_scan_int_connect),
   117			TLV_SET_U16(0x0016, le_scan_window_connect),
   118			TLV_SET_U16(0x0017, le_conn_min_interval),
   119			TLV_SET_U16(0x0018, le_conn_max_interval),
   120			TLV_SET_U16(0x0019, le_conn_latency),
   121			TLV_SET_U16(0x001a, le_supv_timeout),
   122			TLV_SET_U16_JIFFIES_TO_MSECS(0x001b,
   123						     def_le_autoconnect_timeout),
   124			TLV_SET_U16(0x001d, advmon_allowlist_duration),
   125			TLV_SET_U16(0x001e, advmon_no_filter_duration),
   126			TLV_SET_U8(0x001f, enable_advmon_interleave_scan),
 > 127			TLV_SET_U32(0x0020, idle_timeout),

128 };
129
130 bt_dev_dbg(hdev, "sock %p", sk);
131
132 ret = mgmt_cmd_complete(sk, hdev->id,
133 MGMT_OP_READ_DEF_SYSTEM_CONFIG,
134 0, &rp, sizeof(rp));
135 return ret;
136 }
137

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
#10 lore raw
In reply to Stefan Sørensen
This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This series was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 15 lines · On Tue, 16 Dec 2025 10:20:08 +0100 you wrote:

This series addresses issues with how Bluetooth BR/EDR connections handle idle timeouts (entering Sniff mode) and exposes the timeout value to userspace:

1. Ensure the active mode timeout is correctly updated using mod_delayed_work(), preventing the timer from being ignored if already queued.
2. Apply the link policy to incoming ACL connections (previously only applied to outgoing), ensuring incoming connections can also enter idle modes.
3. Add idle_timeout to the configurable system parameters in the Management interface. This allows userspace to control when the Sniff mode is triggered, complementing the existing ability to control the Sniff parameters themselves.

Quoted 1 line

[...]

Here is the summary with links:
- [1/3] Bluetooth: hci_conn: use mod_delayed_work for active mode timeout (no matching commit)
- [2/3] Bluetooth: hci_conn: Set link_policy on incoming ACL connections

    https://git.kernel.org/bluetooth/bluetooth-next/c/f7f2402b7807
  - [3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
    https://git.kernel.org/bluetooth/bluetooth-next/c/afa20d8099dd

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html