From: Greg Kroah-Hartman Date: Mon, 26 Aug 2024 12:10:28 +0000 (+0200) Subject: 6.1-stable patches X-Git-Tag: v6.1.107~40 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2314153305c0e37db8ba308ae37473a8044e3487;p=thirdparty%2Fkernel%2Fstable-queue.git 6.1-stable patches added patches: cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch input-i8042-add-forcenorestore-quirk-to-leave-controller-untouched-even-on-s3.patch input-i8042-use-new-forcenorestore-quirk-to-replace-old-buggy-quirk-combination.patch kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch mptcp-pm-only-decrement-add_addr_accepted-for-mpj-req.patch mptcp-pm-re-using-id-of-unused-flushed-subflows.patch mptcp-pm-re-using-id-of-unused-removed-add_addr.patch mptcp-pm-re-using-id-of-unused-removed-subflows.patch pmdomain-imx-wait-ssar-when-i.mx93-power-domain-on.patch thermal-of-fix-of-node-leak-in-of_thermal_zone_find-error-paths.patch thermal-of-fix-of-node-leak-in-thermal_of_trips_init-error-path.patch --- diff --git a/queue-6.1/cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch b/queue-6.1/cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch new file mode 100644 index 00000000000..7bed87b8cc1 --- /dev/null +++ b/queue-6.1/cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch @@ -0,0 +1,38 @@ +From 80a1e7b83bb1834b5568a3872e64c05795d88f31 Mon Sep 17 00:00:00 2001 +From: Nikolay Kuratov +Date: Mon, 19 Aug 2024 10:54:08 +0300 +Subject: cxgb4: add forgotten u64 ivlan cast before shift + +From: Nikolay Kuratov + +commit 80a1e7b83bb1834b5568a3872e64c05795d88f31 upstream. + +It is done everywhere in cxgb4 code, e.g. in is_filter_exact_match() +There is no reason it should not be done here + +Found by Linux Verification Center (linuxtesting.org) with SVACE + +Signed-off-by: Nikolay Kuratov +Cc: stable@vger.kernel.org +Fixes: 12b276fbf6e0 ("cxgb4: add support to create hash filters") +Reviewed-by: Simon Horman +Reviewed-by: Jacob Keller +Link: https://patch.msgid.link/20240819075408.92378-1-kniv@yandex-team.ru +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +@@ -1244,7 +1244,8 @@ static u64 hash_filter_ntuple(struct ch_ + * in the Compressed Filter Tuple. + */ + if (tp->vlan_shift >= 0 && fs->mask.ivlan) +- ntuple |= (FT_VLAN_VLD_F | fs->val.ivlan) << tp->vlan_shift; ++ ntuple |= (u64)(FT_VLAN_VLD_F | ++ fs->val.ivlan) << tp->vlan_shift; + + if (tp->port_shift >= 0 && fs->mask.iport) + ntuple |= (u64)fs->val.iport << tp->port_shift; diff --git a/queue-6.1/input-i8042-add-forcenorestore-quirk-to-leave-controller-untouched-even-on-s3.patch b/queue-6.1/input-i8042-add-forcenorestore-quirk-to-leave-controller-untouched-even-on-s3.patch new file mode 100644 index 00000000000..34b3f765bbf --- /dev/null +++ b/queue-6.1/input-i8042-add-forcenorestore-quirk-to-leave-controller-untouched-even-on-s3.patch @@ -0,0 +1,117 @@ +From 3d765ae2daccc570b3f4fbcb57eb321b12cdded2 Mon Sep 17 00:00:00 2001 +From: Werner Sembach +Date: Thu, 4 Jan 2024 19:31:17 +0100 +Subject: Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3 + +From: Werner Sembach + +commit 3d765ae2daccc570b3f4fbcb57eb321b12cdded2 upstream. + +On s3 resume the i8042 driver tries to restore the controller to a known +state by reinitializing things, however this can confuse the controller +with different effects. Mostly occasionally unresponsive keyboards after +resume. + +These issues do not rise on s0ix resume as here the controller is assumed +to preserved its state from before suspend. + +This patch adds a quirk for devices where the reinitialization on s3 resume +is not needed and might be harmful as described above. It does this by +using the s0ix resume code path at selected locations. + +This new quirk goes beyond what the preexisting reset=never quirk does, +which only skips some reinitialization steps. + +Signed-off-by: Werner Sembach +Cc: stable@vger.kernel.org +Reviewed-by: Hans de Goede +Link: https://lore.kernel.org/r/20240104183118.779778-2-wse@tuxedocomputers.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/serio/i8042-acpipnpio.h | 10 +++++++--- + drivers/input/serio/i8042.c | 10 +++++++--- + 2 files changed, 14 insertions(+), 6 deletions(-) + +--- a/drivers/input/serio/i8042-acpipnpio.h ++++ b/drivers/input/serio/i8042-acpipnpio.h +@@ -83,6 +83,7 @@ static inline void i8042_write_command(i + #define SERIO_QUIRK_KBDRESET BIT(12) + #define SERIO_QUIRK_DRITEK BIT(13) + #define SERIO_QUIRK_NOPNP BIT(14) ++#define SERIO_QUIRK_FORCENORESTORE BIT(15) + + /* Quirk table for different mainboards. Options similar or identical to i8042 + * module parameters. +@@ -1685,6 +1686,8 @@ static void __init i8042_check_quirks(vo + if (quirks & SERIO_QUIRK_NOPNP) + i8042_nopnp = true; + #endif ++ if (quirks & SERIO_QUIRK_FORCENORESTORE) ++ i8042_forcenorestore = true; + } + #else + static inline void i8042_check_quirks(void) {} +@@ -1718,7 +1721,7 @@ static int __init i8042_platform_init(vo + + i8042_check_quirks(); + +- pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s\n", ++ pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + i8042_nokbd ? " nokbd" : "", + i8042_noaux ? " noaux" : "", + i8042_nomux ? " nomux" : "", +@@ -1738,10 +1741,11 @@ static int __init i8042_platform_init(vo + "", + #endif + #ifdef CONFIG_PNP +- i8042_nopnp ? " nopnp" : ""); ++ i8042_nopnp ? " nopnp" : "", + #else +- ""); ++ "", + #endif ++ i8042_forcenorestore ? " forcenorestore" : ""); + + retval = i8042_pnp_init(); + if (retval) +--- a/drivers/input/serio/i8042.c ++++ b/drivers/input/serio/i8042.c +@@ -115,6 +115,10 @@ module_param_named(nopnp, i8042_nopnp, b + MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings"); + #endif + ++static bool i8042_forcenorestore; ++module_param_named(forcenorestore, i8042_forcenorestore, bool, 0); ++MODULE_PARM_DESC(forcenorestore, "Force no restore on s3 resume, copying s2idle behaviour"); ++ + #define DEBUG + #ifdef DEBUG + static bool i8042_debug; +@@ -1232,7 +1236,7 @@ static int i8042_pm_suspend(struct devic + { + int i; + +- if (pm_suspend_via_firmware()) ++ if (!i8042_forcenorestore && pm_suspend_via_firmware()) + i8042_controller_reset(true); + + /* Set up serio interrupts for system wakeup. */ +@@ -1248,7 +1252,7 @@ static int i8042_pm_suspend(struct devic + + static int i8042_pm_resume_noirq(struct device *dev) + { +- if (!pm_resume_via_firmware()) ++ if (i8042_forcenorestore || !pm_resume_via_firmware()) + i8042_interrupt(0, NULL); + + return 0; +@@ -1271,7 +1275,7 @@ static int i8042_pm_resume(struct device + * not restore the controller state to whatever it had been at boot + * time, so we do not need to do anything. + */ +- if (!pm_suspend_via_firmware()) ++ if (i8042_forcenorestore || !pm_suspend_via_firmware()) + return 0; + + /* diff --git a/queue-6.1/input-i8042-use-new-forcenorestore-quirk-to-replace-old-buggy-quirk-combination.patch b/queue-6.1/input-i8042-use-new-forcenorestore-quirk-to-replace-old-buggy-quirk-combination.patch new file mode 100644 index 00000000000..5deb2ceb8d3 --- /dev/null +++ b/queue-6.1/input-i8042-use-new-forcenorestore-quirk-to-replace-old-buggy-quirk-combination.patch @@ -0,0 +1,46 @@ +From aaa4ca873d3da768896ffc909795359a01e853ef Mon Sep 17 00:00:00 2001 +From: Werner Sembach +Date: Thu, 4 Jan 2024 19:31:18 +0100 +Subject: Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination + +From: Werner Sembach + +commit aaa4ca873d3da768896ffc909795359a01e853ef upstream. + +The old quirk combination sometimes cause a laggy keyboard after boot. With +the new quirk the initial issue of an unresponsive keyboard after s3 resume +is also fixed, but it doesn't have the negative side effect of the +sometimes laggy keyboard. + +Signed-off-by: Werner Sembach +Cc: stable@vger.kernel.org +Reviewed-by: Hans de Goede +Link: https://lore.kernel.org/r/20240104183118.779778-3-wse@tuxedocomputers.com +Signed-off-by: Dmitry Torokhov +Signed-off-by: Greg Kroah-Hartman +--- + drivers/input/serio/i8042-acpipnpio.h | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +--- a/drivers/input/serio/i8042-acpipnpio.h ++++ b/drivers/input/serio/i8042-acpipnpio.h +@@ -1150,18 +1150,10 @@ static const struct dmi_system_id i8042_ + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) + }, + { +- /* +- * Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes +- * the keyboard very laggy for ~5 seconds after boot and +- * sometimes also after resume. +- * However both are required for the keyboard to not fail +- * completely sometimes after boot or resume. +- */ + .matches = { + DMI_MATCH(DMI_BOARD_NAME, "N150CU"), + }, +- .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | +- SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) ++ .driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE) + }, + { + .matches = { diff --git a/queue-6.1/kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch b/queue-6.1/kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch new file mode 100644 index 00000000000..9b7adcb369b --- /dev/null +++ b/queue-6.1/kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch @@ -0,0 +1,66 @@ +From 3e6245ebe7ef341639e9a7e402b3ade8ad45a19f Mon Sep 17 00:00:00 2001 +From: Marc Zyngier +Date: Tue, 20 Aug 2024 11:03:38 +0100 +Subject: KVM: arm64: Make ICC_*SGI*_EL1 undef in the absence of a vGICv3 + +From: Marc Zyngier + +commit 3e6245ebe7ef341639e9a7e402b3ade8ad45a19f upstream. + +On a system with a GICv3, if a guest hasn't been configured with +GICv3 and that the host is not capable of GICv2 emulation, +a write to any of the ICC_*SGI*_EL1 registers is trapped to EL2. + +We therefore try to emulate the SGI access, only to hit a NULL +pointer as no private interrupt is allocated (no GIC, remember?). + +The obvious fix is to give the guest what it deserves, in the +shape of a UNDEF exception. + +Reported-by: Alexander Potapenko +Signed-off-by: Marc Zyngier +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240820100349.3544850-2-maz@kernel.org +Signed-off-by: Oliver Upton +Signed-off-by: Greg Kroah-Hartman +--- + arch/arm64/kvm/sys_regs.c | 6 ++++++ + arch/arm64/kvm/vgic/vgic.h | 7 +++++++ + 2 files changed, 13 insertions(+) + +--- a/arch/arm64/kvm/sys_regs.c ++++ b/arch/arm64/kvm/sys_regs.c +@@ -30,6 +30,7 @@ + #include + + #include "sys_regs.h" ++#include "vgic/vgic.h" + + #include "trace.h" + +@@ -200,6 +201,11 @@ static bool access_gic_sgi(struct kvm_vc + { + bool g1; + ++ if (!kvm_has_gicv3(vcpu->kvm)) { ++ kvm_inject_undefined(vcpu); ++ return false; ++ } ++ + if (!p->is_write) + return read_from_write_only(vcpu, p, r); + +--- a/arch/arm64/kvm/vgic/vgic.h ++++ b/arch/arm64/kvm/vgic/vgic.h +@@ -334,4 +334,11 @@ void vgic_v4_configure_vsgis(struct kvm + void vgic_v4_get_vlpi_state(struct vgic_irq *irq, bool *val); + int vgic_v4_request_vpe_irq(struct kvm_vcpu *vcpu, int irq); + ++static inline bool kvm_has_gicv3(struct kvm *kvm) ++{ ++ return (static_branch_unlikely(&kvm_vgic_global_state.gicv3_cpuif) && ++ irqchip_in_kernel(kvm) && ++ kvm->arch.vgic.vgic_model == KVM_DEV_TYPE_ARM_VGIC_V3); ++} ++ + #endif diff --git a/queue-6.1/mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch b/queue-6.1/mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch new file mode 100644 index 00000000000..e019cc2aae2 --- /dev/null +++ b/queue-6.1/mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch @@ -0,0 +1,47 @@ +From 6275c7bc8dd07644ea8142a1773d826800f0f3f7 Mon Sep 17 00:00:00 2001 +From: Ben Whitten +Date: Sun, 11 Aug 2024 22:22:11 +0100 +Subject: mmc: dw_mmc: allow biu and ciu clocks to defer + +From: Ben Whitten + +commit 6275c7bc8dd07644ea8142a1773d826800f0f3f7 upstream. + +Fix a race condition if the clock provider comes up after mmc is probed, +this causes mmc to fail without retrying. +When given the DEFER error from the clk source, pass it on up the chain. + +Fixes: f90a0612f0e1 ("mmc: dw_mmc: lookup for optional biu and ciu clocks") +Signed-off-by: Ben Whitten +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240811212212.123255-1-ben.whitten@gmail.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/mmc/host/dw_mmc.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/mmc/host/dw_mmc.c ++++ b/drivers/mmc/host/dw_mmc.c +@@ -3295,6 +3295,10 @@ int dw_mci_probe(struct dw_mci *host) + host->biu_clk = devm_clk_get(host->dev, "biu"); + if (IS_ERR(host->biu_clk)) { + dev_dbg(host->dev, "biu clock not available\n"); ++ ret = PTR_ERR(host->biu_clk); ++ if (ret == -EPROBE_DEFER) ++ return ret; ++ + } else { + ret = clk_prepare_enable(host->biu_clk); + if (ret) { +@@ -3306,6 +3310,10 @@ int dw_mci_probe(struct dw_mci *host) + host->ciu_clk = devm_clk_get(host->dev, "ciu"); + if (IS_ERR(host->ciu_clk)) { + dev_dbg(host->dev, "ciu clock not available\n"); ++ ret = PTR_ERR(host->ciu_clk); ++ if (ret == -EPROBE_DEFER) ++ goto err_clk_biu; ++ + host->bus_hz = host->pdata->bus_hz; + } else { + ret = clk_prepare_enable(host->ciu_clk); diff --git a/queue-6.1/mptcp-pm-only-decrement-add_addr_accepted-for-mpj-req.patch b/queue-6.1/mptcp-pm-only-decrement-add_addr_accepted-for-mpj-req.patch new file mode 100644 index 00000000000..c45e60982fc --- /dev/null +++ b/queue-6.1/mptcp-pm-only-decrement-add_addr_accepted-for-mpj-req.patch @@ -0,0 +1,62 @@ +From 1c1f721375989579e46741f59523e39ec9b2a9bd Mon Sep 17 00:00:00 2001 +From: "Matthieu Baerts (NGI0)" +Date: Mon, 19 Aug 2024 21:45:27 +0200 +Subject: mptcp: pm: only decrement add_addr_accepted for MPJ req + +From: Matthieu Baerts (NGI0) + +commit 1c1f721375989579e46741f59523e39ec9b2a9bd upstream. + +Adding the following warning ... + + WARN_ON_ONCE(msk->pm.add_addr_accepted == 0) + +... before decrementing the add_addr_accepted counter helped to find a +bug when running the "remove single subflow" subtest from the +mptcp_join.sh selftest. + +Removing a 'subflow' endpoint will first trigger a RM_ADDR, then the +subflow closure. Before this patch, and upon the reception of the +RM_ADDR, the other peer will then try to decrement this +add_addr_accepted. That's not correct because the attached subflows have +not been created upon the reception of an ADD_ADDR. + +A way to solve that is to decrement the counter only if the attached +subflow was an MP_JOIN to a remote id that was not 0, and initiated by +the host receiving the RM_ADDR. + +Fixes: d0876b2284cf ("mptcp: add the incoming RM_ADDR support") +Cc: stable@vger.kernel.org +Reviewed-by: Mat Martineau +Signed-off-by: Matthieu Baerts (NGI0) +Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-9-38035d40de5b@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/mptcp/pm_netlink.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/net/mptcp/pm_netlink.c ++++ b/net/mptcp/pm_netlink.c +@@ -834,7 +834,7 @@ static void mptcp_pm_nl_rm_addr_or_subfl + mptcp_close_ssk(sk, ssk, subflow); + spin_lock_bh(&msk->pm.lock); + +- removed = true; ++ removed |= subflow->request_join; + if (rm_type == MPTCP_MIB_RMSUBFLOW) + __MPTCP_INC_STATS(sock_net(sk), rm_type); + } +@@ -848,7 +848,11 @@ static void mptcp_pm_nl_rm_addr_or_subfl + if (!mptcp_pm_is_kernel(msk)) + continue; + +- if (rm_type == MPTCP_MIB_RMADDR) { ++ if (rm_type == MPTCP_MIB_RMADDR && rm_id && ++ !WARN_ON_ONCE(msk->pm.add_addr_accepted == 0)) { ++ /* Note: if the subflow has been closed before, this ++ * add_addr_accepted counter will not be decremented. ++ */ + msk->pm.add_addr_accepted--; + WRITE_ONCE(msk->pm.accept_addr, true); + } else if (rm_type == MPTCP_MIB_RMSUBFLOW) { diff --git a/queue-6.1/mptcp-pm-re-using-id-of-unused-flushed-subflows.patch b/queue-6.1/mptcp-pm-re-using-id-of-unused-flushed-subflows.patch new file mode 100644 index 00000000000..c3e8bd70f5d --- /dev/null +++ b/queue-6.1/mptcp-pm-re-using-id-of-unused-flushed-subflows.patch @@ -0,0 +1,49 @@ +From ef34a6ea0cab1800f4b3c9c3c2cefd5091e03379 Mon Sep 17 00:00:00 2001 +From: "Matthieu Baerts (NGI0)" +Date: Mon, 19 Aug 2024 21:45:23 +0200 +Subject: mptcp: pm: re-using ID of unused flushed subflows + +From: Matthieu Baerts (NGI0) + +commit ef34a6ea0cab1800f4b3c9c3c2cefd5091e03379 upstream. + +If no subflows are attached to the 'subflow' endpoints that are being +flushed, the corresponding addr IDs will not be marked as available +again. + +Mark all ID as being available when flushing all the 'subflow' +endpoints, and reset local_addr_used counter to cover these cases. + +Note that mptcp_pm_remove_addrs_and_subflows() helper is only called for +flushing operations, not to remove a specific set of addresses and +subflows. + +Fixes: 06faa2271034 ("mptcp: remove multi addresses and subflows in PM") +Cc: stable@vger.kernel.org +Reviewed-by: Mat Martineau +Signed-off-by: Matthieu Baerts (NGI0) +Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-5-38035d40de5b@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/mptcp/pm_netlink.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/net/mptcp/pm_netlink.c ++++ b/net/mptcp/pm_netlink.c +@@ -1666,8 +1666,15 @@ void mptcp_pm_remove_addrs_and_subflows( + mptcp_pm_remove_addr(msk, &alist); + spin_unlock_bh(&msk->pm.lock); + } ++ + if (slist.nr) + mptcp_pm_remove_subflow(msk, &slist); ++ ++ /* Reset counters: maybe some subflows have been removed before */ ++ spin_lock_bh(&msk->pm.lock); ++ bitmap_fill(msk->pm.id_avail_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); ++ msk->pm.local_addr_used = 0; ++ spin_unlock_bh(&msk->pm.lock); + } + + static void mptcp_nl_remove_addrs_list(struct net *net, diff --git a/queue-6.1/mptcp-pm-re-using-id-of-unused-removed-add_addr.patch b/queue-6.1/mptcp-pm-re-using-id-of-unused-removed-add_addr.patch new file mode 100644 index 00000000000..173fdedde94 --- /dev/null +++ b/queue-6.1/mptcp-pm-re-using-id-of-unused-removed-add_addr.patch @@ -0,0 +1,40 @@ +From e255683c06df572ead96db5efb5d21be30c0efaa Mon Sep 17 00:00:00 2001 +From: "Matthieu Baerts (NGI0)" +Date: Mon, 19 Aug 2024 21:45:19 +0200 +Subject: mptcp: pm: re-using ID of unused removed ADD_ADDR + +From: Matthieu Baerts (NGI0) + +commit e255683c06df572ead96db5efb5d21be30c0efaa upstream. + +If no subflow is attached to the 'signal' endpoint that is being +removed, the addr ID will not be marked as available again. + +Mark the linked ID as available when removing the address entry from the +list to cover this case. + +Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink") +Cc: stable@vger.kernel.org +Reviewed-by: Mat Martineau +Signed-off-by: Matthieu Baerts (NGI0) +Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-1-38035d40de5b@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/mptcp/pm_netlink.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/net/mptcp/pm_netlink.c ++++ b/net/mptcp/pm_netlink.c +@@ -1474,7 +1474,10 @@ static bool mptcp_pm_remove_anno_addr(st + ret = remove_anno_list_by_saddr(msk, addr); + if (ret || force) { + spin_lock_bh(&msk->pm.lock); +- msk->pm.add_addr_signaled -= ret; ++ if (ret) { ++ __set_bit(addr->id, msk->pm.id_avail_bitmap); ++ msk->pm.add_addr_signaled--; ++ } + mptcp_pm_remove_addr(msk, &list); + spin_unlock_bh(&msk->pm.lock); + } diff --git a/queue-6.1/mptcp-pm-re-using-id-of-unused-removed-subflows.patch b/queue-6.1/mptcp-pm-re-using-id-of-unused-removed-subflows.patch new file mode 100644 index 00000000000..00c57747f01 --- /dev/null +++ b/queue-6.1/mptcp-pm-re-using-id-of-unused-removed-subflows.patch @@ -0,0 +1,51 @@ +From edd8b5d868a4d459f3065493001e293901af758d Mon Sep 17 00:00:00 2001 +From: "Matthieu Baerts (NGI0)" +Date: Mon, 19 Aug 2024 21:45:21 +0200 +Subject: mptcp: pm: re-using ID of unused removed subflows + +From: Matthieu Baerts (NGI0) + +commit edd8b5d868a4d459f3065493001e293901af758d upstream. + +If no subflow is attached to the 'subflow' endpoint that is being +removed, the addr ID will not be marked as available again. + +Mark the linked ID as available when removing the 'subflow' endpoint if +no subflow is attached to it. + +While at it, the local_addr_used counter is decremented if the ID was +marked as being used to reflect the reality, but also to allow adding +new endpoints after that. + +Fixes: b6c08380860b ("mptcp: remove addr and subflow in PM netlink") +Cc: stable@vger.kernel.org +Reviewed-by: Mat Martineau +Signed-off-by: Matthieu Baerts (NGI0) +Link: https://patch.msgid.link/20240819-net-mptcp-pm-reusing-id-v1-3-38035d40de5b@kernel.org +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman +--- + net/mptcp/pm_netlink.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/net/mptcp/pm_netlink.c ++++ b/net/mptcp/pm_netlink.c +@@ -1512,8 +1512,17 @@ static int mptcp_nl_remove_subflow_and_s + remove_subflow = lookup_subflow_by_saddr(&msk->conn_list, addr); + mptcp_pm_remove_anno_addr(msk, addr, remove_subflow && + !(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT)); +- if (remove_subflow) ++ ++ if (remove_subflow) { + mptcp_pm_remove_subflow(msk, &list); ++ } else if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) { ++ /* If the subflow has been used, but now closed */ ++ spin_lock_bh(&msk->pm.lock); ++ if (!__test_and_set_bit(entry->addr.id, msk->pm.id_avail_bitmap)) ++ msk->pm.local_addr_used--; ++ spin_unlock_bh(&msk->pm.lock); ++ } ++ + release_sock(sk); + + next: diff --git a/queue-6.1/pmdomain-imx-wait-ssar-when-i.mx93-power-domain-on.patch b/queue-6.1/pmdomain-imx-wait-ssar-when-i.mx93-power-domain-on.patch new file mode 100644 index 00000000000..9d2e1811f2b --- /dev/null +++ b/queue-6.1/pmdomain-imx-wait-ssar-when-i.mx93-power-domain-on.patch @@ -0,0 +1,62 @@ +From 52dd070c62e4ae2b5e7411b920e3f7a64235ecfb Mon Sep 17 00:00:00 2001 +From: Peng Fan +Date: Wed, 14 Aug 2024 20:47:40 +0800 +Subject: pmdomain: imx: wait SSAR when i.MX93 power domain on + +From: Peng Fan + +commit 52dd070c62e4ae2b5e7411b920e3f7a64235ecfb upstream. + +With "quiet" set in bootargs, there is power domain failure: +"imx93_power_domain 44462400.power-domain: pd_off timeout: name: + 44462400.power-domain, stat: 4" + +The current power on opertation takes ISO state as power on finished +flag, but it is wrong. Before powering on operation really finishes, +powering off comes and powering off will never finish because the last +powering on still not finishes, so the following powering off actually +not trigger hardware state machine to run. SSAR is the last step when +powering on a domain, so need to wait SSAR done when powering on. + +Since EdgeLock Enclave(ELE) handshake is involved in the flow, enlarge +the waiting time to 10ms for both on and off to avoid timeout. + +Cc: stable@vger.kernel.org +Fixes: 0a0f7cc25d4a ("soc: imx: add i.MX93 SRC power domain driver") +Reviewed-by: Jacky Bai +Signed-off-by: Peng Fan +Link: https://lore.kernel.org/r/20240814124740.2778952-1-peng.fan@oss.nxp.com +Signed-off-by: Ulf Hansson +Signed-off-by: Greg Kroah-Hartman +--- + drivers/soc/imx/imx93-pd.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/drivers/soc/imx/imx93-pd.c ++++ b/drivers/soc/imx/imx93-pd.c +@@ -20,6 +20,7 @@ + #define FUNC_STAT_PSW_STAT_MASK BIT(0) + #define FUNC_STAT_RST_STAT_MASK BIT(2) + #define FUNC_STAT_ISO_STAT_MASK BIT(4) ++#define FUNC_STAT_SSAR_STAT_MASK BIT(8) + + struct imx93_power_domain { + struct generic_pm_domain genpd; +@@ -50,7 +51,7 @@ static int imx93_pd_on(struct generic_pm + writel(val, addr + MIX_SLICE_SW_CTRL_OFF); + + ret = readl_poll_timeout(addr + MIX_FUNC_STAT_OFF, val, +- !(val & FUNC_STAT_ISO_STAT_MASK), 1, 10000); ++ !(val & FUNC_STAT_SSAR_STAT_MASK), 1, 10000); + if (ret) { + dev_err(domain->dev, "pd_on timeout: name: %s, stat: %x\n", genpd->name, val); + return ret; +@@ -72,7 +73,7 @@ static int imx93_pd_off(struct generic_p + writel(val, addr + MIX_SLICE_SW_CTRL_OFF); + + ret = readl_poll_timeout(addr + MIX_FUNC_STAT_OFF, val, +- val & FUNC_STAT_PSW_STAT_MASK, 1, 1000); ++ val & FUNC_STAT_PSW_STAT_MASK, 1, 10000); + if (ret) { + dev_err(domain->dev, "pd_off timeout: name: %s, stat: %x\n", genpd->name, val); + return ret; diff --git a/queue-6.1/series b/queue-6.1/series index c2a9c9aa17b..8cf4b2139cf 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -269,3 +269,15 @@ drm-amdgpu-sdma5.2-limit-wptr-workaround-to-sdma-5.2.1.patch mips-loongson64-set-timer-mode-in-cpu-probe.patch hid-wacom-defer-calculation-of-resolution-until-resolution_code-is-known.patch hid-microsoft-add-rumble-support-to-latest-xbox-controllers.patch +input-i8042-add-forcenorestore-quirk-to-leave-controller-untouched-even-on-s3.patch +input-i8042-use-new-forcenorestore-quirk-to-replace-old-buggy-quirk-combination.patch +cxgb4-add-forgotten-u64-ivlan-cast-before-shift.patch +kvm-arm64-make-icc_-sgi-_el1-undef-in-the-absence-of-a-vgicv3.patch +mmc-dw_mmc-allow-biu-and-ciu-clocks-to-defer.patch +pmdomain-imx-wait-ssar-when-i.mx93-power-domain-on.patch +thermal-of-fix-of-node-leak-in-thermal_of_trips_init-error-path.patch +thermal-of-fix-of-node-leak-in-of_thermal_zone_find-error-paths.patch +mptcp-pm-re-using-id-of-unused-removed-add_addr.patch +mptcp-pm-re-using-id-of-unused-removed-subflows.patch +mptcp-pm-re-using-id-of-unused-flushed-subflows.patch +mptcp-pm-only-decrement-add_addr_accepted-for-mpj-req.patch diff --git a/queue-6.1/thermal-of-fix-of-node-leak-in-of_thermal_zone_find-error-paths.patch b/queue-6.1/thermal-of-fix-of-node-leak-in-of_thermal_zone_find-error-paths.patch new file mode 100644 index 00000000000..6cccda5ec38 --- /dev/null +++ b/queue-6.1/thermal-of-fix-of-node-leak-in-of_thermal_zone_find-error-paths.patch @@ -0,0 +1,68 @@ +From c0a1ef9c5be72ff28a5413deb1b3e1a066593c13 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Wed, 14 Aug 2024 21:58:23 +0200 +Subject: thermal: of: Fix OF node leak in of_thermal_zone_find() error paths + +From: Krzysztof Kozlowski + +commit c0a1ef9c5be72ff28a5413deb1b3e1a066593c13 upstream. + +Terminating for_each_available_child_of_node() loop requires dropping OF +node reference, so bailing out on errors misses this. Solve the OF node +reference leak with scoped for_each_available_child_of_node_scoped(). + +Fixes: 3fd6d6e2b4e8 ("thermal/of: Rework the thermal device tree initialization") +Cc: +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Chen-Yu Tsai +Reviewed-by: Daniel Lezcano +Link: https://patch.msgid.link/20240814195823.437597-3-krzysztof.kozlowski@linaro.org +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/thermal/thermal_of.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +--- a/drivers/thermal/thermal_of.c ++++ b/drivers/thermal/thermal_of.c +@@ -294,14 +294,14 @@ static struct device_node *of_thermal_zo + * Search for each thermal zone, a defined sensor + * corresponding to the one passed as parameter + */ +- for_each_available_child_of_node(np, tz) { ++ for_each_available_child_of_node_scoped(np, child) { + + int count, i; + +- count = of_count_phandle_with_args(tz, "thermal-sensors", ++ count = of_count_phandle_with_args(child, "thermal-sensors", + "#thermal-sensor-cells"); + if (count <= 0) { +- pr_err("%pOFn: missing thermal sensor\n", tz); ++ pr_err("%pOFn: missing thermal sensor\n", child); + tz = ERR_PTR(-EINVAL); + goto out; + } +@@ -310,18 +310,19 @@ static struct device_node *of_thermal_zo + + int ret; + +- ret = of_parse_phandle_with_args(tz, "thermal-sensors", ++ ret = of_parse_phandle_with_args(child, "thermal-sensors", + "#thermal-sensor-cells", + i, &sensor_specs); + if (ret < 0) { +- pr_err("%pOFn: Failed to read thermal-sensors cells: %d\n", tz, ret); ++ pr_err("%pOFn: Failed to read thermal-sensors cells: %d\n", child, ret); + tz = ERR_PTR(ret); + goto out; + } + + if ((sensor == sensor_specs.np) && id == (sensor_specs.args_count ? + sensor_specs.args[0] : 0)) { +- pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, tz); ++ pr_debug("sensor %pOFn id=%d belongs to %pOFn\n", sensor, id, child); ++ tz = no_free_ptr(child); + goto out; + } + } diff --git a/queue-6.1/thermal-of-fix-of-node-leak-in-thermal_of_trips_init-error-path.patch b/queue-6.1/thermal-of-fix-of-node-leak-in-thermal_of_trips_init-error-path.patch new file mode 100644 index 00000000000..91e149a2d86 --- /dev/null +++ b/queue-6.1/thermal-of-fix-of-node-leak-in-thermal_of_trips_init-error-path.patch @@ -0,0 +1,46 @@ +From afc954fd223ded70b1fa000767e2531db55cce58 Mon Sep 17 00:00:00 2001 +From: Krzysztof Kozlowski +Date: Wed, 14 Aug 2024 21:58:21 +0200 +Subject: thermal: of: Fix OF node leak in thermal_of_trips_init() error path + +From: Krzysztof Kozlowski + +commit afc954fd223ded70b1fa000767e2531db55cce58 upstream. + +Terminating for_each_child_of_node() loop requires dropping OF node +reference, so bailing out after thermal_of_populate_trip() error misses +this. Solve the OF node reference leak with scoped +for_each_child_of_node_scoped(). + +Fixes: d0c75fa2c17f ("thermal/of: Initialize trip points separately") +Cc: All applicable +Signed-off-by: Krzysztof Kozlowski +Reviewed-by: Chen-Yu Tsai +Reviewed-by: Daniel Lezcano +Link: https://patch.msgid.link/20240814195823.437597-1-krzysztof.kozlowski@linaro.org +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/thermal/thermal_of.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/thermal/thermal_of.c ++++ b/drivers/thermal/thermal_of.c +@@ -235,7 +235,7 @@ static int thermal_of_populate_trip(stru + static struct thermal_trip *thermal_of_trips_init(struct device_node *np, int *ntrips) + { + struct thermal_trip *tt; +- struct device_node *trips, *trip; ++ struct device_node *trips; + int ret, count; + + trips = of_get_child_by_name(np, "trips"); +@@ -260,7 +260,7 @@ static struct thermal_trip *thermal_of_t + *ntrips = count; + + count = 0; +- for_each_child_of_node(trips, trip) { ++ for_each_child_of_node_scoped(trips, trip) { + ret = thermal_of_populate_trip(trip, &tt[count++]); + if (ret) + goto out_kfree;