]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Revert "Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()"
authorFrédéric Danis <frederic.danis@collabora.com>
Mon, 6 Oct 2025 08:35:44 +0000 (10:35 +0200)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 24 Oct 2025 14:30:30 +0000 (10:30 -0400)
This reverts commit c9d84da18d1e0d28a7e16ca6df8e6d47570501d4. It
replaces in L2CAP calls to msecs_to_jiffies() to secs_to_jiffies()
and updates the constants accordingly. But the constants are also
used in LCAP Configure Request and L2CAP Configure Response which
expect values in milliseconds.
This may prevent correct usage of L2CAP channel.

To fix it, keep those constants in milliseconds and so revert this
change.

Fixes: c9d84da18d1e ("Bluetooth: L2CAP: convert timeouts to secs_to_jiffies()")
Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
include/net/bluetooth/l2cap.h
net/bluetooth/l2cap_core.c

index 4bb0eaedda180fd003913f0914eb4b729e96f19c..00e182a22720a61db82f1115565ef87964a59b2b 100644 (file)
@@ -38,8 +38,8 @@
 #define L2CAP_DEFAULT_TX_WINDOW                63
 #define L2CAP_DEFAULT_EXT_WINDOW       0x3FFF
 #define L2CAP_DEFAULT_MAX_TX           3
-#define L2CAP_DEFAULT_RETRANS_TO       2    /* seconds */
-#define L2CAP_DEFAULT_MONITOR_TO       12   /* seconds */
+#define L2CAP_DEFAULT_RETRANS_TO       2000    /* 2 seconds */
+#define L2CAP_DEFAULT_MONITOR_TO       12000   /* 12 seconds */
 #define L2CAP_DEFAULT_MAX_PDU_SIZE     1492    /* Sized for AMP packet */
 #define L2CAP_DEFAULT_ACK_TO           200
 #define L2CAP_DEFAULT_MAX_SDU_SIZE     0xFFFF
index 805c752ac0a9d3f8992e3c133c7a94c8e2e4f6b7..d08320380ad67ce8998934feffedbc42f4adf2d5 100644 (file)
@@ -282,7 +282,7 @@ static void __set_retrans_timer(struct l2cap_chan *chan)
        if (!delayed_work_pending(&chan->monitor_timer) &&
            chan->retrans_timeout) {
                l2cap_set_timer(chan, &chan->retrans_timer,
-                               secs_to_jiffies(chan->retrans_timeout));
+                               msecs_to_jiffies(chan->retrans_timeout));
        }
 }
 
@@ -291,7 +291,7 @@ static void __set_monitor_timer(struct l2cap_chan *chan)
        __clear_retrans_timer(chan);
        if (chan->monitor_timeout) {
                l2cap_set_timer(chan, &chan->monitor_timer,
-                               secs_to_jiffies(chan->monitor_timeout));
+                               msecs_to_jiffies(chan->monitor_timeout));
        }
 }