* Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
2025-12-16 9:20 ` [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters Stefan Sørensen
@ 2025-12-16 15:02 ` Luiz Augusto von Dentz
2025-12-20 14:23 ` kernel test robot
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Luiz Augusto von Dentz @ 2025-12-16 15:02 UTC (permalink / raw)
To: Stefan Sørensen; +Cc: marcel, johan.hedberg, linux-bluetooth
Hi Stefan,
On Tue, Dec 16, 2025 at 4:20 AM Stefan Sørensen <ssorensen@roku.com> wrote:
>
> 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.
> Signed-off-by: Stefan Sørensen <ssorensen@roku.com>
> ---
> net/bluetooth/mgmt_config.c | 21 +++++++++++++++++++++
> 1 file changed, 21 insertions(+)
>
> diff --git a/net/bluetooth/mgmt_config.c b/net/bluetooth/mgmt_config.c
> index c4063d200c0a6..4ec6c008cb7e6 100644
> --- a/net/bluetooth/mgmt_config.c
> +++ b/net/bluetooth/mgmt_config.c
> @@ -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
>
--
Luiz Augusto von Dentz
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
2025-12-16 9:20 ` [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters Stefan Sørensen
2025-12-16 15:02 ` Luiz Augusto von Dentz
@ 2025-12-20 14:23 ` kernel test robot
2025-12-20 14:45 ` kernel test robot
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-12-20 14:23 UTC (permalink / raw)
To: Stefan Sørensen; +Cc: oe-kbuild-all
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/202512202114.v6VR6ui1-lkp@intel.com/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/202512202114.v6VR6ui1-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512202114.v6VR6ui1-lkp@intel.com/
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
2025-12-16 9:20 ` [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters Stefan Sørensen
2025-12-16 15:02 ` Luiz Augusto von Dentz
2025-12-20 14:23 ` kernel test robot
@ 2025-12-20 14:45 ` kernel test robot
2025-12-20 15:10 ` kernel test robot
2025-12-20 18:54 ` kernel test robot
4 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-12-20 14:45 UTC (permalink / raw)
To: Stefan Sørensen; +Cc: llvm, oe-kbuild-all
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/202512202237.WBGxzX9D-lkp@intel.com/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/202512202237.WBGxzX9D-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512202237.WBGxzX9D-lkp@intel.com/
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
2025-12-16 9:20 ` [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters Stefan Sørensen
` (2 preceding siblings ...)
2025-12-20 14:45 ` kernel test robot
@ 2025-12-20 15:10 ` kernel test robot
2025-12-20 18:54 ` kernel test robot
4 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-12-20 15:10 UTC (permalink / raw)
To: Stefan Sørensen; +Cc: oe-kbuild-all
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/202512202236.I5VEcbqG-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251220/202512202236.I5VEcbqG-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512202236.I5VEcbqG-lkp@intel.com/
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters
2025-12-16 9:20 ` [PATCH 3/3] Bluetooth: mgmt: Add idle_timeout to configurable system parameters Stefan Sørensen
` (3 preceding siblings ...)
2025-12-20 15:10 ` kernel test robot
@ 2025-12-20 18:54 ` kernel test robot
4 siblings, 0 replies; 11+ messages in thread
From: kernel test robot @ 2025-12-20 18:54 UTC (permalink / raw)
To: Stefan Sørensen; +Cc: oe-kbuild-all
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/202512210227.W5Lo4AvX-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512210227.W5Lo4AvX-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512210227.W5Lo4AvX-lkp@intel.com/
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
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 11+ messages in thread