From e04ac787376b6ac5c449c3f8bd8b92d1b558d47c Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Thu, 24 Jul 2025 10:15:06 -0400 Subject: [PATCH] Fixes for 5.15 Signed-off-by: Sasha Levin --- ...m-sc7280-add-missing-num_links-to-xm.patch | 36 +++++++++++++++ ...ate-limit-gid-cache-warning-messages.patch | 44 +++++++++++++++++++ ...-potential-memory-leak-of-regmap_bus.patch | 44 +++++++++++++++++++ ...ix-null-dereference-on-unbind-due-to.patch | 44 +++++++++++++++++++ queue-5.15/series | 4 ++ 5 files changed, 172 insertions(+) create mode 100644 queue-5.15/interconnect-qcom-sc7280-add-missing-num_links-to-xm.patch create mode 100644 queue-5.15/rdma-core-rate-limit-gid-cache-warning-messages.patch create mode 100644 queue-5.15/regmap-fix-potential-memory-leak-of-regmap_bus.patch create mode 100644 queue-5.15/regulator-core-fix-null-dereference-on-unbind-due-to.patch diff --git a/queue-5.15/interconnect-qcom-sc7280-add-missing-num_links-to-xm.patch b/queue-5.15/interconnect-qcom-sc7280-add-missing-num_links-to-xm.patch new file mode 100644 index 0000000000..1f751b28e3 --- /dev/null +++ b/queue-5.15/interconnect-qcom-sc7280-add-missing-num_links-to-xm.patch @@ -0,0 +1,36 @@ +From 0ce8337c7d25e62346b064a1c3e75ed3ee66a5fb Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Fri, 13 Jun 2025 22:53:38 +0800 +Subject: interconnect: qcom: sc7280: Add missing num_links to xm_pcie3_1 node + +From: Xilin Wu + +[ Upstream commit 886a94f008dd1a1702ee66dd035c266f70fd9e90 ] + +This allows adding interconnect paths for PCIe 1 in device tree later. + +Fixes: 46bdcac533cc ("interconnect: qcom: Add SC7280 interconnect provider driver") +Signed-off-by: Xilin Wu +Reviewed-by: Dmitry Baryshkov +Link: https://lore.kernel.org/r/20250613-sc7280-icc-pcie1-fix-v1-1-0b09813e3b09@radxa.com +Signed-off-by: Georgi Djakov +Signed-off-by: Sasha Levin +--- + drivers/interconnect/qcom/sc7280.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/interconnect/qcom/sc7280.c b/drivers/interconnect/qcom/sc7280.c +index f8b34f6cbb0d1..cd5efeb764044 100644 +--- a/drivers/interconnect/qcom/sc7280.c ++++ b/drivers/interconnect/qcom/sc7280.c +@@ -164,6 +164,7 @@ static struct qcom_icc_node xm_pcie3_1 = { + .id = SC7280_MASTER_PCIE_1, + .channels = 1, + .buswidth = 8, ++ .num_links = 1, + .links = { SC7280_SLAVE_ANOC_PCIE_GEM_NOC }, + }; + +-- +2.39.5 + diff --git a/queue-5.15/rdma-core-rate-limit-gid-cache-warning-messages.patch b/queue-5.15/rdma-core-rate-limit-gid-cache-warning-messages.patch new file mode 100644 index 0000000000..b3d5ba5b60 --- /dev/null +++ b/queue-5.15/rdma-core-rate-limit-gid-cache-warning-messages.patch @@ -0,0 +1,44 @@ +From b6b1fbf10f82ff6115c7a1b0a427d8fa30e91464 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Mon, 16 Jun 2025 11:26:21 +0300 +Subject: RDMA/core: Rate limit GID cache warning messages + +From: Maor Gottlieb + +[ Upstream commit 333e4d79316c9ed5877d7aac8b8ed22efc74e96d ] + +The GID cache warning messages can flood the kernel log when there are +multiple failed attempts to add GIDs. This can happen when creating many +virtual interfaces without having enough space for their GIDs in the GID +table. + +Change pr_warn to pr_warn_ratelimited to prevent log flooding while still +maintaining visibility of the issue. + +Link: https://patch.msgid.link/r/fd45ed4a1078e743f498b234c3ae816610ba1b18.1750062357.git.leon@kernel.org +Signed-off-by: Maor Gottlieb +Signed-off-by: Leon Romanovsky +Signed-off-by: Jason Gunthorpe +Signed-off-by: Sasha Levin +--- + drivers/infiniband/core/cache.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c +index b534ef03168c6..91ee3e823a9fe 100644 +--- a/drivers/infiniband/core/cache.c ++++ b/drivers/infiniband/core/cache.c +@@ -582,8 +582,8 @@ static int __ib_cache_gid_add(struct ib_device *ib_dev, u32 port, + out_unlock: + mutex_unlock(&table->lock); + if (ret) +- pr_warn("%s: unable to add gid %pI6 error=%d\n", +- __func__, gid->raw, ret); ++ pr_warn_ratelimited("%s: unable to add gid %pI6 error=%d\n", ++ __func__, gid->raw, ret); + return ret; + } + +-- +2.39.5 + diff --git a/queue-5.15/regmap-fix-potential-memory-leak-of-regmap_bus.patch b/queue-5.15/regmap-fix-potential-memory-leak-of-regmap_bus.patch new file mode 100644 index 0000000000..8d733edebb --- /dev/null +++ b/queue-5.15/regmap-fix-potential-memory-leak-of-regmap_bus.patch @@ -0,0 +1,44 @@ +From 7faa144329d7a5883cb92b380d4cd276c4612823 Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Jun 2025 22:58:21 +0530 +Subject: regmap: fix potential memory leak of regmap_bus + +From: Abdun Nihaal + +[ Upstream commit c871c199accb39d0f4cb941ad0dccabfc21e9214 ] + +When __regmap_init() is called from __regmap_init_i2c() and +__regmap_init_spi() (and their devm versions), the bus argument +obtained from regmap_get_i2c_bus() and regmap_get_spi_bus(), may be +allocated using kmemdup() to support quirks. In those cases, the +bus->free_on_exit field is set to true. + +However, inside __regmap_init(), buf is not freed on any error path. +This could lead to a memory leak of regmap_bus when __regmap_init() +fails. Fix that by freeing bus on error path when free_on_exit is set. + +Fixes: ea030ca68819 ("regmap-i2c: Set regmap max raw r/w from quirks") +Signed-off-by: Abdun Nihaal +Link: https://patch.msgid.link/20250626172823.18725-1-abdun.nihaal@gmail.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/base/regmap/regmap.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c +index 6d94ad8bf1eb7..ebddc69bc969c 100644 +--- a/drivers/base/regmap/regmap.c ++++ b/drivers/base/regmap/regmap.c +@@ -1264,6 +1264,8 @@ struct regmap *__regmap_init(struct device *dev, + err_map: + kfree(map); + err: ++ if (bus && bus->free_on_exit) ++ kfree(bus); + return ERR_PTR(ret); + } + EXPORT_SYMBOL_GPL(__regmap_init); +-- +2.39.5 + diff --git a/queue-5.15/regulator-core-fix-null-dereference-on-unbind-due-to.patch b/queue-5.15/regulator-core-fix-null-dereference-on-unbind-due-to.patch new file mode 100644 index 0000000000..821529aa4d --- /dev/null +++ b/queue-5.15/regulator-core-fix-null-dereference-on-unbind-due-to.patch @@ -0,0 +1,44 @@ +From 376d3b344b8b5f31ea01c8f41fa6bf4d6c82719c Mon Sep 17 00:00:00 2001 +From: Sasha Levin +Date: Thu, 26 Jun 2025 08:38:09 +0000 +Subject: regulator: core: fix NULL dereference on unbind due to stale coupling + data + +From: Alessandro Carminati + +[ Upstream commit ca46946a482238b0cdea459fb82fc837fb36260e ] + +Failing to reset coupling_desc.n_coupled after freeing coupled_rdevs can +lead to NULL pointer dereference when regulators are accessed post-unbind. + +This can happen during runtime PM or other regulator operations that rely +on coupling metadata. + +For example, on ridesx4, unbinding the 'reg-dummy' platform device triggers +a panic in regulator_lock_recursive() due to stale coupling state. + +Ensure n_coupled is set to 0 to prevent access to invalid pointers. + +Signed-off-by: Alessandro Carminati +Link: https://patch.msgid.link/20250626083809.314842-1-acarmina@redhat.com +Signed-off-by: Mark Brown +Signed-off-by: Sasha Levin +--- + drivers/regulator/core.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c +index 18f13b9601b5b..ed5d58baa1f75 100644 +--- a/drivers/regulator/core.c ++++ b/drivers/regulator/core.c +@@ -5359,6 +5359,7 @@ static void regulator_remove_coupling(struct regulator_dev *rdev) + ERR_PTR(err)); + } + ++ rdev->coupling_desc.n_coupled = 0; + kfree(rdev->coupling_desc.coupled_rdevs); + rdev->coupling_desc.coupled_rdevs = NULL; + } +-- +2.39.5 + diff --git a/queue-5.15/series b/queue-5.15/series index 300ef95376..f88430e857 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -74,3 +74,7 @@ sched-add-wrapper-for-get_wchan-to-keep-task-blocked.patch x86-fix-__get_wchan-for-stacktrace.patch x86-pin-task-stack-in-__get_wchan.patch input-gpio-keys-fix-a-sleep-while-atomic-with-preempt_rt.patch +regulator-core-fix-null-dereference-on-unbind-due-to.patch +rdma-core-rate-limit-gid-cache-warning-messages.patch +interconnect-qcom-sc7280-add-missing-num_links-to-xm.patch +regmap-fix-potential-memory-leak-of-regmap_bus.patch -- 2.47.2