]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.16-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Sep 2025 17:09:32 +0000 (19:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 21 Sep 2025 17:09:32 +0000 (19:09 +0200)
added patches:
dt-bindings-serial-8250-allow-clock-uartclk-and-reg-for-nxp-lpc1850-uart.patch
dt-bindings-serial-8250-move-a-constraint.patch
dt-bindings-serial-8250-spacemit-set-clocks-property-as-required.patch
mptcp-pm-nl-announce-deny-join-id0-flag.patch
samples-damon-change-enable-parameters-to-enabled.patch
samples-damon-mtier-avoid-starting-damon-before-initialization.patch
samples-damon-prcl-fix-boot-time-enable-crash.patch

queue-6.16/dt-bindings-serial-8250-allow-clock-uartclk-and-reg-for-nxp-lpc1850-uart.patch [new file with mode: 0644]
queue-6.16/dt-bindings-serial-8250-move-a-constraint.patch [new file with mode: 0644]
queue-6.16/dt-bindings-serial-8250-spacemit-set-clocks-property-as-required.patch [new file with mode: 0644]
queue-6.16/mptcp-pm-nl-announce-deny-join-id0-flag.patch [new file with mode: 0644]
queue-6.16/samples-damon-change-enable-parameters-to-enabled.patch [new file with mode: 0644]
queue-6.16/samples-damon-mtier-avoid-starting-damon-before-initialization.patch [new file with mode: 0644]
queue-6.16/samples-damon-prcl-fix-boot-time-enable-crash.patch [new file with mode: 0644]
queue-6.16/series

diff --git a/queue-6.16/dt-bindings-serial-8250-allow-clock-uartclk-and-reg-for-nxp-lpc1850-uart.patch b/queue-6.16/dt-bindings-serial-8250-allow-clock-uartclk-and-reg-for-nxp-lpc1850-uart.patch
new file mode 100644 (file)
index 0000000..2d4a176
--- /dev/null
@@ -0,0 +1,98 @@
+From stable+bounces-179832-greg=kroah.com@vger.kernel.org Wed Sep 17 13:59:49 2025
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 Sep 2025 07:57:44 -0400
+Subject: dt-bindings: serial: 8250: allow clock 'uartclk' and 'reg' for nxp,lpc1850-uart
+To: stable@vger.kernel.org
+Cc: Frank Li <Frank.Li@nxp.com>, "Rob Herring (Arm)" <robh@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>
+Message-ID: <20250917115746.482046-1-sashal@kernel.org>
+
+From: Frank Li <Frank.Li@nxp.com>
+
+[ Upstream commit d2db0d78154442fb89165edf8836bf2644c6c58d ]
+
+Allow clock 'uartclk' and 'reg' for nxp,lpc1850-uart to align existed
+driver and dts. It is really old platform. Keep the same restriction for
+others.
+
+Allow dmas and dma-names property, which allow maxItems 4 because very old
+platform (arch/arm/boot/dts/nxp/lpc/lpc18xx.dtsi) use duplicate "tx", "rx",
+"tx", "rx" as dma-names.
+
+Fix below CHECK_DTB warnings:
+  arch/arm/boot/dts/nxp/lpc/lpc4337-ciaa.dtb: serial@40081000 (nxp,lpc1850-uart): clock-names: ['uartclk', 'reg'] is too long
+
+Signed-off-by: Frank Li <Frank.Li@nxp.com>
+Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
+Link: https://lore.kernel.org/r/20250602142745.942568-1-Frank.Li@nxp.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 387d00028ccc ("dt-bindings: serial: 8250: move a constraint")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/devicetree/bindings/serial/8250.yaml |   41 ++++++++++++++++++---
+ 1 file changed, 37 insertions(+), 4 deletions(-)
+
+--- a/Documentation/devicetree/bindings/serial/8250.yaml
++++ b/Documentation/devicetree/bindings/serial/8250.yaml
+@@ -49,6 +49,24 @@ allOf:
+         - required: [ clock-frequency ]
+         - required: [ clocks ]
++  - if:
++      properties:
++        compatible:
++          contains:
++            const: nxp,lpc1850-uart
++    then:
++      properties:
++        clock-names:
++          items:
++            - const: uartclk
++            - const: reg
++    else:
++      properties:
++        clock-names:
++          items:
++            - const: core
++            - const: bus
++
+ properties:
+   compatible:
+     oneOf:
+@@ -142,9 +160,22 @@ properties:
+   clock-names:
+     minItems: 1
+-    items:
+-      - const: core
+-      - const: bus
++    maxItems: 2
++    oneOf:
++      - items:
++          - const: core
++          - const: bus
++      - items:
++          - const: uartclk
++          - const: reg
++
++  dmas:
++    minItems: 1
++    maxItems: 4
++
++  dma-names:
++    minItems: 1
++    maxItems: 4
+   resets:
+     maxItems: 1
+@@ -237,7 +268,9 @@ if:
+   properties:
+     compatible:
+       contains:
+-        const: spacemit,k1-uart
++        enum:
++          - spacemit,k1-uart
++          - nxp,lpc1850-uart
+ then:
+   required: [clock-names]
+   properties:
diff --git a/queue-6.16/dt-bindings-serial-8250-move-a-constraint.patch b/queue-6.16/dt-bindings-serial-8250-move-a-constraint.patch
new file mode 100644 (file)
index 0000000..577bddf
--- /dev/null
@@ -0,0 +1,100 @@
+From sashal@kernel.org Wed Sep 17 13:57:51 2025
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 Sep 2025 07:57:46 -0400
+Subject: dt-bindings: serial: 8250: move a constraint
+To: stable@vger.kernel.org
+Cc: Alex Elder <elder@riscstar.com>, stable <stable@kernel.org>, Conor Dooley <conor@kernel.org>, Conor Dooley <conor.dooley@microchip.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>
+Message-ID: <20250917115746.482046-3-sashal@kernel.org>
+
+From: Alex Elder <elder@riscstar.com>
+
+[ Upstream commit 387d00028cccee7575f6416953bef62f849d83e3 ]
+
+A block that required a "spacemit,k1-uart" compatible node to
+specify two clocks was placed in the wrong spot in the binding.
+Conor Dooley pointed out it belongs earlier in the file, as part
+of the initial "allOf".
+
+Fixes: 2c0594f9f0629 ("dt-bindings: serial: 8250: support an optional second clock")
+Cc: stable <stable@kernel.org>
+Reported-by: Conor Dooley <conor@kernel.org>
+Closes: https://lore.kernel.org/lkml/20250729-reshuffle-contented-e6def76b540b@spud/
+Signed-off-by: Alex Elder <elder@riscstar.com>
+Acked-by: Conor Dooley <conor.dooley@microchip.com>
+Link: https://lore.kernel.org/r/20250813032151.2330616-1-elder@riscstar.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/devicetree/bindings/serial/8250.yaml |   46 ++++++++++-----------
+ 1 file changed, 22 insertions(+), 24 deletions(-)
+
+--- a/Documentation/devicetree/bindings/serial/8250.yaml
++++ b/Documentation/devicetree/bindings/serial/8250.yaml
+@@ -48,7 +48,6 @@ allOf:
+       oneOf:
+         - required: [ clock-frequency ]
+         - required: [ clocks ]
+-
+   - if:
+       properties:
+         compatible:
+@@ -66,6 +65,28 @@ allOf:
+           items:
+             - const: core
+             - const: bus
++  - if:
++      properties:
++        compatible:
++          contains:
++            enum:
++              - spacemit,k1-uart
++              - nxp,lpc1850-uart
++    then:
++      required:
++        - clocks
++        - clock-names
++      properties:
++        clocks:
++          minItems: 2
++        clock-names:
++          minItems: 2
++    else:
++      properties:
++        clocks:
++          maxItems: 1
++        clock-names:
++          maxItems: 1
+ properties:
+   compatible:
+@@ -264,29 +285,6 @@ required:
+   - reg
+   - interrupts
+-if:
+-  properties:
+-    compatible:
+-      contains:
+-        enum:
+-          - spacemit,k1-uart
+-          - nxp,lpc1850-uart
+-then:
+-  required:
+-    - clocks
+-    - clock-names
+-  properties:
+-    clocks:
+-      minItems: 2
+-    clock-names:
+-      minItems: 2
+-else:
+-  properties:
+-    clocks:
+-      maxItems: 1
+-    clock-names:
+-      maxItems: 1
+-
+ unevaluatedProperties: false
+ examples:
diff --git a/queue-6.16/dt-bindings-serial-8250-spacemit-set-clocks-property-as-required.patch b/queue-6.16/dt-bindings-serial-8250-spacemit-set-clocks-property-as-required.patch
new file mode 100644 (file)
index 0000000..19b73b7
--- /dev/null
@@ -0,0 +1,40 @@
+From stable+bounces-179833-greg=kroah.com@vger.kernel.org Wed Sep 17 13:58:15 2025
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 17 Sep 2025 07:57:45 -0400
+Subject: dt-bindings: serial: 8250: spacemit: set clocks property as required
+To: stable@vger.kernel.org
+Cc: Yixun Lan <dlan@gentoo.org>, "Rob Herring (Arm)" <robh@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sasha Levin <sashal@kernel.org>
+Message-ID: <20250917115746.482046-2-sashal@kernel.org>
+
+From: Yixun Lan <dlan@gentoo.org>
+
+[ Upstream commit 48f9034e024a4c6e279b0d040e1f5589bb544806 ]
+
+In SpacemiT's K1 SoC, the clocks for UART are mandatory needed, so
+for DT, both clocks and clock-names property should be set as required.
+
+Fixes: 2c0594f9f062 ("dt-bindings: serial: 8250: support an optional second clock")
+Signed-off-by: Yixun Lan <dlan@gentoo.org>
+Acked-by: "Rob Herring (Arm)" <robh@kernel.org>
+Link: https://lore.kernel.org/r/20250718-01-k1-uart-binding-v1-1-a92e1e14c836@gentoo.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Stable-dep-of: 387d00028ccc ("dt-bindings: serial: 8250: move a constraint")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/devicetree/bindings/serial/8250.yaml |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/Documentation/devicetree/bindings/serial/8250.yaml
++++ b/Documentation/devicetree/bindings/serial/8250.yaml
+@@ -272,7 +272,9 @@ if:
+           - spacemit,k1-uart
+           - nxp,lpc1850-uart
+ then:
+-  required: [clock-names]
++  required:
++    - clocks
++    - clock-names
+   properties:
+     clocks:
+       minItems: 2
diff --git a/queue-6.16/mptcp-pm-nl-announce-deny-join-id0-flag.patch b/queue-6.16/mptcp-pm-nl-announce-deny-join-id0-flag.patch
new file mode 100644 (file)
index 0000000..c643c9b
--- /dev/null
@@ -0,0 +1,124 @@
+From stable+bounces-180709-greg=kroah.com@vger.kernel.org Fri Sep 19 23:50:00 2025
+From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
+Date: Fri, 19 Sep 2025 23:49:22 +0200
+Subject: mptcp: pm: nl: announce deny-join-id0 flag
+To: stable@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org
+Cc: MPTCP Upstream <mptcp@lists.linux.dev>, "Matthieu Baerts (NGI0)" <matttbe@kernel.org>, Marek Majkowski <marek@cloudflare.com>, Mat Martineau <martineau@kernel.org>, Jakub Kicinski <kuba@kernel.org>
+Message-ID: <20250919214921.3467324-2-matttbe@kernel.org>
+
+From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
+
+commit 2293c57484ae64c9a3c847c8807db8c26a3a4d41 upstream.
+
+During the connection establishment, a peer can tell the other one that
+it cannot establish new subflows to the initial IP address and port by
+setting the 'C' flag [1]. Doing so makes sense when the sender is behind
+a strict NAT, operating behind a legacy Layer 4 load balancer, or using
+anycast IP address for example.
+
+When this 'C' flag is set, the path-managers must then not try to
+establish new subflows to the other peer's initial IP address and port.
+The in-kernel PM has access to this info, but the userspace PM didn't.
+
+The RFC8684 [1] is strict about that:
+
+  (...) therefore the receiver MUST NOT try to open any additional
+  subflows toward this address and port.
+
+So it is important to tell the userspace about that as it is responsible
+for the respect of this flag.
+
+When a new connection is created and established, the Netlink events
+now contain the existing but not currently used 'flags' attribute. When
+MPTCP_PM_EV_FLAG_DENY_JOIN_ID0 is set, it means no other subflows
+to the initial IP address and port -- info that are also part of the
+event -- can be established.
+
+Link: https://datatracker.ietf.org/doc/html/rfc8684#section-3.1-20.6 [1]
+Fixes: 702c2f646d42 ("mptcp: netlink: allow userspace-driven subflow establishment")
+Reported-by: Marek Majkowski <marek@cloudflare.com>
+Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/532
+Reviewed-by: Mat Martineau <martineau@kernel.org>
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Link: https://patch.msgid.link/20250912-net-mptcp-pm-uspace-deny_join_id0-v1-2-40171884ade8@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+[ Conflicts in mptcp_pm.yaml, because the indentation has been modified
+  in commit ec362192aa9e ("netlink: specs: fix up indentation errors"),
+  which is not in this version. Applying the same modifications, but at
+  a different level. ]
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ Documentation/netlink/specs/mptcp_pm.yaml |    4 ++--
+ include/uapi/linux/mptcp.h                |    2 ++
+ include/uapi/linux/mptcp_pm.h             |    4 ++--
+ net/mptcp/pm_netlink.c                    |    7 +++++++
+ 4 files changed, 13 insertions(+), 4 deletions(-)
+
+--- a/Documentation/netlink/specs/mptcp_pm.yaml
++++ b/Documentation/netlink/specs/mptcp_pm.yaml
+@@ -28,13 +28,13 @@ definitions:
+         traffic-patterns it can take a long time until the
+         MPTCP_EVENT_ESTABLISHED is sent.
+         Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
+-        dport, server-side.
++        dport, server-side, [flags].
+      -
+       name: established
+       doc: >-
+         A MPTCP connection is established (can start new subflows).
+         Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,
+-        dport, server-side.
++        dport, server-side, [flags].
+      -
+       name: closed
+       doc: >-
+--- a/include/uapi/linux/mptcp.h
++++ b/include/uapi/linux/mptcp.h
+@@ -31,6 +31,8 @@
+ #define MPTCP_INFO_FLAG_FALLBACK              _BITUL(0)
+ #define MPTCP_INFO_FLAG_REMOTE_KEY_RECEIVED   _BITUL(1)
++#define MPTCP_PM_EV_FLAG_DENY_JOIN_ID0                _BITUL(0)
++
+ #define MPTCP_PM_ADDR_FLAG_SIGNAL                      (1 << 0)
+ #define MPTCP_PM_ADDR_FLAG_SUBFLOW                     (1 << 1)
+ #define MPTCP_PM_ADDR_FLAG_BACKUP                      (1 << 2)
+--- a/include/uapi/linux/mptcp_pm.h
++++ b/include/uapi/linux/mptcp_pm.h
+@@ -16,10 +16,10 @@
+  *   good time to allocate memory and send ADD_ADDR if needed. Depending on the
+  *   traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED
+  *   is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
+- *   sport, dport, server-side.
++ *   sport, dport, server-side, [flags].
+  * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new
+  *   subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,
+- *   sport, dport, server-side.
++ *   sport, dport, server-side, [flags].
+  * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token.
+  * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer.
+  *   Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].
+--- a/net/mptcp/pm_netlink.c
++++ b/net/mptcp/pm_netlink.c
+@@ -408,6 +408,7 @@ static int mptcp_event_created(struct sk
+                              const struct sock *ssk)
+ {
+       int err = nla_put_u32(skb, MPTCP_ATTR_TOKEN, READ_ONCE(msk->token));
++      u16 flags = 0;
+       if (err)
+               return err;
+@@ -415,6 +416,12 @@ static int mptcp_event_created(struct sk
+       if (nla_put_u8(skb, MPTCP_ATTR_SERVER_SIDE, READ_ONCE(msk->pm.server_side)))
+               return -EMSGSIZE;
++      if (READ_ONCE(msk->pm.remote_deny_join_id0))
++              flags |= MPTCP_PM_EV_FLAG_DENY_JOIN_ID0;
++
++      if (flags && nla_put_u16(skb, MPTCP_ATTR_FLAGS, flags))
++              return -EMSGSIZE;
++
+       return mptcp_event_add_subflow(skb, ssk);
+ }
diff --git a/queue-6.16/samples-damon-change-enable-parameters-to-enabled.patch b/queue-6.16/samples-damon-change-enable-parameters-to-enabled.patch
new file mode 100644 (file)
index 0000000..af91091
--- /dev/null
@@ -0,0 +1,228 @@
+From stable+bounces-180812-greg=kroah.com@vger.kernel.org Sun Sep 21 16:11:29 2025
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 21 Sep 2025 10:11:18 -0400
+Subject: samples/damon: change enable parameters to enabled
+To: stable@vger.kernel.org
+Cc: Honggyu Kim <honggyu.kim@sk.com>, SeongJae Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Sasha Levin <sashal@kernel.org>
+Message-ID: <20250921141119.2917725-2-sashal@kernel.org>
+
+From: Honggyu Kim <honggyu.kim@sk.com>
+
+[ Upstream commit 793020545cea0c9e2a79de6ad5c9746ec4f5bd7e ]
+
+The damon_{lru_sort,reclaim,stat} kernel modules use "enabled" parameter
+knobs as follows.
+
+  /sys/module/damon_lru_sort/parameters/enabled
+  /sys/module/damon_reclaim/parameters/enabled
+  /sys/module/damon_stat/parameters/enabled
+
+However, other sample modules of damon use "enable" parameter knobs so
+it'd be better to rename them from "enable" to "enabled" to keep the
+consistency with other damon modules.
+
+Before:
+  /sys/module/damon_sample_wsse/parameters/enable
+  /sys/module/damon_sample_prcl/parameters/enable
+  /sys/module/damon_sample_mtier/parameters/enable
+
+After:
+  /sys/module/damon_sample_wsse/parameters/enabled
+  /sys/module/damon_sample_prcl/parameters/enabled
+  /sys/module/damon_sample_mtier/parameters/enabled
+
+There is no functional changes in this patch.
+
+Link: https://lkml.kernel.org/r/20250707024548.1964-1-honggyu.kim@sk.com
+Signed-off-by: Honggyu Kim <honggyu.kim@sk.com>
+Reviewed-by: SeongJae Park <sj@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Stable-dep-of: c62cff40481c ("samples/damon/mtier: avoid starting DAMON before initialization")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ samples/damon/mtier.c |   22 +++++++++++-----------
+ samples/damon/prcl.c  |   22 +++++++++++-----------
+ samples/damon/wsse.c  |   22 +++++++++++-----------
+ 3 files changed, 33 insertions(+), 33 deletions(-)
+
+--- a/samples/damon/mtier.c
++++ b/samples/damon/mtier.c
+@@ -27,14 +27,14 @@ module_param(node1_end_addr, ulong, 0600
+ static int damon_sample_mtier_enable_store(
+               const char *val, const struct kernel_param *kp);
+-static const struct kernel_param_ops enable_param_ops = {
++static const struct kernel_param_ops enabled_param_ops = {
+       .set = damon_sample_mtier_enable_store,
+       .get = param_get_bool,
+ };
+-static bool enable __read_mostly;
+-module_param_cb(enable, &enable_param_ops, &enable, 0600);
+-MODULE_PARM_DESC(enable, "Enable of disable DAMON_SAMPLE_MTIER");
++static bool enabled __read_mostly;
++module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
++MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_MTIER");
+ static struct damon_ctx *ctxs[2];
+@@ -156,20 +156,20 @@ static bool init_called;
+ static int damon_sample_mtier_enable_store(
+               const char *val, const struct kernel_param *kp)
+ {
+-      bool enabled = enable;
++      bool is_enabled = enabled;
+       int err;
+-      err = kstrtobool(val, &enable);
++      err = kstrtobool(val, &enabled);
+       if (err)
+               return err;
+-      if (enable == enabled)
++      if (enabled == is_enabled)
+               return 0;
+-      if (enable) {
++      if (enabled) {
+               err = damon_sample_mtier_start();
+               if (err)
+-                      enable = false;
++                      enabled = false;
+               return err;
+       }
+       damon_sample_mtier_stop();
+@@ -181,10 +181,10 @@ static int __init damon_sample_mtier_ini
+       int err = 0;
+       init_called = true;
+-      if (enable) {
++      if (enabled) {
+               err = damon_sample_mtier_start();
+               if (err)
+-                      enable = false;
++                      enabled = false;
+       }
+       return 0;
+ }
+--- a/samples/damon/prcl.c
++++ b/samples/damon/prcl.c
+@@ -17,14 +17,14 @@ module_param(target_pid, int, 0600);
+ static int damon_sample_prcl_enable_store(
+               const char *val, const struct kernel_param *kp);
+-static const struct kernel_param_ops enable_param_ops = {
++static const struct kernel_param_ops enabled_param_ops = {
+       .set = damon_sample_prcl_enable_store,
+       .get = param_get_bool,
+ };
+-static bool enable __read_mostly;
+-module_param_cb(enable, &enable_param_ops, &enable, 0600);
+-MODULE_PARM_DESC(enable, "Enable of disable DAMON_SAMPLE_WSSE");
++static bool enabled __read_mostly;
++module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
++MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_PRCL");
+ static struct damon_ctx *ctx;
+ static struct pid *target_pidp;
+@@ -114,20 +114,20 @@ static bool init_called;
+ static int damon_sample_prcl_enable_store(
+               const char *val, const struct kernel_param *kp)
+ {
+-      bool enabled = enable;
++      bool is_enabled = enabled;
+       int err;
+-      err = kstrtobool(val, &enable);
++      err = kstrtobool(val, &enabled);
+       if (err)
+               return err;
+-      if (enable == enabled)
++      if (enabled == is_enabled)
+               return 0;
+-      if (enable) {
++      if (enabled) {
+               err = damon_sample_prcl_start();
+               if (err)
+-                      enable = false;
++                      enabled = false;
+               return err;
+       }
+       damon_sample_prcl_stop();
+@@ -139,10 +139,10 @@ static int __init damon_sample_prcl_init
+       int err = 0;
+       init_called = true;
+-      if (enable) {
++      if (enabled) {
+               err = damon_sample_prcl_start();
+               if (err)
+-                      enable = false;
++                      enabled = false;
+       }
+       return 0;
+ }
+--- a/samples/damon/wsse.c
++++ b/samples/damon/wsse.c
+@@ -18,14 +18,14 @@ module_param(target_pid, int, 0600);
+ static int damon_sample_wsse_enable_store(
+               const char *val, const struct kernel_param *kp);
+-static const struct kernel_param_ops enable_param_ops = {
++static const struct kernel_param_ops enabled_param_ops = {
+       .set = damon_sample_wsse_enable_store,
+       .get = param_get_bool,
+ };
+-static bool enable __read_mostly;
+-module_param_cb(enable, &enable_param_ops, &enable, 0600);
+-MODULE_PARM_DESC(enable, "Enable or disable DAMON_SAMPLE_WSSE");
++static bool enabled __read_mostly;
++module_param_cb(enabled, &enabled_param_ops, &enabled, 0600);
++MODULE_PARM_DESC(enabled, "Enable or disable DAMON_SAMPLE_WSSE");
+ static struct damon_ctx *ctx;
+ static struct pid *target_pidp;
+@@ -94,20 +94,20 @@ static bool init_called;
+ static int damon_sample_wsse_enable_store(
+               const char *val, const struct kernel_param *kp)
+ {
+-      bool enabled = enable;
++      bool is_enabled = enabled;
+       int err;
+-      err = kstrtobool(val, &enable);
++      err = kstrtobool(val, &enabled);
+       if (err)
+               return err;
+-      if (enable == enabled)
++      if (enabled == is_enabled)
+               return 0;
+-      if (enable) {
++      if (enabled) {
+               err = damon_sample_wsse_start();
+               if (err)
+-                      enable = false;
++                      enabled = false;
+               return err;
+       }
+       damon_sample_wsse_stop();
+@@ -119,10 +119,10 @@ static int __init damon_sample_wsse_init
+       int err = 0;
+       init_called = true;
+-      if (enable) {
++      if (enabled) {
+               err = damon_sample_wsse_start();
+               if (err)
+-                      enable = false;
++                      enabled = false;
+       }
+       return err;
+ }
diff --git a/queue-6.16/samples-damon-mtier-avoid-starting-damon-before-initialization.patch b/queue-6.16/samples-damon-mtier-avoid-starting-damon-before-initialization.patch
new file mode 100644 (file)
index 0000000..e6b3388
--- /dev/null
@@ -0,0 +1,42 @@
+From stable+bounces-180813-greg=kroah.com@vger.kernel.org Sun Sep 21 16:11:34 2025
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 21 Sep 2025 10:11:19 -0400
+Subject: samples/damon/mtier: avoid starting DAMON before initialization
+To: stable@vger.kernel.org
+Cc: SeongJae Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Sasha Levin <sashal@kernel.org>
+Message-ID: <20250921141119.2917725-3-sashal@kernel.org>
+
+From: SeongJae Park <sj@kernel.org>
+
+[ Upstream commit c62cff40481c037307a13becbda795f7afdcfebd ]
+
+Commit 964314344eab ("samples/damon/mtier: support boot time enable
+setup") is somehow incompletely applying the origin patch [1].  It is
+missing the part that avoids starting DAMON before module initialization.
+Probably a mistake during a merge has happened.  Fix it by applying the
+missed part again.
+
+Link: https://lkml.kernel.org/r/20250909022238.2989-4-sj@kernel.org
+Link: https://lore.kernel.org/20250706193207.39810-4-sj@kernel.org [1]
+Fixes: 964314344eab ("samples/damon/mtier: support boot time enable setup")
+Signed-off-by: SeongJae Park <sj@kernel.org>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ samples/damon/mtier.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/samples/damon/mtier.c
++++ b/samples/damon/mtier.c
+@@ -166,6 +166,9 @@ static int damon_sample_mtier_enable_sto
+       if (enabled == is_enabled)
+               return 0;
++      if (!init_called)
++              return 0;
++
+       if (enabled) {
+               err = damon_sample_mtier_start();
+               if (err)
diff --git a/queue-6.16/samples-damon-prcl-fix-boot-time-enable-crash.patch b/queue-6.16/samples-damon-prcl-fix-boot-time-enable-crash.patch
new file mode 100644 (file)
index 0000000..fd08272
--- /dev/null
@@ -0,0 +1,54 @@
+From stable+bounces-180811-greg=kroah.com@vger.kernel.org Sun Sep 21 16:11:30 2025
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 21 Sep 2025 10:11:17 -0400
+Subject: samples/damon/prcl: fix boot time enable crash
+To: stable@vger.kernel.org
+Cc: SeongJae Park <sj@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, Sasha Levin <sashal@kernel.org>
+Message-ID: <20250921141119.2917725-1-sashal@kernel.org>
+
+From: SeongJae Park <sj@kernel.org>
+
+[ Upstream commit 2780505ec2b42c07853b34640bc63279ac2bb53b ]
+
+If 'enable' parameter of the 'prcl' DAMON sample module is set at boot
+time via the kernel command line, memory allocation is tried before the
+slab is initialized.  As a result kernel NULL pointer dereference BUG can
+happen.  Fix it by checking the initialization status.
+
+Link: https://lkml.kernel.org/r/20250706193207.39810-3-sj@kernel.org
+Fixes: 2aca254620a8 ("samples/damon: introduce a skeleton of a smaple DAMON module for proactive reclamation")
+Signed-off-by: SeongJae Park <sj@kernel.org>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Stable-dep-of: c62cff40481c ("samples/damon/mtier: avoid starting DAMON before initialization")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ samples/damon/prcl.c |   10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/samples/damon/prcl.c
++++ b/samples/damon/prcl.c
+@@ -109,6 +109,8 @@ static void damon_sample_prcl_stop(void)
+               put_pid(target_pidp);
+ }
++static bool init_called;
++
+ static int damon_sample_prcl_enable_store(
+               const char *val, const struct kernel_param *kp)
+ {
+@@ -134,6 +136,14 @@ static int damon_sample_prcl_enable_stor
+ static int __init damon_sample_prcl_init(void)
+ {
++      int err = 0;
++
++      init_called = true;
++      if (enable) {
++              err = damon_sample_prcl_start();
++              if (err)
++                      enable = false;
++      }
+       return 0;
+ }
index 87baa7210e53fa98c85e75e3c0871f803a6b66c9..9767f0233bc0fbcaf4251404bb139902c33892fe 100644 (file)
@@ -138,3 +138,10 @@ smb-client-fix-smbdirect_recv_io-leak-in-smbd_negoti.patch
 io_uring-fix-incorrect-io_kiocb-reference-in-io_link.patch
 platform-x86-asus-wmi-fix-rog-button-mapping-tablet-mode-on-asus-rog-z13.patch
 platform-x86-asus-wmi-re-add-extra-keys-to-ignore_key_wlan-quirk.patch
+mptcp-pm-nl-announce-deny-join-id0-flag.patch
+dt-bindings-serial-8250-allow-clock-uartclk-and-reg-for-nxp-lpc1850-uart.patch
+dt-bindings-serial-8250-spacemit-set-clocks-property-as-required.patch
+dt-bindings-serial-8250-move-a-constraint.patch
+samples-damon-prcl-fix-boot-time-enable-crash.patch
+samples-damon-change-enable-parameters-to-enabled.patch
+samples-damon-mtier-avoid-starting-damon-before-initialization.patch