* [PATCH 6.18 455/752] rpmsg: core: fix race in driver_override_show() and use core helper
[not found] <20260228174750.1542406-1-sashal@kernel.org>
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 456/752] clk: renesas: rzg2l: Fix intin variable size Sasha Levin
` (283 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches; +Cc: Gui-Dong Han, stable, Mathieu Poirier, Sasha Levin
From: Gui-Dong Han <hanguidong02@gmail.com>
[ Upstream commit 42023d4b6d2661a40ee2dcf7e1a3528a35c638ca ]
The driver_override_show function reads the driver_override string
without holding the device_lock. However, the store function modifies
and frees the string while holding the device_lock. This creates a race
condition where the string can be freed by the store function while
being read by the show function, leading to a use-after-free.
To fix this, replace the rpmsg_string_attr macro with explicit show and
store functions. The new driver_override_store uses the standard
driver_set_override helper. Since the introduction of
driver_set_override, the comments in include/linux/rpmsg.h have stated
that this helper must be used to set or clear driver_override, but the
implementation was not updated until now.
Because driver_set_override modifies and frees the string while holding
the device_lock, the new driver_override_show now correctly holds the
device_lock during the read operation to prevent the race.
Additionally, since rpmsg_string_attr has only ever been used for
driver_override, removing the macro simplifies the code.
Fixes: 39e47767ec9b ("rpmsg: Add driver_override device attribute for rpmsg_device")
Cc: stable@vger.kernel.org
Signed-off-by: Gui-Dong Han <hanguidong02@gmail.com>
Link: https://lore.kernel.org/r/20251202174948.12693-1-hanguidong02@gmail.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rpmsg/rpmsg_core.c | 66 ++++++++++++++++----------------------
1 file changed, 27 insertions(+), 39 deletions(-)
diff --git a/drivers/rpmsg/rpmsg_core.c b/drivers/rpmsg/rpmsg_core.c
index 5d661681a9b6c..96964745065b1 100644
--- a/drivers/rpmsg/rpmsg_core.c
+++ b/drivers/rpmsg/rpmsg_core.c
@@ -352,50 +352,38 @@ field##_show(struct device *dev, \
} \
static DEVICE_ATTR_RO(field);
-#define rpmsg_string_attr(field, member) \
-static ssize_t \
-field##_store(struct device *dev, struct device_attribute *attr, \
- const char *buf, size_t sz) \
-{ \
- struct rpmsg_device *rpdev = to_rpmsg_device(dev); \
- const char *old; \
- char *new; \
- \
- new = kstrndup(buf, sz, GFP_KERNEL); \
- if (!new) \
- return -ENOMEM; \
- new[strcspn(new, "\n")] = '\0'; \
- \
- device_lock(dev); \
- old = rpdev->member; \
- if (strlen(new)) { \
- rpdev->member = new; \
- } else { \
- kfree(new); \
- rpdev->member = NULL; \
- } \
- device_unlock(dev); \
- \
- kfree(old); \
- \
- return sz; \
-} \
-static ssize_t \
-field##_show(struct device *dev, \
- struct device_attribute *attr, char *buf) \
-{ \
- struct rpmsg_device *rpdev = to_rpmsg_device(dev); \
- \
- return sprintf(buf, "%s\n", rpdev->member); \
-} \
-static DEVICE_ATTR_RW(field)
-
/* for more info, see Documentation/ABI/testing/sysfs-bus-rpmsg */
rpmsg_show_attr(name, id.name, "%s\n");
rpmsg_show_attr(src, src, "0x%x\n");
rpmsg_show_attr(dst, dst, "0x%x\n");
rpmsg_show_attr(announce, announce ? "true" : "false", "%s\n");
-rpmsg_string_attr(driver_override, driver_override);
+
+static ssize_t driver_override_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
+ int ret;
+
+ ret = driver_set_override(dev, &rpdev->driver_override, buf, count);
+ if (ret)
+ return ret;
+
+ return count;
+}
+
+static ssize_t driver_override_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct rpmsg_device *rpdev = to_rpmsg_device(dev);
+ ssize_t len;
+
+ device_lock(dev);
+ len = sysfs_emit(buf, "%s\n", rpdev->driver_override);
+ device_unlock(dev);
+ return len;
+}
+static DEVICE_ATTR_RW(driver_override);
static ssize_t modalias_show(struct device *dev,
struct device_attribute *attr, char *buf)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 456/752] clk: renesas: rzg2l: Fix intin variable size
[not found] <20260228174750.1542406-1-sashal@kernel.org>
2026-02-28 17:42 ` [PATCH 6.18 455/752] rpmsg: core: fix race in driver_override_show() and use core helper Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 458/752] hfsplus: ensure sb->s_fs_info is always cleaned up Sasha Levin
` (282 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Chris Brandt, stable, Hugo Villeneuve, Geert Uytterhoeven,
Sasha Levin
From: Chris Brandt <chris.brandt@renesas.com>
[ Upstream commit a00655d98cd885472c311f01dff3e668d1288d0a ]
INTIN is a 12-bit register value, so u8 is too small.
Fixes: 1561380ee72f ("clk: renesas: rzg2l: Add FOUTPOSTDIV clk support")
Cc: stable@vger.kernel.org
Reported-by: Hugo Villeneuve <hugo@hugovil.com>
Closes: https://lore.kernel.org/20251107113058.f334957151d1a8dd94dd740b@hugovil.com
Signed-off-by: Chris Brandt <chris.brandt@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://patch.msgid.link/20251114193711.3277912-1-chris.brandt@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/renesas/rzg2l-cpg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/renesas/rzg2l-cpg.c b/drivers/clk/renesas/rzg2l-cpg.c
index db85b1b43737b..9efedc62feed6 100644
--- a/drivers/clk/renesas/rzg2l-cpg.c
+++ b/drivers/clk/renesas/rzg2l-cpg.c
@@ -122,8 +122,8 @@ struct div_hw_data {
struct rzg2l_pll5_param {
u32 pl5_fracin;
+ u16 pl5_intin;
u8 pl5_refdiv;
- u8 pl5_intin;
u8 pl5_postdiv1;
u8 pl5_postdiv2;
u8 pl5_spread;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 458/752] hfsplus: ensure sb->s_fs_info is always cleaned up
[not found] <20260228174750.1542406-1-sashal@kernel.org>
2026-02-28 17:42 ` [PATCH 6.18 455/752] rpmsg: core: fix race in driver_override_show() and use core helper Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 456/752] clk: renesas: rzg2l: Fix intin variable size Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 459/752] arm64: dts: ti: am62p-verdin: Fix SD regulator startup delay Sasha Levin
` (281 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Mehdi Ben Hadj Khelifa, stable, Viacheslav Dubeyko,
Christian Brauner, Viacheslav Dubeyko, Sasha Levin
From: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com>
[ Upstream commit 126fb0ce99431126b44a6c360192668c818f641f ]
When hfsplus was converted to the new mount api a bug was introduced by
changing the allocation pattern of sb->s_fs_info. If setup_bdev_super()
fails after a new superblock has been allocated by sget_fc(), but before
hfsplus_fill_super() takes ownership of the filesystem-specific s_fs_info
data it was leaked.
Fix this by freeing sb->s_fs_info in hfsplus_kill_super().
Cc: stable@vger.kernel.org
Fixes: 432f7c78cb00 ("hfsplus: convert hfsplus to use the new mount api")
Reported-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Tested-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Mehdi Ben Hadj Khelifa <mehdi.benhadjkhelifa@gmail.com>
Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Link: https://lore.kernel.org/r/20251201222843.82310-3-mehdi.benhadjkhelifa@gmail.com
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/hfsplus/super.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index bb819ae608fd9..5230d368bd4f2 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -350,8 +350,6 @@ static void hfsplus_put_super(struct super_block *sb)
hfs_btree_close(sbi->ext_tree);
kfree(sbi->s_vhdr_buf);
kfree(sbi->s_backup_vhdr_buf);
- call_rcu(&sbi->rcu, delayed_free);
-
hfs_dbg("finished\n");
}
@@ -656,7 +654,6 @@ static int hfsplus_fill_super(struct super_block *sb, struct fs_context *fc)
out_unload_nls:
unload_nls(sbi->nls);
unload_nls(nls);
- kfree(sbi);
return err;
}
@@ -715,10 +712,18 @@ static int hfsplus_init_fs_context(struct fs_context *fc)
return 0;
}
+static void hfsplus_kill_super(struct super_block *sb)
+{
+ struct hfsplus_sb_info *sbi = HFSPLUS_SB(sb);
+
+ kill_block_super(sb);
+ call_rcu(&sbi->rcu, delayed_free);
+}
+
static struct file_system_type hfsplus_fs_type = {
.owner = THIS_MODULE,
.name = "hfsplus",
- .kill_sb = kill_block_super,
+ .kill_sb = hfsplus_kill_super,
.fs_flags = FS_REQUIRES_DEV,
.init_fs_context = hfsplus_init_fs_context,
};
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 459/752] arm64: dts: ti: am62p-verdin: Fix SD regulator startup delay
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (2 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 458/752] hfsplus: ensure sb->s_fs_info is always cleaned up Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 460/752] drm/panthor: fix for dma-fence safe access rules Sasha Levin
` (280 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches; +Cc: Francesco Dolcini, stable, Nishanth Menon, Sasha Levin
From: Francesco Dolcini <francesco.dolcini@toradex.com>
[ Upstream commit de86dbc0fb00bd3773db4b05d9f5926f0faa2244 ]
The power switch used to power the SD card interface might have
more than 2ms turn-on time, increase the startup delay to 20ms to
prevent failures.
Fixes: 87f95ea316ac ("arm64: dts: ti: Add Toradex Verdin AM62P")
Cc: stable@vger.kernel.org
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/20251209084126.33282-1-francesco@dolcini.it
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi
index 99810047614e3..b7d559c61f3f8 100644
--- a/arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62p-verdin.dtsi
@@ -112,7 +112,7 @@ reg_sd1_vmmc: regulator-sdhci1-vmmc {
regulator-max-microvolt = <3300000>;
regulator-min-microvolt = <3300000>;
regulator-name = "+V3.3_SD";
- startup-delay-us = <2000>;
+ startup-delay-us = <20000>;
};
reg_sd1_vqmmc: regulator-sdhci1-vqmmc {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 460/752] drm/panthor: fix for dma-fence safe access rules
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (3 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 459/752] arm64: dts: ti: am62p-verdin: Fix SD regulator startup delay Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 461/752] ASoC: SOF: ipc4-control: If there is no data do not send bytes update Sasha Levin
` (279 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Chia-I Wu, Boris Brezillon, Liviu Dudau, Steven Price, stable,
Sasha Levin
From: Chia-I Wu <olvaffe@gmail.com>
[ Upstream commit efe24898485c5c831e629d9c6fb9350c35cb576f ]
Commit 506aa8b02a8d6 ("dma-fence: Add safe access helpers and document
the rules") details the dma-fence safe access rules. The most common
culprit is that drm_sched_fence_get_timeline_name may race with
group_free_queue.
Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Cc: stable@vger.kernel.org # v6.17+
Signed-off-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20251204174545.399059-1-olvaffe@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/panthor/panthor_sched.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
index c7dd98936bd6b..6930053009d5c 100644
--- a/drivers/gpu/drm/panthor/panthor_sched.c
+++ b/drivers/gpu/drm/panthor/panthor_sched.c
@@ -22,6 +22,7 @@
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/rcupdate.h>
#include "panthor_devfreq.h"
#include "panthor_device.h"
@@ -926,6 +927,9 @@ static void group_release_work(struct work_struct *work)
release_work);
u32 i;
+ /* dma-fences may still be accessing group->queues under rcu lock. */
+ synchronize_rcu();
+
for (i = 0; i < group->queue_count; i++)
group_free_queue(group, group->queues[i]);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 461/752] ASoC: SOF: ipc4-control: If there is no data do not send bytes update
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (4 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 460/752] drm/panthor: fix for dma-fence safe access rules Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 462/752] ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls Sasha Levin
` (278 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Peter Ujfalusi, stable, Seppo Ingalsuo, Ranjani Sridharan,
Bard Liao, Kai Vehmanen, Mark Brown, Sasha Levin
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
[ Upstream commit 2fa74713744dc5e908fff851c20f5f89fd665fb7 ]
When the bytes control have no data (payload) then there is no need to send
an IPC message as there is nothing to send.
Fixes: a062c8899fed ("ASoC: SOF: ipc4-control: Add support for bytes control get and put")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20251217143945.2667-2-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/ipc4-control.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/sound/soc/sof/ipc4-control.c b/sound/soc/sof/ipc4-control.c
index 976a4794d6100..0a05f66ec7d92 100644
--- a/sound/soc/sof/ipc4-control.c
+++ b/sound/soc/sof/ipc4-control.c
@@ -412,8 +412,16 @@ static int sof_ipc4_set_get_bytes_data(struct snd_sof_dev *sdev,
int ret = 0;
/* Send the new data to the firmware only if it is powered up */
- if (set && !pm_runtime_active(sdev->dev))
- return 0;
+ if (set) {
+ if (!pm_runtime_active(sdev->dev))
+ return 0;
+
+ if (!data->size) {
+ dev_dbg(sdev->dev, "%s: No data to be sent.\n",
+ scontrol->name);
+ return 0;
+ }
+ }
msg->extension = SOF_IPC4_MOD_EXT_MSG_PARAM_ID(data->type);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 462/752] ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (5 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 461/752] ASoC: SOF: ipc4-control: If there is no data do not send bytes update Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 463/752] ASoC: SOF: ipc4-control: Use the correct size for scontrol->ipc_control_data Sasha Levin
` (277 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Peter Ujfalusi, stable, Seppo Ingalsuo, Ranjani Sridharan,
Bard Liao, Kai Vehmanen, Mark Brown, Sasha Levin
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
[ Upstream commit a653820700b81c9e6f05ac23b7969ecec1a18e85 ]
The size of the data behind of scontrol->ipc_control_data for bytes
controls is:
[1] sizeof(struct sof_ipc4_control_data) + // kernel only struct
[2] sizeof(struct sof_abi_hdr)) + payload
The max_size specifies the size of [2] and it is coming from topology.
Change the function to take this into account and allocate adequate amount
of memory behind scontrol->ipc_control_data.
With the change we will allocate [1] amount more memory to be able to hold
the full size of data.
Fixes: a382082ff74b ("ASoC: SOF: ipc4-topology: Add support for TPLG_CTL_BYTES")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20251217143945.2667-3-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/ipc4-topology.c | 35 +++++++++++++++++++++++++++--------
1 file changed, 27 insertions(+), 8 deletions(-)
diff --git a/sound/soc/sof/ipc4-topology.c b/sound/soc/sof/ipc4-topology.c
index 32b628e2fe29b..5ca995acaba2e 100644
--- a/sound/soc/sof/ipc4-topology.c
+++ b/sound/soc/sof/ipc4-topology.c
@@ -2861,22 +2861,41 @@ static int sof_ipc4_control_load_bytes(struct snd_sof_dev *sdev, struct snd_sof_
struct sof_ipc4_msg *msg;
int ret;
- if (scontrol->max_size < (sizeof(*control_data) + sizeof(struct sof_abi_hdr))) {
- dev_err(sdev->dev, "insufficient size for a bytes control %s: %zu.\n",
+ /*
+ * The max_size is coming from topology and indicates the maximum size
+ * of sof_abi_hdr plus the payload, which excludes the local only
+ * 'struct sof_ipc4_control_data'
+ */
+ if (scontrol->max_size < sizeof(struct sof_abi_hdr)) {
+ dev_err(sdev->dev,
+ "insufficient maximum size for a bytes control %s: %zu.\n",
scontrol->name, scontrol->max_size);
return -EINVAL;
}
- if (scontrol->priv_size > scontrol->max_size - sizeof(*control_data)) {
- dev_err(sdev->dev, "scontrol %s bytes data size %zu exceeds max %zu.\n",
- scontrol->name, scontrol->priv_size,
- scontrol->max_size - sizeof(*control_data));
+ if (scontrol->priv_size > scontrol->max_size) {
+ dev_err(sdev->dev,
+ "bytes control %s initial data size %zu exceeds max %zu.\n",
+ scontrol->name, scontrol->priv_size, scontrol->max_size);
+ return -EINVAL;
+ }
+
+ if (scontrol->priv_size < sizeof(struct sof_abi_hdr)) {
+ dev_err(sdev->dev,
+ "bytes control %s initial data size %zu is insufficient.\n",
+ scontrol->name, scontrol->priv_size);
return -EINVAL;
}
- scontrol->size = sizeof(struct sof_ipc4_control_data) + scontrol->priv_size;
+ /*
+ * The used size behind the cdata pointer, which can be smaller than
+ * the maximum size
+ */
+ scontrol->size = sizeof(*control_data) + scontrol->priv_size;
- scontrol->ipc_control_data = kzalloc(scontrol->max_size, GFP_KERNEL);
+ /* Allocate the cdata: local struct size + maximum payload size */
+ scontrol->ipc_control_data = kzalloc(sizeof(*control_data) + scontrol->max_size,
+ GFP_KERNEL);
if (!scontrol->ipc_control_data)
return -ENOMEM;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 463/752] ASoC: SOF: ipc4-control: Use the correct size for scontrol->ipc_control_data
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (6 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 462/752] ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 464/752] ASoC: SOF: ipc4-control: Keep the payload size up to date Sasha Levin
` (276 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Peter Ujfalusi, stable, Seppo Ingalsuo, Ranjani Sridharan,
Bard Liao, Kai Vehmanen, Mark Brown, Sasha Levin
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
[ Upstream commit c1876fc33c5976837e4c73719c7582617efc6919 ]
The size of the data behind scontrol->ipc_control_data is stored in
scontrol->size, use this when copying data for backup/restore.
Fixes: db38d86d0c54 ("ASoC: sof: Improve sof_ipc4_bytes_ext_put function")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20251217143945.2667-4-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/ipc4-control.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sound/soc/sof/ipc4-control.c b/sound/soc/sof/ipc4-control.c
index 0a05f66ec7d92..80111672c1796 100644
--- a/sound/soc/sof/ipc4-control.c
+++ b/sound/soc/sof/ipc4-control.c
@@ -66,7 +66,7 @@ static int sof_ipc4_set_get_kcontrol_data(struct snd_sof_control *scontrol,
* configuration
*/
memcpy(scontrol->ipc_control_data, scontrol->old_ipc_control_data,
- scontrol->max_size);
+ scontrol->size);
kfree(scontrol->old_ipc_control_data);
scontrol->old_ipc_control_data = NULL;
/* Send the last known good configuration to firmware */
@@ -567,7 +567,7 @@ static int sof_ipc4_bytes_ext_put(struct snd_sof_control *scontrol,
if (!scontrol->old_ipc_control_data) {
/* Create a backup of the current, valid bytes control */
scontrol->old_ipc_control_data = kmemdup(scontrol->ipc_control_data,
- scontrol->max_size, GFP_KERNEL);
+ scontrol->size, GFP_KERNEL);
if (!scontrol->old_ipc_control_data)
return -ENOMEM;
}
@@ -575,7 +575,7 @@ static int sof_ipc4_bytes_ext_put(struct snd_sof_control *scontrol,
/* Copy the whole binary data which includes the ABI header and the payload */
if (copy_from_user(data, tlvd->tlv, header.length)) {
memcpy(scontrol->ipc_control_data, scontrol->old_ipc_control_data,
- scontrol->max_size);
+ scontrol->size);
kfree(scontrol->old_ipc_control_data);
scontrol->old_ipc_control_data = NULL;
return -EFAULT;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 464/752] ASoC: SOF: ipc4-control: Keep the payload size up to date
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (7 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 463/752] ASoC: SOF: ipc4-control: Use the correct size for scontrol->ipc_control_data Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 465/752] fpga: dfl: use subsys_initcall to allow built-in drivers to be added Sasha Levin
` (275 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Peter Ujfalusi, stable, Seppo Ingalsuo, Ranjani Sridharan,
Bard Liao, Kai Vehmanen, Mark Brown, Sasha Levin
From: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
[ Upstream commit ebcfdbe4add923dfb690e6fb9d158da87ae0b6bf ]
When the bytes data is read from the firmware, the size of the payload
can be different than what it was previously.
For example when the topology did not contained payload data at all for the
control, the data size was 0.
For get operation allow maximum size of payload to be read and then update
the sizes according to the completed message.
Similarly, keep the size in sync when updating the data in firmware.
With the change we will be able to read data from firmware for bytes
controls which did not had initial payload defined in topology.
Fixes: a062c8899fed ("ASoC: SOF: ipc4-control: Add support for bytes control get and put")
Cc: stable@vger.kernel.org
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Reviewed-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Link: https://patch.msgid.link/20251217143945.2667-5-peter.ujfalusi@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/sof/ipc4-control.c | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/sound/soc/sof/ipc4-control.c b/sound/soc/sof/ipc4-control.c
index 80111672c1796..453ed1643b89c 100644
--- a/sound/soc/sof/ipc4-control.c
+++ b/sound/soc/sof/ipc4-control.c
@@ -426,13 +426,21 @@ static int sof_ipc4_set_get_bytes_data(struct snd_sof_dev *sdev,
msg->extension = SOF_IPC4_MOD_EXT_MSG_PARAM_ID(data->type);
msg->data_ptr = data->data;
- msg->data_size = data->size;
+ if (set)
+ msg->data_size = data->size;
+ else
+ msg->data_size = scontrol->max_size - sizeof(*data);
ret = sof_ipc4_set_get_kcontrol_data(scontrol, set, lock);
- if (ret < 0)
+ if (ret < 0) {
dev_err(sdev->dev, "Failed to %s for %s\n",
set ? "set bytes update" : "get bytes",
scontrol->name);
+ } else if (!set) {
+ /* Update the sizes according to the received payload data */
+ data->size = msg->data_size;
+ scontrol->size = sizeof(*cdata) + sizeof(*data) + data->size;
+ }
msg->data_ptr = NULL;
msg->data_size = 0;
@@ -448,6 +456,7 @@ static int sof_ipc4_bytes_put(struct snd_sof_control *scontrol,
struct snd_sof_dev *sdev = snd_soc_component_get_drvdata(scomp);
struct sof_abi_hdr *data = cdata->data;
size_t size;
+ int ret;
if (scontrol->max_size > sizeof(ucontrol->value.bytes.data)) {
dev_err_ratelimited(scomp->dev,
@@ -469,9 +478,12 @@ static int sof_ipc4_bytes_put(struct snd_sof_control *scontrol,
/* copy from kcontrol */
memcpy(data, ucontrol->value.bytes.data, size);
- sof_ipc4_set_get_bytes_data(sdev, scontrol, true, true);
+ ret = sof_ipc4_set_get_bytes_data(sdev, scontrol, true, true);
+ if (!ret)
+ /* Update the cdata size */
+ scontrol->size = sizeof(*cdata) + size;
- return 0;
+ return ret;
}
static int sof_ipc4_bytes_get(struct snd_sof_control *scontrol,
@@ -581,6 +593,9 @@ static int sof_ipc4_bytes_ext_put(struct snd_sof_control *scontrol,
return -EFAULT;
}
+ /* Update the cdata size */
+ scontrol->size = sizeof(*cdata) + header.length;
+
return sof_ipc4_set_get_bytes_data(sdev, scontrol, true, true);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 465/752] fpga: dfl: use subsys_initcall to allow built-in drivers to be added
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (8 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 464/752] ASoC: SOF: ipc4-control: Keep the payload size up to date Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 466/752] drm/tests: shmem: Swap names of export tests Sasha Levin
` (274 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches
Cc: Thadeu Lima de Souza Cascardo, stable, Xu Yilun, Xu Yilun,
Sasha Levin
From: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
[ Upstream commit 267f53140c9d0bf270bbe0148082e9b8e5011273 ]
The dfl code adds a bus. If it is built-in and there is a built-in driver
as well, the dfl module_init may be called after the driver module_init,
leading to a failure to register the driver as the bus has not been added
yet.
Use subsys_initcall, which guarantees it will be called before the drivers
init code.
Without the fix, we see failures like this:
[ 0.479475] Driver 'intel-m10-bmc' was unable to register with bus_type 'dfl' because the bus was not initialized.
Cc: stable@vger.kernel.org
Fixes: 9ba3a0aa09fe ("fpga: dfl: create a dfl bus type to support DFL devices")
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com>
Link: https://lore.kernel.org/r/20251215-dfl_subsys-v1-1-21807bad6b10@igalia.com
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/fpga/dfl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/fpga/dfl.c b/drivers/fpga/dfl.c
index 7022657243c0a..449c3a082e232 100644
--- a/drivers/fpga/dfl.c
+++ b/drivers/fpga/dfl.c
@@ -2018,7 +2018,7 @@ static void __exit dfl_fpga_exit(void)
bus_unregister(&dfl_bus_type);
}
-module_init(dfl_fpga_init);
+subsys_initcall(dfl_fpga_init);
module_exit(dfl_fpga_exit);
MODULE_DESCRIPTION("FPGA Device Feature List (DFL) Support");
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 466/752] drm/tests: shmem: Swap names of export tests
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (9 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 465/752] fpga: dfl: use subsys_initcall to allow built-in drivers to be added Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 467/752] drm/tests: shmem: Add clean-up action to unpin pages Sasha Levin
` (273 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches; +Cc: Thomas Zimmermann, dri-devel, stable, Boris Brezillon,
Sasha Levin
From: Thomas Zimmermann <tzimmermann@suse.de>
[ Upstream commit 89f23d42006630dd94c01a8c916f8c648141ad8e ]
GEM SHMEM has 2 helpers for exporting S/G tables. Swap the names of
the rsp. tests, so that each matches the helper it tests.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 93032ae634d4 ("drm/test: add a test suite for GEM objects backed by shmem")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.8+
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251212160317.287409-2-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tests/drm_gem_shmem_test.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
index 68f2c31623547..872881ec9c30d 100644
--- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
+++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
@@ -194,7 +194,7 @@ static void drm_gem_shmem_test_vmap(struct kunit *test)
* scatter/gather table large enough to accommodate the backing memory
* is successfully exported.
*/
-static void drm_gem_shmem_test_get_pages_sgt(struct kunit *test)
+static void drm_gem_shmem_test_get_sg_table(struct kunit *test)
{
struct drm_device *drm_dev = test->priv;
struct drm_gem_shmem_object *shmem;
@@ -236,7 +236,7 @@ static void drm_gem_shmem_test_get_pages_sgt(struct kunit *test)
* backing pages are pinned and a scatter/gather table large enough to
* accommodate the backing memory is successfully exported.
*/
-static void drm_gem_shmem_test_get_sg_table(struct kunit *test)
+static void drm_gem_shmem_test_get_pages_sgt(struct kunit *test)
{
struct drm_device *drm_dev = test->priv;
struct drm_gem_shmem_object *shmem;
@@ -366,8 +366,8 @@ static struct kunit_case drm_gem_shmem_test_cases[] = {
KUNIT_CASE(drm_gem_shmem_test_obj_create_private),
KUNIT_CASE(drm_gem_shmem_test_pin_pages),
KUNIT_CASE(drm_gem_shmem_test_vmap),
- KUNIT_CASE(drm_gem_shmem_test_get_pages_sgt),
KUNIT_CASE(drm_gem_shmem_test_get_sg_table),
+ KUNIT_CASE(drm_gem_shmem_test_get_pages_sgt),
KUNIT_CASE(drm_gem_shmem_test_madvise),
KUNIT_CASE(drm_gem_shmem_test_purge),
{}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 467/752] drm/tests: shmem: Add clean-up action to unpin pages
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (10 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 466/752] drm/tests: shmem: Swap names of export tests Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 468/752] drm/tests: shmem: Hold reservation lock around vmap/vunmap Sasha Levin
` (272 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches; +Cc: Thomas Zimmermann, dri-devel, stable, Boris Brezillon,
Sasha Levin
From: Thomas Zimmermann <tzimmermann@suse.de>
[ Upstream commit b47b9ecef309459278eb52f02b50eefdeaac4f6d ]
Automatically unpin pages on cleanup. The test currently fails with
the error
[ 58.246263] drm-kunit-mock-device drm_gem_shmem_test_get_sg_table.drm-kunit-mock-device: [drm] drm_WARN_ON(refcount_read(&shmem->pages_pin_count))
while cleaning up the GEM object. The pin count has to be zero at this
point.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: d586b535f144 ("drm/shmem-helper: Add and use pages_pin_count")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.16+
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251212160317.287409-3-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tests/drm_gem_shmem_test.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
index 872881ec9c30d..1d50bab51ef3f 100644
--- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
+++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
@@ -34,6 +34,9 @@ KUNIT_DEFINE_ACTION_WRAPPER(sg_free_table_wrapper, sg_free_table,
KUNIT_DEFINE_ACTION_WRAPPER(drm_gem_shmem_free_wrapper, drm_gem_shmem_free,
struct drm_gem_shmem_object *);
+KUNIT_DEFINE_ACTION_WRAPPER(drm_gem_shmem_unpin_wrapper, drm_gem_shmem_unpin,
+ struct drm_gem_shmem_object *);
+
/*
* Test creating a shmem GEM object backed by shmem buffer. The test
* case succeeds if the GEM object is successfully allocated with the
@@ -212,6 +215,9 @@ static void drm_gem_shmem_test_get_sg_table(struct kunit *test)
ret = drm_gem_shmem_pin(shmem);
KUNIT_ASSERT_EQ(test, ret, 0);
+ ret = kunit_add_action_or_reset(test, drm_gem_shmem_unpin_wrapper, shmem);
+ KUNIT_ASSERT_EQ(test, ret, 0);
+
sgt = drm_gem_shmem_get_sg_table(shmem);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, sgt);
KUNIT_EXPECT_NULL(test, shmem->sgt);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 468/752] drm/tests: shmem: Hold reservation lock around vmap/vunmap
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (11 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 467/752] drm/tests: shmem: Add clean-up action to unpin pages Sasha Levin
@ 2026-02-28 17:42 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 469/752] drm/tests: shmem: Hold reservation lock around madvise Sasha Levin
` (271 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:42 UTC (permalink / raw)
To: patches; +Cc: Thomas Zimmermann, dri-devel, stable, Boris Brezillon,
Sasha Levin
From: Thomas Zimmermann <tzimmermann@suse.de>
[ Upstream commit cda83b099f117f2a28a77bf467af934cb39e49cf ]
Acquire and release the GEM object's reservation lock around vmap and
vunmap operations. The tests use vmap_locked, which led to errors such
as show below.
[ 122.292030] WARNING: CPU: 3 PID: 1413 at drivers/gpu/drm/drm_gem_shmem_helper.c:390 drm_gem_shmem_vmap_locked+0x3a3/0x6f0
[ 122.468066] WARNING: CPU: 3 PID: 1413 at drivers/gpu/drm/drm_gem_shmem_helper.c:293 drm_gem_shmem_pin_locked+0x1fe/0x350
[ 122.563504] WARNING: CPU: 3 PID: 1413 at drivers/gpu/drm/drm_gem_shmem_helper.c:234 drm_gem_shmem_get_pages_locked+0x23c/0x370
[ 122.662248] WARNING: CPU: 2 PID: 1413 at drivers/gpu/drm/drm_gem_shmem_helper.c:452 drm_gem_shmem_vunmap_locked+0x101/0x330
Only export the new vmap/vunmap helpers for Kunit tests. These are
not interfaces for regular drivers.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked functions")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.16+
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251212160317.287409-4-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_gem_shmem_helper.c | 33 ++++++++++++++++++++++
drivers/gpu/drm/tests/drm_gem_shmem_test.c | 6 ++--
include/drm/drm_gem_shmem_helper.h | 9 ++++++
3 files changed, 46 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 365b5737ca2c6..d9c26d15ef6b9 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -15,6 +15,8 @@
#include <asm/set_memory.h>
#endif
+#include <kunit/visibility.h>
+
#include <drm/drm.h>
#include <drm/drm_device.h>
#include <drm/drm_drv.h>
@@ -861,6 +863,37 @@ struct drm_gem_object *drm_gem_shmem_prime_import_no_map(struct drm_device *dev,
}
EXPORT_SYMBOL_GPL(drm_gem_shmem_prime_import_no_map);
+/*
+ * Kunit helpers
+ */
+
+#if IS_ENABLED(CONFIG_KUNIT)
+int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map)
+{
+ struct drm_gem_object *obj = &shmem->base;
+ int ret;
+
+ ret = dma_resv_lock_interruptible(obj->resv, NULL);
+ if (ret)
+ return ret;
+ ret = drm_gem_shmem_vmap_locked(shmem, map);
+ dma_resv_unlock(obj->resv);
+
+ return ret;
+}
+EXPORT_SYMBOL_IF_KUNIT(drm_gem_shmem_vmap);
+
+void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map)
+{
+ struct drm_gem_object *obj = &shmem->base;
+
+ dma_resv_lock_interruptible(obj->resv, NULL);
+ drm_gem_shmem_vunmap_locked(shmem, map);
+ dma_resv_unlock(obj->resv);
+}
+EXPORT_SYMBOL_IF_KUNIT(drm_gem_shmem_vunmap);
+#endif
+
MODULE_DESCRIPTION("DRM SHMEM memory-management helpers");
MODULE_IMPORT_NS("DMA_BUF");
MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
index 1d50bab51ef3f..3e7c6f20fbcca 100644
--- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
+++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
@@ -19,6 +19,8 @@
#include <drm/drm_gem_shmem_helper.h>
#include <drm/drm_kunit_helpers.h>
+MODULE_IMPORT_NS("EXPORTED_FOR_KUNIT_TESTING");
+
#define TEST_SIZE SZ_1M
#define TEST_BYTE 0xae
@@ -176,7 +178,7 @@ static void drm_gem_shmem_test_vmap(struct kunit *test)
ret = kunit_add_action_or_reset(test, drm_gem_shmem_free_wrapper, shmem);
KUNIT_ASSERT_EQ(test, ret, 0);
- ret = drm_gem_shmem_vmap_locked(shmem, &map);
+ ret = drm_gem_shmem_vmap(shmem, &map);
KUNIT_ASSERT_EQ(test, ret, 0);
KUNIT_ASSERT_NOT_NULL(test, shmem->vaddr);
KUNIT_ASSERT_FALSE(test, iosys_map_is_null(&map));
@@ -186,7 +188,7 @@ static void drm_gem_shmem_test_vmap(struct kunit *test)
for (i = 0; i < TEST_SIZE; i++)
KUNIT_EXPECT_EQ(test, iosys_map_rd(&map, i, u8), TEST_BYTE);
- drm_gem_shmem_vunmap_locked(shmem, &map);
+ drm_gem_shmem_vunmap(shmem, &map);
KUNIT_EXPECT_NULL(test, shmem->vaddr);
KUNIT_EXPECT_EQ(test, refcount_read(&shmem->vmap_use_count), 0);
}
diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h
index 92f5db84b9c22..8a23fe96120e7 100644
--- a/include/drm/drm_gem_shmem_helper.h
+++ b/include/drm/drm_gem_shmem_helper.h
@@ -301,4 +301,13 @@ struct drm_gem_object *drm_gem_shmem_prime_import_no_map(struct drm_device *dev,
.gem_prime_import = drm_gem_shmem_prime_import_no_map, \
.dumb_create = drm_gem_shmem_dumb_create
+/*
+ * Kunit helpers
+ */
+
+#if IS_ENABLED(CONFIG_KUNIT)
+int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map);
+void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map);
+#endif
+
#endif /* __DRM_GEM_SHMEM_HELPER_H__ */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 469/752] drm/tests: shmem: Hold reservation lock around madvise
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (12 preceding siblings ...)
2026-02-28 17:42 ` [PATCH 6.18 468/752] drm/tests: shmem: Hold reservation lock around vmap/vunmap Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 470/752] drm/tests: shmem: Hold reservation lock around purge Sasha Levin
` (270 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Thomas Zimmermann, dri-devel, stable, Boris Brezillon,
Sasha Levin
From: Thomas Zimmermann <tzimmermann@suse.de>
[ Upstream commit 607d07d8cc0b835a8701259f08a03dc149b79b4f ]
Acquire and release the GEM object's reservation lock around calls
to the object's madvide operation. The tests use
drm_gem_shmem_madvise_locked(), which led to errors such as show below.
[ 58.339389] WARNING: CPU: 1 PID: 1352 at drivers/gpu/drm/drm_gem_shmem_helper.c:499 drm_gem_shmem_madvise_locked+0xde/0x140
Only export the new helper drm_gem_shmem_madvise() for Kunit tests.
This is not an interface for regular drivers.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked functions")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.16+
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251212160317.287409-5-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_gem_shmem_helper.c | 15 +++++++++++++++
drivers/gpu/drm/tests/drm_gem_shmem_test.c | 8 ++++----
include/drm/drm_gem_shmem_helper.h | 1 +
3 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index d9c26d15ef6b9..57df74c3a627b 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -892,6 +892,21 @@ void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct iosys_map *
dma_resv_unlock(obj->resv);
}
EXPORT_SYMBOL_IF_KUNIT(drm_gem_shmem_vunmap);
+
+int drm_gem_shmem_madvise(struct drm_gem_shmem_object *shmem, int madv)
+{
+ struct drm_gem_object *obj = &shmem->base;
+ int ret;
+
+ ret = dma_resv_lock_interruptible(obj->resv, NULL);
+ if (ret)
+ return ret;
+ ret = drm_gem_shmem_madvise_locked(shmem, madv);
+ dma_resv_unlock(obj->resv);
+
+ return ret;
+}
+EXPORT_SYMBOL_IF_KUNIT(drm_gem_shmem_madvise);
#endif
MODULE_DESCRIPTION("DRM SHMEM memory-management helpers");
diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
index 3e7c6f20fbcca..d639848e3c8ea 100644
--- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
+++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
@@ -292,17 +292,17 @@ static void drm_gem_shmem_test_madvise(struct kunit *test)
ret = kunit_add_action_or_reset(test, drm_gem_shmem_free_wrapper, shmem);
KUNIT_ASSERT_EQ(test, ret, 0);
- ret = drm_gem_shmem_madvise_locked(shmem, 1);
+ ret = drm_gem_shmem_madvise(shmem, 1);
KUNIT_EXPECT_TRUE(test, ret);
KUNIT_ASSERT_EQ(test, shmem->madv, 1);
/* Set madv to a negative value */
- ret = drm_gem_shmem_madvise_locked(shmem, -1);
+ ret = drm_gem_shmem_madvise(shmem, -1);
KUNIT_EXPECT_FALSE(test, ret);
KUNIT_ASSERT_EQ(test, shmem->madv, -1);
/* Check that madv cannot be set back to a positive value */
- ret = drm_gem_shmem_madvise_locked(shmem, 0);
+ ret = drm_gem_shmem_madvise(shmem, 0);
KUNIT_EXPECT_FALSE(test, ret);
KUNIT_ASSERT_EQ(test, shmem->madv, -1);
}
@@ -330,7 +330,7 @@ static void drm_gem_shmem_test_purge(struct kunit *test)
ret = drm_gem_shmem_is_purgeable(shmem);
KUNIT_EXPECT_FALSE(test, ret);
- ret = drm_gem_shmem_madvise_locked(shmem, 1);
+ ret = drm_gem_shmem_madvise(shmem, 1);
KUNIT_EXPECT_TRUE(test, ret);
/* The scatter/gather table will be freed by drm_gem_shmem_free */
diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h
index 8a23fe96120e7..1b937166457fb 100644
--- a/include/drm/drm_gem_shmem_helper.h
+++ b/include/drm/drm_gem_shmem_helper.h
@@ -308,6 +308,7 @@ struct drm_gem_object *drm_gem_shmem_prime_import_no_map(struct drm_device *dev,
#if IS_ENABLED(CONFIG_KUNIT)
int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map);
void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map);
+int drm_gem_shmem_madvise(struct drm_gem_shmem_object *shmem, int madv);
#endif
#endif /* __DRM_GEM_SHMEM_HELPER_H__ */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 470/752] drm/tests: shmem: Hold reservation lock around purge
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (13 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 469/752] drm/tests: shmem: Hold reservation lock around madvise Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 471/752] drm/xe: Fix ggtt fb alignment Sasha Levin
` (269 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Thomas Zimmermann, dri-devel, stable, Boris Brezillon,
Sasha Levin
From: Thomas Zimmermann <tzimmermann@suse.de>
[ Upstream commit 3f41307d589c2f25d556d47b165df808124cd0c4 ]
Acquire and release the GEM object's reservation lock around calls
to the object's purge operation. The tests use
drm_gem_shmem_purge_locked(), which led to errors such as show below.
[ 58.709128] WARNING: CPU: 1 PID: 1354 at drivers/gpu/drm/drm_gem_shmem_helper.c:515 drm_gem_shmem_purge_locked+0x51c/0x740
Only export the new helper drm_gem_shmem_purge() for Kunit tests.
This is not an interface for regular drivers.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Fixes: 954907f7147d ("drm/shmem-helper: Refactor locked/unlocked functions")
Cc: dri-devel@lists.freedesktop.org
Cc: <stable@vger.kernel.org> # v6.16+
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patch.msgid.link/20251212160317.287409-6-tzimmermann@suse.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_gem_shmem_helper.c | 15 +++++++++++++++
drivers/gpu/drm/tests/drm_gem_shmem_test.c | 4 +++-
include/drm/drm_gem_shmem_helper.h | 1 +
3 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c
index 57df74c3a627b..5c6da91bbba17 100644
--- a/drivers/gpu/drm/drm_gem_shmem_helper.c
+++ b/drivers/gpu/drm/drm_gem_shmem_helper.c
@@ -907,6 +907,21 @@ int drm_gem_shmem_madvise(struct drm_gem_shmem_object *shmem, int madv)
return ret;
}
EXPORT_SYMBOL_IF_KUNIT(drm_gem_shmem_madvise);
+
+int drm_gem_shmem_purge(struct drm_gem_shmem_object *shmem)
+{
+ struct drm_gem_object *obj = &shmem->base;
+ int ret;
+
+ ret = dma_resv_lock_interruptible(obj->resv, NULL);
+ if (ret)
+ return ret;
+ drm_gem_shmem_purge_locked(shmem);
+ dma_resv_unlock(obj->resv);
+
+ return 0;
+}
+EXPORT_SYMBOL_IF_KUNIT(drm_gem_shmem_purge);
#endif
MODULE_DESCRIPTION("DRM SHMEM memory-management helpers");
diff --git a/drivers/gpu/drm/tests/drm_gem_shmem_test.c b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
index d639848e3c8ea..4b459f21acfd9 100644
--- a/drivers/gpu/drm/tests/drm_gem_shmem_test.c
+++ b/drivers/gpu/drm/tests/drm_gem_shmem_test.c
@@ -340,7 +340,9 @@ static void drm_gem_shmem_test_purge(struct kunit *test)
ret = drm_gem_shmem_is_purgeable(shmem);
KUNIT_EXPECT_TRUE(test, ret);
- drm_gem_shmem_purge_locked(shmem);
+ ret = drm_gem_shmem_purge(shmem);
+ KUNIT_ASSERT_EQ(test, ret, 0);
+
KUNIT_EXPECT_NULL(test, shmem->pages);
KUNIT_EXPECT_NULL(test, shmem->sgt);
KUNIT_EXPECT_EQ(test, shmem->madv, -1);
diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h
index 1b937166457fb..6802896e30c7c 100644
--- a/include/drm/drm_gem_shmem_helper.h
+++ b/include/drm/drm_gem_shmem_helper.h
@@ -309,6 +309,7 @@ struct drm_gem_object *drm_gem_shmem_prime_import_no_map(struct drm_device *dev,
int drm_gem_shmem_vmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map);
void drm_gem_shmem_vunmap(struct drm_gem_shmem_object *shmem, struct iosys_map *map);
int drm_gem_shmem_madvise(struct drm_gem_shmem_object *shmem, int madv);
+int drm_gem_shmem_purge(struct drm_gem_shmem_object *shmem);
#endif
#endif /* __DRM_GEM_SHMEM_HELPER_H__ */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 471/752] drm/xe: Fix ggtt fb alignment
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (14 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 470/752] drm/tests: shmem: Hold reservation lock around purge Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 472/752] Revert "PCI: dw-rockchip: Don't wait for link since we can detect Link Up" Sasha Levin
` (268 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Tvrtko Ursulin, Ville Syrjälä, Juha-Pekka Heikkila,
stable, Thomas Hellström, Sasha Levin
From: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
[ Upstream commit a61bf068f1fe359203f1af191cb523b77dc32752 ]
Pass the correct alignment from intel_fb_pin_to_ggtt() down to
__xe_pin_fb_vma().
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Reported-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Closes: https://lore.kernel.org/intel-xe/aNL_RgLy13fXJbYx@intel.com/
Cc: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Fixes: b0228a337de8 ("drm/xe/display: align framebuffers according to hw requirements")
Cc: <stable@vger.kernel.org> # v6.13+
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patch.msgid.link/20251208181550.6618-1-tursulin@igalia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/display/xe_fb_pin.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c
index 1fd4a815e784b..b18d15cc3c53d 100644
--- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
+++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
@@ -378,7 +378,7 @@ intel_fb_pin_to_ggtt(const struct drm_framebuffer *fb,
{
*out_flags = 0;
- return __xe_pin_fb_vma(to_intel_framebuffer(fb), view, phys_alignment);
+ return __xe_pin_fb_vma(to_intel_framebuffer(fb), view, alignment);
}
void intel_fb_unpin_vma(struct i915_vma *vma, unsigned long flags)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 472/752] Revert "PCI: dw-rockchip: Don't wait for link since we can detect Link Up"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (15 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 471/752] drm/xe: Fix ggtt fb alignment Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 473/752] Revert "PCI: qcom: Don't wait for link if " Sasha Levin
` (267 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Niklas Cassel, Manivannan Sadhasivam, Shawn Lin, stable,
Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit fc6298086bfacaa7003b0bd1da4e4f42b29f7d77 ]
This reverts commit ec9fd499b9c60a187ac8d6414c3c343c77d32e42.
While this fake hotplugging was a nice idea, it has shown that this feature
does not handle PCIe switches correctly:
pci_bus 0004:43: busn_res: can not insert [bus 43-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:43: busn_res: [bus 43-41] end is updated to 43
pci_bus 0004:43: busn_res: can not insert [bus 43] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:00.0: devices behind bridge are unusable because [bus 43] cannot be assigned for them
pci_bus 0004:44: busn_res: can not insert [bus 44-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:44: busn_res: [bus 44-41] end is updated to 44
pci_bus 0004:44: busn_res: can not insert [bus 44] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:02.0: devices behind bridge are unusable because [bus 44] cannot be assigned for them
pci_bus 0004:45: busn_res: can not insert [bus 45-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:45: busn_res: [bus 45-41] end is updated to 45
pci_bus 0004:45: busn_res: can not insert [bus 45] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:06.0: devices behind bridge are unusable because [bus 45] cannot be assigned for them
pci_bus 0004:46: busn_res: can not insert [bus 46-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:46: busn_res: [bus 46-41] end is updated to 46
pci_bus 0004:46: busn_res: can not insert [bus 46] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:0e.0: devices behind bridge are unusable because [bus 46] cannot be assigned for them
pci_bus 0004:42: busn_res: [bus 42-41] end is updated to 46
pci_bus 0004:42: busn_res: can not insert [bus 42-46] under [bus 41] (conflicts with (null) [bus 41])
pci 0004:41:00.0: devices behind bridge are unusable because [bus 42-46] cannot be assigned for them
pcieport 0004:40:00.0: bridge has subordinate 41 but max busn 46
During the initial scan, PCI core doesn't see the switch and since the Root
Port is not hot plug capable, the secondary bus number gets assigned as the
subordinate bus number. This means, the PCI core assumes that only one bus
will appear behind the Root Port since the Root Port is not hot plug
capable.
This works perfectly fine for PCIe endpoints connected to the Root Port,
since they don't extend the bus. However, if a PCIe switch is connected,
then there is a problem when the downstream busses starts showing up and
the PCI core doesn't extend the subordinate bus number and bridge resources
after initial scan during boot.
The long term plan is to migrate this driver to the upcoming pwrctrl APIs
that are supposed to handle this problem elegantly.
Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251222064207.3246632-9-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-dw-rockchip.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
index 79e55b9833e4a..7be6351686e21 100644
--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
+++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
@@ -549,7 +549,6 @@ static int rockchip_pcie_configure_rc(struct platform_device *pdev,
pp = &rockchip->pci.pp;
pp->ops = &rockchip_pcie_host_ops;
- pp->use_linkup_irq = true;
ret = dw_pcie_host_init(pp);
if (ret) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 473/752] Revert "PCI: qcom: Don't wait for link if we can detect Link Up"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (16 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 472/752] Revert "PCI: dw-rockchip: Don't wait for link since we can detect Link Up" Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 474/752] Revert "PCI: qcom: Enable MSI interrupts together with Link up if 'Global IRQ' is supported" Sasha Levin
` (266 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Niklas Cassel, Manivannan Sadhasivam, Shawn Lin, stable,
Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit e9ce5b3804436301ab343bc14203a4c14b336d1b ]
This reverts commit 36971d6c5a9a134c15760ae9fd13c6d5f9a36abb.
While this fake hotplugging was a nice idea, it has shown that this feature
does not handle PCIe switches correctly:
pci_bus 0004:43: busn_res: can not insert [bus 43-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:43: busn_res: [bus 43-41] end is updated to 43
pci_bus 0004:43: busn_res: can not insert [bus 43] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:00.0: devices behind bridge are unusable because [bus 43] cannot be assigned for them
pci_bus 0004:44: busn_res: can not insert [bus 44-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:44: busn_res: [bus 44-41] end is updated to 44
pci_bus 0004:44: busn_res: can not insert [bus 44] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:02.0: devices behind bridge are unusable because [bus 44] cannot be assigned for them
pci_bus 0004:45: busn_res: can not insert [bus 45-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:45: busn_res: [bus 45-41] end is updated to 45
pci_bus 0004:45: busn_res: can not insert [bus 45] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:06.0: devices behind bridge are unusable because [bus 45] cannot be assigned for them
pci_bus 0004:46: busn_res: can not insert [bus 46-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:46: busn_res: [bus 46-41] end is updated to 46
pci_bus 0004:46: busn_res: can not insert [bus 46] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:0e.0: devices behind bridge are unusable because [bus 46] cannot be assigned for them
pci_bus 0004:42: busn_res: [bus 42-41] end is updated to 46
pci_bus 0004:42: busn_res: can not insert [bus 42-46] under [bus 41] (conflicts with (null) [bus 41])
pci 0004:41:00.0: devices behind bridge are unusable because [bus 42-46] cannot be assigned for them
pcieport 0004:40:00.0: bridge has subordinate 41 but max busn 46
During the initial scan, PCI core doesn't see the switch and since the Root
Port is not hot plug capable, the secondary bus number gets assigned as the
subordinate bus number. This means, the PCI core assumes that only one bus
will appear behind the Root Port since the Root Port is not hot plug
capable.
This works perfectly fine for PCIe endpoints connected to the Root Port,
since they don't extend the bus. However, if a PCIe switch is connected,
then there is a problem when the downstream busses starts showing up and
the PCI core doesn't extend the subordinate bus number and bridge resources
after initial scan during boot.
The long term plan is to migrate this driver to the upcoming pwrctrl APIs
that are supposed to handle this problem elegantly.
Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251222064207.3246632-11-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-qcom.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 6e820595ba32a..2e9dffbda4bca 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -1929,10 +1929,6 @@ static int qcom_pcie_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, pcie);
- irq = platform_get_irq_byname_optional(pdev, "global");
- if (irq > 0)
- pp->use_linkup_irq = true;
-
ret = dw_pcie_host_init(pp);
if (ret) {
dev_err(dev, "cannot initialize host\n");
@@ -1946,6 +1942,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
goto err_host_deinit;
}
+ irq = platform_get_irq_byname_optional(pdev, "global");
if (irq > 0) {
ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
qcom_pcie_global_irq_thread,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 474/752] Revert "PCI: qcom: Enable MSI interrupts together with Link up if 'Global IRQ' is supported"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (17 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 473/752] Revert "PCI: qcom: Don't wait for link if " Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 475/752] Revert "PCI: qcom: Enumerate endpoints based on Link up event in 'global_irq' interrupt" Sasha Levin
` (265 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Niklas Cassel, Manivannan Sadhasivam, Shawn Lin, stable,
Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 7ebdefb87942073679e56cfbc5a72e8fc5441bfc ]
This reverts commit ba4a2e2317b9faeca9193ed6d3193ddc3cf2aba3.
Since the Link up IRQ support is going away, revert the MSI logic that got
added for it too.
Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
[mani: reworded the description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251222064207.3246632-12-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-qcom.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 2e9dffbda4bca..2779b09dfe3ec 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -136,7 +136,6 @@
/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
#define PARF_INT_ALL_LINK_UP BIT(13)
-#define PARF_INT_MSI_DEV_0_7 GENMASK(30, 23)
/* PARF_NO_SNOOP_OVERRIDE register fields */
#define WR_NO_SNOOP_OVERRIDE_EN BIT(1)
@@ -1953,8 +1952,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
goto err_host_deinit;
}
- writel_relaxed(PARF_INT_ALL_LINK_UP | PARF_INT_MSI_DEV_0_7,
- pcie->parf + PARF_INT_ALL_MASK);
+ writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK);
}
qcom_pcie_icc_opp_update(pcie);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 475/752] Revert "PCI: qcom: Enumerate endpoints based on Link up event in 'global_irq' interrupt"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (18 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 474/752] Revert "PCI: qcom: Enable MSI interrupts together with Link up if 'Global IRQ' is supported" Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 476/752] Revert "PCI: dwc: Don't wait for link up if driver can detect Link Up event" Sasha Levin
` (264 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Niklas Cassel, Manivannan Sadhasivam, Shawn Lin, stable,
Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 9a9793b55854422652ea92625e48277c4651c0fd ]
This reverts commit 4581403f67929d02c197cb187c4e1e811c9e762a.
While this fake hotplugging was a nice idea, it has shown that this feature
does not handle PCIe switches correctly:
pci_bus 0004:43: busn_res: can not insert [bus 43-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:43: busn_res: [bus 43-41] end is updated to 43
pci_bus 0004:43: busn_res: can not insert [bus 43] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:00.0: devices behind bridge are unusable because [bus 43] cannot be assigned for them
pci_bus 0004:44: busn_res: can not insert [bus 44-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:44: busn_res: [bus 44-41] end is updated to 44
pci_bus 0004:44: busn_res: can not insert [bus 44] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:02.0: devices behind bridge are unusable because [bus 44] cannot be assigned for them
pci_bus 0004:45: busn_res: can not insert [bus 45-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:45: busn_res: [bus 45-41] end is updated to 45
pci_bus 0004:45: busn_res: can not insert [bus 45] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:06.0: devices behind bridge are unusable because [bus 45] cannot be assigned for them
pci_bus 0004:46: busn_res: can not insert [bus 46-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:46: busn_res: [bus 46-41] end is updated to 46
pci_bus 0004:46: busn_res: can not insert [bus 46] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:0e.0: devices behind bridge are unusable because [bus 46] cannot be assigned for them
pci_bus 0004:42: busn_res: [bus 42-41] end is updated to 46
pci_bus 0004:42: busn_res: can not insert [bus 42-46] under [bus 41] (conflicts with (null) [bus 41])
pci 0004:41:00.0: devices behind bridge are unusable because [bus 42-46] cannot be assigned for them
pcieport 0004:40:00.0: bridge has subordinate 41 but max busn 46
During the initial scan, PCI core doesn't see the switch and since the Root
Port is not hot plug capable, the secondary bus number gets assigned as the
subordinate bus number. This means, the PCI core assumes that only one bus
will appear behind the Root Port since the Root Port is not hot plug
capable.
This works perfectly fine for PCIe endpoints connected to the Root Port,
since they don't extend the bus. However, if a PCIe switch is connected,
then there is a problem when the downstream busses starts showing up and
the PCI core doesn't extend the subordinate bus number and bridge resources
after initial scan during boot.
The long term plan is to migrate this driver to the upcoming pwrctrl APIs
that are supposed to handle this problem elegantly.
Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251222064207.3246632-13-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-qcom.c | 58 +-------------------------
1 file changed, 1 insertion(+), 57 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c
index 2779b09dfe3ec..5311cd5d96372 100644
--- a/drivers/pci/controller/dwc/pcie-qcom.c
+++ b/drivers/pci/controller/dwc/pcie-qcom.c
@@ -55,9 +55,6 @@
#define PARF_AXI_MSTR_WR_ADDR_HALT_V2 0x1a8
#define PARF_Q2A_FLUSH 0x1ac
#define PARF_LTSSM 0x1b0
-#define PARF_INT_ALL_STATUS 0x224
-#define PARF_INT_ALL_CLEAR 0x228
-#define PARF_INT_ALL_MASK 0x22c
#define PARF_SID_OFFSET 0x234
#define PARF_BDF_TRANSLATE_CFG 0x24c
#define PARF_DBI_BASE_ADDR_V2 0x350
@@ -134,9 +131,6 @@
/* PARF_LTSSM register fields */
#define LTSSM_EN BIT(8)
-/* PARF_INT_ALL_{STATUS/CLEAR/MASK} register fields */
-#define PARF_INT_ALL_LINK_UP BIT(13)
-
/* PARF_NO_SNOOP_OVERRIDE register fields */
#define WR_NO_SNOOP_OVERRIDE_EN BIT(1)
#define RD_NO_SNOOP_OVERRIDE_EN BIT(3)
@@ -1606,32 +1600,6 @@ static void qcom_pcie_init_debugfs(struct qcom_pcie *pcie)
qcom_pcie_link_transition_count);
}
-static irqreturn_t qcom_pcie_global_irq_thread(int irq, void *data)
-{
- struct qcom_pcie *pcie = data;
- struct dw_pcie_rp *pp = &pcie->pci->pp;
- struct device *dev = pcie->pci->dev;
- u32 status = readl_relaxed(pcie->parf + PARF_INT_ALL_STATUS);
-
- writel_relaxed(status, pcie->parf + PARF_INT_ALL_CLEAR);
-
- if (FIELD_GET(PARF_INT_ALL_LINK_UP, status)) {
- msleep(PCIE_RESET_CONFIG_WAIT_MS);
- dev_dbg(dev, "Received Link up event. Starting enumeration!\n");
- /* Rescan the bus to enumerate endpoint devices */
- pci_lock_rescan_remove();
- pci_rescan_bus(pp->bridge->bus);
- pci_unlock_rescan_remove();
-
- qcom_pcie_icc_opp_update(pcie);
- } else {
- dev_WARN_ONCE(dev, 1, "Received unknown event. INT_STATUS: 0x%08x\n",
- status);
- }
-
- return IRQ_HANDLED;
-}
-
static void qcom_pci_free_msi(void *ptr)
{
struct dw_pcie_rp *pp = (struct dw_pcie_rp *)ptr;
@@ -1776,8 +1744,7 @@ static int qcom_pcie_probe(struct platform_device *pdev)
struct dw_pcie_rp *pp;
struct resource *res;
struct dw_pcie *pci;
- int ret, irq;
- char *name;
+ int ret;
pcie_cfg = of_device_get_match_data(dev);
if (!pcie_cfg) {
@@ -1934,27 +1901,6 @@ static int qcom_pcie_probe(struct platform_device *pdev)
goto err_phy_exit;
}
- name = devm_kasprintf(dev, GFP_KERNEL, "qcom_pcie_global_irq%d",
- pci_domain_nr(pp->bridge->bus));
- if (!name) {
- ret = -ENOMEM;
- goto err_host_deinit;
- }
-
- irq = platform_get_irq_byname_optional(pdev, "global");
- if (irq > 0) {
- ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
- qcom_pcie_global_irq_thread,
- IRQF_ONESHOT, name, pcie);
- if (ret) {
- dev_err_probe(&pdev->dev, ret,
- "Failed to request Global IRQ\n");
- goto err_host_deinit;
- }
-
- writel_relaxed(PARF_INT_ALL_LINK_UP, pcie->parf + PARF_INT_ALL_MASK);
- }
-
qcom_pcie_icc_opp_update(pcie);
if (pcie->mhi)
@@ -1962,8 +1908,6 @@ static int qcom_pcie_probe(struct platform_device *pdev)
return 0;
-err_host_deinit:
- dw_pcie_host_deinit(pp);
err_phy_exit:
list_for_each_entry_safe(port, tmp, &pcie->ports, list) {
phy_exit(port->phy);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 476/752] Revert "PCI: dwc: Don't wait for link up if driver can detect Link Up event"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (19 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 475/752] Revert "PCI: qcom: Enumerate endpoints based on Link up event in 'global_irq' interrupt" Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 477/752] PCI: Use resource_set_range() that correctly sets ->end Sasha Levin
` (263 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Niklas Cassel, Manivannan Sadhasivam, Shawn Lin, stable,
Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 142d5869f6eec3110adda0ad2d931f5b3c22371d ]
This reverts commit 8d3bf19f1b585a3cc0027f508b64c33484db8d0d.
While this fake hotplugging was a nice idea, it has shown that this feature
does not handle PCIe switches correctly:
pci_bus 0004:43: busn_res: can not insert [bus 43-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:43: busn_res: [bus 43-41] end is updated to 43
pci_bus 0004:43: busn_res: can not insert [bus 43] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:00.0: devices behind bridge are unusable because [bus 43] cannot be assigned for them
pci_bus 0004:44: busn_res: can not insert [bus 44-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:44: busn_res: [bus 44-41] end is updated to 44
pci_bus 0004:44: busn_res: can not insert [bus 44] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:02.0: devices behind bridge are unusable because [bus 44] cannot be assigned for them
pci_bus 0004:45: busn_res: can not insert [bus 45-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:45: busn_res: [bus 45-41] end is updated to 45
pci_bus 0004:45: busn_res: can not insert [bus 45] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:06.0: devices behind bridge are unusable because [bus 45] cannot be assigned for them
pci_bus 0004:46: busn_res: can not insert [bus 46-41] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci_bus 0004:46: busn_res: [bus 46-41] end is updated to 46
pci_bus 0004:46: busn_res: can not insert [bus 46] under [bus 42-41] (conflicts with (null) [bus 42-41])
pci 0004:42:0e.0: devices behind bridge are unusable because [bus 46] cannot be assigned for them
pci_bus 0004:42: busn_res: [bus 42-41] end is updated to 46
pci_bus 0004:42: busn_res: can not insert [bus 42-46] under [bus 41] (conflicts with (null) [bus 41])
pci 0004:41:00.0: devices behind bridge are unusable because [bus 42-46] cannot be assigned for them
pcieport 0004:40:00.0: bridge has subordinate 41 but max busn 46
During the initial scan, PCI core doesn't see the switch and since the Root
Port is not hot plug capable, the secondary bus number gets assigned as the
subordinate bus number. This means, the PCI core assumes that only one bus
will appear behind the Root Port since the Root Port is not hot plug
capable.
This works perfectly fine for PCIe endpoints connected to the Root Port,
since they don't extend the bus. However, if a PCIe switch is connected,
then there is a problem when the downstream busses starts showing up and
the PCI core doesn't extend the subordinate bus number and bridge resources
after initial scan during boot.
So revert the change that skipped dw_pcie_wait_for_link() if the Link up
IRQ was used by a vendor glue driver.
Suggested-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Shawn Lin <shawn.lin@rock-chips.com>
Acked-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251222064207.3246632-14-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 10 ++--------
drivers/pci/controller/dwc/pcie-designware.h | 1 -
2 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 702885c53f467..60fadaa1c0bd2 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -664,14 +664,8 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
goto err_remove_edma;
}
- /*
- * Note: Skip the link up delay only when a Link Up IRQ is present.
- * If there is no Link Up IRQ, we should not bypass the delay
- * because that would require users to manually rescan for devices.
- */
- if (!pp->use_linkup_irq)
- /* Ignore errors, the link may come up later */
- dw_pcie_wait_for_link(pci);
+ /* Ignore errors, the link may come up later */
+ dw_pcie_wait_for_link(pci);
ret = pci_host_probe(bridge);
if (ret)
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index 24bfa5231923a..7c56146b95f6b 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -426,7 +426,6 @@ struct dw_pcie_rp {
bool use_atu_msg;
int msg_atu_index;
struct resource *msg_res;
- bool use_linkup_irq;
struct pci_eq_presets presets;
struct pci_config_window *cfg;
bool ecam_enabled;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 477/752] PCI: Use resource_set_range() that correctly sets ->end
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (20 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 476/752] Revert "PCI: dwc: Don't wait for link up if driver can detect Link Up event" Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 478/752] phy: qcom: edp: Make the number of clocks flexible Sasha Levin
` (262 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Ilpo Järvinen, Bjorn Helgaas, Andy Shevchenko, stable,
Christian Marangi, Sasha Levin
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit 11721c45a8266a9d0c9684153d20e37159465f96 ]
__pci_read_base() sets resource start and end addresses when resource
is larger than 4G but pci_bus_addr_t or resource_size_t are not capable
of representing 64-bit PCI addresses. This creates a problematic
resource that has non-zero flags but the start and end addresses do not
yield to resource size of 0 but 1.
Replace custom resource addresses setup with resource_set_range()
that correctly sets end address as -1 which results in resource_size()
returning 0.
For consistency, also use resource_set_range() in the other branch that
does size based resource setup.
Fixes: 23b13bc76f35 ("PCI: Fail safely if we can't handle BARs larger than 4GB")
Link: https://lore.kernel.org/all/20251207215359.28895-1-ansuelsmth@gmail.com/T/#m990492684913c5a158ff0e5fc90697d8ad95351b
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: stable@vger.kernel.org
Cc: Christian Marangi <ansuelsmth@gmail.com>
Link: https://patch.msgid.link/20251208145654.5294-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/probe.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 7d4f0db5ac265..23833fd7265e2 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -287,8 +287,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
if ((sizeof(pci_bus_addr_t) < 8 || sizeof(resource_size_t) < 8)
&& sz64 > 0x100000000ULL) {
res->flags |= IORESOURCE_UNSET | IORESOURCE_DISABLED;
- res->start = 0;
- res->end = 0;
+ resource_set_range(res, 0, 0);
pci_err(dev, "%s: can't handle BAR larger than 4GB (size %#010llx)\n",
res_name, (unsigned long long)sz64);
goto out;
@@ -297,8 +296,7 @@ int __pci_read_base(struct pci_dev *dev, enum pci_bar_type type,
if ((sizeof(pci_bus_addr_t) < 8) && l) {
/* Above 32-bit boundary; try to reallocate */
res->flags |= IORESOURCE_UNSET;
- res->start = 0;
- res->end = sz64 - 1;
+ resource_set_range(res, 0, sz64);
pci_info(dev, "%s: can't handle BAR above 4GB (bus address %#010llx)\n",
res_name, (unsigned long long)l64);
goto out;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 478/752] phy: qcom: edp: Make the number of clocks flexible
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (21 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 477/752] PCI: Use resource_set_range() that correctly sets ->end Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 479/752] arm64: dts: qcom: sdm630: Add missing MDSS reset Sasha Levin
` (261 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Abel Vesa, stable, Dmitry Baryshkov, Bjorn Andersson, Vinod Koul,
Sasha Levin
From: Abel Vesa <abel.vesa@linaro.org>
[ Upstream commit 7d51b709262c5aa31d2b9cd31444112c1b2dae03 ]
On X Elite, the DP PHY needs another clock called ref, while all other
platforms do not.
The current X Elite devices supported upstream work fine without this
clock, because the boot firmware leaves this clock enabled. But we should
not rely on that. Also, even though this change breaks the ABI, it is
needed in order to make the driver disables this clock along with the
other ones, for a proper bring-down of the entire PHY.
So in order to handle these clocks on different platforms, make the driver
get all the clocks regardless of how many there are provided.
Cc: stable@vger.kernel.org # v6.10
Fixes: db83c107dc29 ("phy: qcom: edp: Add v6 specific ops and X1E80100 platform support")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://patch.msgid.link/20251224-phy-qcom-edp-add-missing-refclk-v5-2-3f45d349b5ac@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/qualcomm/phy-qcom-edp.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/phy/qualcomm/phy-qcom-edp.c b/drivers/phy/qualcomm/phy-qcom-edp.c
index f1b51018683d5..06a08c9ea0f70 100644
--- a/drivers/phy/qualcomm/phy-qcom-edp.c
+++ b/drivers/phy/qualcomm/phy-qcom-edp.c
@@ -103,7 +103,9 @@ struct qcom_edp {
struct phy_configure_opts_dp dp_opts;
- struct clk_bulk_data clks[2];
+ struct clk_bulk_data *clks;
+ int num_clks;
+
struct regulator_bulk_data supplies[2];
bool is_edp;
@@ -218,7 +220,7 @@ static int qcom_edp_phy_init(struct phy *phy)
if (ret)
return ret;
- ret = clk_bulk_prepare_enable(ARRAY_SIZE(edp->clks), edp->clks);
+ ret = clk_bulk_prepare_enable(edp->num_clks, edp->clks);
if (ret)
goto out_disable_supplies;
@@ -885,7 +887,7 @@ static int qcom_edp_phy_exit(struct phy *phy)
{
struct qcom_edp *edp = phy_get_drvdata(phy);
- clk_bulk_disable_unprepare(ARRAY_SIZE(edp->clks), edp->clks);
+ clk_bulk_disable_unprepare(edp->num_clks, edp->clks);
regulator_bulk_disable(ARRAY_SIZE(edp->supplies), edp->supplies);
return 0;
@@ -1092,11 +1094,9 @@ static int qcom_edp_phy_probe(struct platform_device *pdev)
if (IS_ERR(edp->pll))
return PTR_ERR(edp->pll);
- edp->clks[0].id = "aux";
- edp->clks[1].id = "cfg_ahb";
- ret = devm_clk_bulk_get(dev, ARRAY_SIZE(edp->clks), edp->clks);
- if (ret)
- return ret;
+ edp->num_clks = devm_clk_bulk_get_all(dev, &edp->clks);
+ if (edp->num_clks < 0)
+ return dev_err_probe(dev, edp->num_clks, "failed to get clocks\n");
edp->supplies[0].supply = "vdda-phy";
edp->supplies[1].supply = "vdda-pll";
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 479/752] arm64: dts: qcom: sdm630: Add missing MDSS reset
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (22 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 478/752] phy: qcom: edp: Make the number of clocks flexible Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 480/752] dm-verity: correctly handle dm_bufio_client_create() failure Sasha Levin
` (260 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Alexey Minnekhanov, stable, Dmitry Baryshkov, Bjorn Andersson,
Sasha Levin
From: Alexey Minnekhanov <alexeymin@postmarketos.org>
[ Upstream commit 0c1d1591f898d54eaa4c8f2a1535ab21bf4e42e4 ]
If the OS does not support recovering the state left by the
bootloader it needs a way to reset display hardware, so that it can
start from a clean state. Add a reference to the relevant reset.
It fixes display init issue appeared in Linux v6.17: without reset
device boots into black screen and you need to turn display off/on
to "fix" it. Also sometimes it can boot into solid blue color
with these messages in kernel log:
hw recovery is not complete for ctl:2
[drm:dpu_encoder_phys_vid_prepare_for_kickoff:569] [dpu error]enc33
intf1 ctl 2 reset failure: -22
[drm:dpu_encoder_frame_done_timeout:2727] [dpu error]enc33 frame
done timeout
Fixes: 0e789b491ba0 ("pmdomain: core: Leave powered-on genpds on until sync_state")
Cc: stable@vger.kernel.org # 6.17
Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251116-sdm660-mdss-reset-v2-3-6219bec0a97f@postmarketos.org
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sdm630.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm630.dtsi b/arch/arm64/boot/dts/qcom/sdm630.dtsi
index b383e480a394d..876a6871745cf 100644
--- a/arch/arm64/boot/dts/qcom/sdm630.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm630.dtsi
@@ -1563,6 +1563,7 @@ mdss: display-subsystem@c900000 {
reg-names = "mdss_phys", "vbif_phys";
power-domains = <&mmcc MDSS_GDSC>;
+ resets = <&mmcc MDSS_BCR>;
clocks = <&mmcc MDSS_AHB_CLK>,
<&mmcc MDSS_AXI_CLK>,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 480/752] dm-verity: correctly handle dm_bufio_client_create() failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (23 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 479/752] arm64: dts: qcom: sdm630: Add missing MDSS reset Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 481/752] media: uvcvideo: Fix support for V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX Sasha Levin
` (259 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Eric Biggers, stable, Sami Tolvanen, Mikulas Patocka, Sasha Levin
From: Eric Biggers <ebiggers@kernel.org>
[ Upstream commit 119f4f04186fa4f33ee6bd39af145cdaff1ff17f ]
If either of the calls to dm_bufio_client_create() in verity_fec_ctr()
fails, then dm_bufio_client_destroy() is later called with an ERR_PTR()
argument. That causes a crash. Fix this.
Fixes: a739ff3f543a ("dm verity: add support for forward error correction")
Cc: stable@vger.kernel.org
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-verity-fec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/md/dm-verity-fec.c b/drivers/md/dm-verity-fec.c
index e41bde1d3b15b..5365b3987374a 100644
--- a/drivers/md/dm-verity-fec.c
+++ b/drivers/md/dm-verity-fec.c
@@ -533,9 +533,9 @@ void verity_fec_dtr(struct dm_verity *v)
mempool_exit(&f->output_pool);
kmem_cache_destroy(f->cache);
- if (f->data_bufio)
+ if (!IS_ERR_OR_NULL(f->data_bufio))
dm_bufio_client_destroy(f->data_bufio);
- if (f->bufio)
+ if (!IS_ERR_OR_NULL(f->bufio))
dm_bufio_client_destroy(f->bufio);
if (f->dev)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 481/752] media: uvcvideo: Fix support for V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (24 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 480/752] dm-verity: correctly handle dm_bufio_client_create() failure Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 482/752] media: mediatek: encoder: Fix uninitialized scalar variable issue Sasha Levin
` (258 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Ricardo Ribalda, stable, Hans de Goede, Hans Verkuil, Sasha Levin
From: Ricardo Ribalda <ribalda@chromium.org>
[ Upstream commit 4238bd6dc6ba36f44d89a60338223d5a4f708cbf ]
The VIDIOC_G_EXT_CTRLS with which V4L2_CTRL_WHICH_(MIN|MAX)_VAL can only
work for controls that have previously announced support for it.
This patch fixes the following v4l2-compliance error:
info: checking extended control 'User Controls' (0x00980001)
fail: v4l2-test-controls.cpp(980): ret != EINVAL (got 13)
test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL
Fixes: 39d2c891c96e ("media: uvcvideo: support V4L2_CTRL_WHICH_MIN/MAX_VAL")
Cc: stable@vger.kernel.org
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/uvc/uvc_ctrl.c | 14 ++++++++++++--
drivers/media/usb/uvc/uvc_v4l2.c | 10 ++++++----
drivers/media/usb/uvc/uvcvideo.h | 2 +-
3 files changed, 19 insertions(+), 7 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_ctrl.c b/drivers/media/usb/uvc/uvc_ctrl.c
index 2905505c240c0..2738ef74c7373 100644
--- a/drivers/media/usb/uvc/uvc_ctrl.c
+++ b/drivers/media/usb/uvc/uvc_ctrl.c
@@ -1432,7 +1432,7 @@ static bool uvc_ctrl_is_readable(u32 which, struct uvc_control *ctrl,
* auto_exposure=1, exposure_time_absolute=251.
*/
int uvc_ctrl_is_accessible(struct uvc_video_chain *chain, u32 v4l2_id,
- const struct v4l2_ext_controls *ctrls,
+ const struct v4l2_ext_controls *ctrls, u32 which,
unsigned long ioctl)
{
struct uvc_control_mapping *master_map = NULL;
@@ -1442,14 +1442,24 @@ int uvc_ctrl_is_accessible(struct uvc_video_chain *chain, u32 v4l2_id,
s32 val;
int ret;
int i;
+ /*
+ * There is no need to check the ioctl, all the ioctls except
+ * VIDIOC_G_EXT_CTRLS use which=V4L2_CTRL_WHICH_CUR_VAL.
+ */
+ bool is_which_min_max = which == V4L2_CTRL_WHICH_MIN_VAL ||
+ which == V4L2_CTRL_WHICH_MAX_VAL;
if (__uvc_query_v4l2_class(chain, v4l2_id, 0) >= 0)
- return -EACCES;
+ return is_which_min_max ? -EINVAL : -EACCES;
ctrl = uvc_find_control(chain, v4l2_id, &mapping);
if (!ctrl)
return -EINVAL;
+ if ((!(ctrl->info.flags & UVC_CTRL_FLAG_GET_MIN) ||
+ !(ctrl->info.flags & UVC_CTRL_FLAG_GET_MAX)) && is_which_min_max)
+ return -EINVAL;
+
if (ioctl == VIDIOC_G_EXT_CTRLS)
return uvc_ctrl_is_readable(ctrls->which, ctrl, mapping);
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 9e4a251eca880..30c160daed8cb 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -765,14 +765,15 @@ static int uvc_ioctl_query_ext_ctrl(struct file *file, void *priv,
static int uvc_ctrl_check_access(struct uvc_video_chain *chain,
struct v4l2_ext_controls *ctrls,
- unsigned long ioctl)
+ u32 which, unsigned long ioctl)
{
struct v4l2_ext_control *ctrl = ctrls->controls;
unsigned int i;
int ret = 0;
for (i = 0; i < ctrls->count; ++ctrl, ++i) {
- ret = uvc_ctrl_is_accessible(chain, ctrl->id, ctrls, ioctl);
+ ret = uvc_ctrl_is_accessible(chain, ctrl->id, ctrls, which,
+ ioctl);
if (ret)
break;
}
@@ -806,7 +807,7 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file, void *priv,
which = V4L2_CTRL_WHICH_CUR_VAL;
}
- ret = uvc_ctrl_check_access(chain, ctrls, VIDIOC_G_EXT_CTRLS);
+ ret = uvc_ctrl_check_access(chain, ctrls, which, VIDIOC_G_EXT_CTRLS);
if (ret < 0)
return ret;
@@ -840,7 +841,8 @@ static int uvc_ioctl_s_try_ext_ctrls(struct uvc_fh *handle,
if (!ctrls->count)
return 0;
- ret = uvc_ctrl_check_access(chain, ctrls, ioctl);
+ ret = uvc_ctrl_check_access(chain, ctrls, V4L2_CTRL_WHICH_CUR_VAL,
+ ioctl);
if (ret < 0)
return ret;
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index 3f2e832025e71..8480d65ecb85e 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -787,7 +787,7 @@ int uvc_ctrl_get(struct uvc_video_chain *chain, u32 which,
struct v4l2_ext_control *xctrl);
int uvc_ctrl_set(struct uvc_fh *handle, struct v4l2_ext_control *xctrl);
int uvc_ctrl_is_accessible(struct uvc_video_chain *chain, u32 v4l2_id,
- const struct v4l2_ext_controls *ctrls,
+ const struct v4l2_ext_controls *ctrls, u32 which,
unsigned long ioctl);
int uvc_xu_ctrl_query(struct uvc_video_chain *chain,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 482/752] media: mediatek: encoder: Fix uninitialized scalar variable issue
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (25 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 481/752] media: uvcvideo: Fix support for V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 483/752] media: mtk-mdp: Fix error handling in probe function Sasha Levin
` (257 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Irui Wang, stable, AngeloGioacchino Del Regno, Nicolas Dufresne,
Hans Verkuil, Sasha Levin
From: Irui Wang <irui.wang@mediatek.com>
[ Upstream commit 88e935de7cf8795d7a6a51385db87ecb361a7050 ]
UNINIT checker finds some instances of variables that are used
without being initialized, for example using the uninitialized
value enc_result.is_key_frm can result in unpredictable behavior,
so initialize these variables after declaring.
Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c
index d815e962ab898..0212ff0462fcc 100644
--- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c
+++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c
@@ -864,7 +864,7 @@ static void vb2ops_venc_buf_queue(struct vb2_buffer *vb)
static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count)
{
struct mtk_vcodec_enc_ctx *ctx = vb2_get_drv_priv(q);
- struct venc_enc_param param;
+ struct venc_enc_param param = { };
int ret;
int i;
@@ -1018,7 +1018,7 @@ static int mtk_venc_encode_header(void *priv)
int ret;
struct vb2_v4l2_buffer *src_buf, *dst_buf;
struct mtk_vcodec_mem bs_buf;
- struct venc_done_result enc_result;
+ struct venc_done_result enc_result = { };
dst_buf = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx);
if (!dst_buf) {
@@ -1139,7 +1139,7 @@ static void mtk_venc_worker(struct work_struct *work)
struct vb2_v4l2_buffer *src_buf, *dst_buf;
struct venc_frm_buf frm_buf;
struct mtk_vcodec_mem bs_buf;
- struct venc_done_result enc_result;
+ struct venc_done_result enc_result = { };
int ret, i;
/* check dst_buf, dst_buf may be removed in device_run
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 483/752] media: mtk-mdp: Fix error handling in probe function
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (26 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 482/752] media: mediatek: encoder: Fix uninitialized scalar variable issue Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 484/752] media: mtk-mdp: Fix a reference leak bug in mtk_mdp_remove() Sasha Levin
` (256 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Nicolas Dufresne, Hans Verkuil, Sasha Levin
From: Haoxiang Li <haoxiang_li2024@163.com>
[ Upstream commit 8a8a3232abac5b972058a5f2cb3e33199d2a8648 ]
Add mtk_mdp_unregister_m2m_device() on the error handling path to prevent
resource leak.
Add check for the return value of vpu_get_plat_device() to prevent null
pointer dereference. And vpu_get_plat_device() increases the reference
count of the returned platform device. Add platform_device_put() to
prevent reference leak.
Fixes: c8eb2d7e8202 ("[media] media: Add Mediatek MDP Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../media/platform/mediatek/mdp/mtk_mdp_core.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
index 80fdc6ff57e0e..f78fa30f18648 100644
--- a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
+++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
@@ -194,11 +194,17 @@ static int mtk_mdp_probe(struct platform_device *pdev)
}
mdp->vpu_dev = vpu_get_plat_device(pdev);
+ if (!mdp->vpu_dev) {
+ dev_err(&pdev->dev, "Failed to get vpu device\n");
+ ret = -ENODEV;
+ goto err_vpu_get_dev;
+ }
+
ret = vpu_wdt_reg_handler(mdp->vpu_dev, mtk_mdp_reset_handler, mdp,
VPU_RST_MDP);
if (ret) {
dev_err(&pdev->dev, "Failed to register reset handler\n");
- goto err_m2m_register;
+ goto err_reg_handler;
}
platform_set_drvdata(pdev, mdp);
@@ -206,7 +212,7 @@ static int mtk_mdp_probe(struct platform_device *pdev)
ret = vb2_dma_contig_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32));
if (ret) {
dev_err(&pdev->dev, "Failed to set vb2 dma mag seg size\n");
- goto err_m2m_register;
+ goto err_reg_handler;
}
pm_runtime_enable(dev);
@@ -214,6 +220,12 @@ static int mtk_mdp_probe(struct platform_device *pdev)
return 0;
+err_reg_handler:
+ platform_device_put(mdp->vpu_dev);
+
+err_vpu_get_dev:
+ mtk_mdp_unregister_m2m_device(mdp);
+
err_m2m_register:
v4l2_device_unregister(&mdp->v4l2_dev);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 484/752] media: mtk-mdp: Fix a reference leak bug in mtk_mdp_remove()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (27 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 483/752] media: mtk-mdp: Fix error handling in probe function Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 485/752] media: chips-media: wave5: Fix PM runtime usage count underflow Sasha Levin
` (255 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Nicolas Dufresne, Hans Verkuil, Sasha Levin
From: Haoxiang Li <haoxiang_li2024@163.com>
[ Upstream commit f128bab57b8018e526b7eda854ca20069863af47 ]
In mtk_mdp_probe(), vpu_get_plat_device() increases the reference
count of the returned platform device. Add platform_device_put()
to prevent reference leak.
Fixes: c8eb2d7e8202 ("[media] media: Add Mediatek MDP Driver")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/mediatek/mdp/mtk_mdp_core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
index f78fa30f18648..8432833814f31 100644
--- a/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
+++ b/drivers/media/platform/mediatek/mdp/mtk_mdp_core.c
@@ -254,6 +254,7 @@ static void mtk_mdp_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
vb2_dma_contig_clear_max_seg_size(&pdev->dev);
+ platform_device_put(mdp->vpu_dev);
mtk_mdp_unregister_m2m_device(mdp);
v4l2_device_unregister(&mdp->v4l2_dev);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 485/752] media: chips-media: wave5: Fix PM runtime usage count underflow
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (28 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 484/752] media: mtk-mdp: Fix a reference leak bug in mtk_mdp_remove() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 486/752] media: chips-media: wave5: Fix kthread worker destruction in polling mode Sasha Levin
` (254 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Xulin Sun, stable, Nicolas Dufresne, Hans Verkuil, Sasha Levin
From: Xulin Sun <xulin.sun@windriver.com>
[ Upstream commit 9cf4452e824c1e2d41c9c0b13cc8a32a0a7dec38 ]
Replace pm_runtime_put_sync() with pm_runtime_dont_use_autosuspend() in
the remove path to properly pair with pm_runtime_use_autosuspend() from
probe. This allows pm_runtime_disable() to handle reference count cleanup
correctly regardless of current suspend state.
The driver calls pm_runtime_put_sync() unconditionally in remove, but the
device may already be suspended due to autosuspend configured in probe.
When autosuspend has already suspended the device, the usage count is 0,
and pm_runtime_put_sync() decrements it to -1.
This causes the following warning on module unload:
------------[ cut here ]------------
WARNING: CPU: 1 PID: 963 at kernel/kthread.c:1430
kthread_destroy_worker+0x84/0x98
...
vdec 30210000.video-codec: Runtime PM usage count underflow!
Fixes: 9707a6254a8a ("media: chips-media: wave5: Add the v4l2 layer")
Cc: stable@vger.kernel.org
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/chips-media/wave5/wave5-vpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index e1715d3f43b0d..23aa3ab51a0ef 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -356,7 +356,7 @@ static void wave5_vpu_remove(struct platform_device *pdev)
hrtimer_cancel(&dev->hrtimer);
}
- pm_runtime_put_sync(&pdev->dev);
+ pm_runtime_dont_use_autosuspend(&pdev->dev);
pm_runtime_disable(&pdev->dev);
mutex_destroy(&dev->dev_lock);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 486/752] media: chips-media: wave5: Fix kthread worker destruction in polling mode
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (29 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 485/752] media: chips-media: wave5: Fix PM runtime usage count underflow Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 487/752] media: chips-media: wave5: Fix device cleanup order to prevent kernel panic Sasha Levin
` (253 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Xulin Sun, stable, Nicolas Dufresne, Hans Verkuil, Sasha Levin
From: Xulin Sun <xulin.sun@windriver.com>
[ Upstream commit 5a0c122e834b2f7f029526422c71be922960bf03 ]
Fix the cleanup order in polling mode (irq < 0) to prevent kernel warnings
during module removal. Cancel the hrtimer before destroying the kthread
worker to ensure work queues are empty.
In polling mode, the driver uses hrtimer to periodically trigger
wave5_vpu_timer_callback() which queues work via kthread_queue_work().
The kthread_destroy_worker() function validates that both work queues
are empty with WARN_ON(!list_empty(&worker->work_list)) and
WARN_ON(!list_empty(&worker->delayed_work_list)).
The original code called kthread_destroy_worker() before hrtimer_cancel(),
creating a race condition where the timer could fire during worker
destruction and queue new work, triggering the WARN_ON.
This causes the following warning on every module unload in polling mode:
------------[ cut here ]------------
WARNING: CPU: 2 PID: 1034 at kernel/kthread.c:1430
kthread_destroy_worker+0x84/0x98
Modules linked in: wave5(-) rpmsg_ctrl rpmsg_char ...
Call trace:
kthread_destroy_worker+0x84/0x98
wave5_vpu_remove+0xc8/0xe0 [wave5]
platform_remove+0x30/0x58
...
---[ end trace 0000000000000000 ]---
Fixes: ed7276ed2fd0 ("media: chips-media: wave5: Add hrtimer based polling support")
Cc: stable@vger.kernel.org
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/chips-media/wave5/wave5-vpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 23aa3ab51a0ef..0bcd48df49d0f 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -352,8 +352,9 @@ static void wave5_vpu_remove(struct platform_device *pdev)
struct vpu_device *dev = dev_get_drvdata(&pdev->dev);
if (dev->irq < 0) {
- kthread_destroy_worker(dev->worker);
hrtimer_cancel(&dev->hrtimer);
+ kthread_cancel_work_sync(&dev->work);
+ kthread_destroy_worker(dev->worker);
}
pm_runtime_dont_use_autosuspend(&pdev->dev);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 487/752] media: chips-media: wave5: Fix device cleanup order to prevent kernel panic
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (30 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 486/752] media: chips-media: wave5: Fix kthread worker destruction in polling mode Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 488/752] media: chips-media: wave5: Fix SError of kernel panic when closed Sasha Levin
` (252 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Xulin Sun, stable, Nicolas Dufresne, Hans Verkuil, Sasha Levin
From: Xulin Sun <xulin.sun@windriver.com>
[ Upstream commit b74cedac643b02aefa7da881b58a3792859d9748 ]
Move video device unregistration to the beginning of the remove function
to ensure all video operations are stopped before cleaning up the worker
thread and disabling PM runtime. This prevents hardware register access
after the device has been powered down.
In polling mode, the hrtimer periodically triggers
wave5_vpu_timer_callback() which queues work to the kthread worker.
The worker executes wave5_vpu_irq_work_fn() which reads hardware
registers via wave5_vdi_read_register().
The original cleanup order disabled PM runtime and powered down hardware
before unregistering video devices. When autosuspend triggers and powers
off the hardware, the video devices are still registered and the worker
thread can still be triggered by the hrtimer, causing it to attempt
reading registers from powered-off hardware. This results in a bus error
(synchronous external abort) and kernel panic.
This causes random kernel panics during encoding operations:
Internal error: synchronous external abort: 0000000096000010
[#1] PREEMPT SMP
Modules linked in: wave5 rpmsg_ctrl rpmsg_char ...
CPU: 0 UID: 0 PID: 1520 Comm: vpu_irq_thread
Tainted: G M W
pc : wave5_vdi_read_register+0x10/0x38 [wave5]
lr : wave5_vpu_irq_work_fn+0x28/0x60 [wave5]
Call trace:
wave5_vdi_read_register+0x10/0x38 [wave5]
kthread_worker_fn+0xd8/0x238
kthread+0x104/0x120
ret_from_fork+0x10/0x20
Code: aa1e03e9 d503201f f9416800 8b214000 (b9400000)
---[ end trace 0000000000000000 ]---
Kernel panic - not syncing: synchronous external abort:
Fatal exception
Fixes: 9707a6254a8a ("media: chips-media: wave5: Add the v4l2 layer")
Cc: stable@vger.kernel.org
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/chips-media/wave5/wave5-vpu.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 0bcd48df49d0f..77d6c934d0b9d 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -351,6 +351,10 @@ static void wave5_vpu_remove(struct platform_device *pdev)
{
struct vpu_device *dev = dev_get_drvdata(&pdev->dev);
+ wave5_vpu_enc_unregister_device(dev);
+ wave5_vpu_dec_unregister_device(dev);
+ v4l2_device_unregister(&dev->v4l2_dev);
+
if (dev->irq < 0) {
hrtimer_cancel(&dev->hrtimer);
kthread_cancel_work_sync(&dev->work);
@@ -364,9 +368,6 @@ static void wave5_vpu_remove(struct platform_device *pdev)
mutex_destroy(&dev->hw_lock);
reset_control_assert(dev->resets);
clk_bulk_disable_unprepare(dev->num_clks, dev->clks);
- wave5_vpu_enc_unregister_device(dev);
- wave5_vpu_dec_unregister_device(dev);
- v4l2_device_unregister(&dev->v4l2_dev);
wave5_vdi_release(&pdev->dev);
ida_destroy(&dev->inst_ida);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 488/752] media: chips-media: wave5: Fix SError of kernel panic when closed
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (31 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 487/752] media: chips-media: wave5: Fix device cleanup order to prevent kernel panic Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 489/752] media: chips-media: wave5: Fix Null reference while testing fluster Sasha Levin
` (251 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Jackson Lee, stable, Nas Chung, Nicolas Dufresne, Brandon Brnich,
Hans Verkuil, Sasha Levin
From: Jackson Lee <jackson.lee@chipsnmedia.com>
[ Upstream commit cbb9c0d50e471483cced55f5b7db4569dcd959a6 ]
SError of kernel panic rarely happened while testing fluster.
The root cause was to enter suspend mode because timeout of autosuspend
delay happened.
[ 48.834439] SError Interrupt on CPU0, code 0x00000000bf000000 -- SError
[ 48.834455] CPU: 0 UID: 0 PID: 1067 Comm: v4l2h265dec0:sr Not tainted 6.12.9-gc9e21a1ebd75-dirty #7
[ 48.834461] Hardware name: ti Texas Instruments J721S2 EVM/Texas Instruments J721S2 EVM, BIOS 2025.01-00345-gbaf3aaa8ecfa 01/01/2025
[ 48.834464] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 48.834468] pc : wave5_dec_clr_disp_flag+0x40/0x80 [wave5]
[ 48.834488] lr : wave5_dec_clr_disp_flag+0x40/0x80 [wave5]
[ 48.834495] sp : ffff8000856e3a30
[ 48.834497] x29: ffff8000856e3a30 x28: ffff0008093f6010 x27: ffff000809158130
[ 48.834504] x26: 0000000000000000 x25: ffff00080b625000 x24: ffff000804a9ba80
[ 48.834509] x23: ffff000802343028 x22: ffff000809158150 x21: ffff000802218000
[ 48.834513] x20: ffff0008093f6000 x19: ffff0008093f6000 x18: 0000000000000000
[ 48.834518] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffff74009618
[ 48.834523] x14: 000000010000000c x13: 0000000000000000 x12: 0000000000000000
[ 48.834527] x11: ffffffffffffffff x10: ffffffffffffffff x9 : ffff000802343028
[ 48.834532] x8 : ffff00080b6252a0 x7 : 0000000000000038 x6 : 0000000000000000
[ 48.834536] x5 : ffff00080b625060 x4 : 0000000000000000 x3 : 0000000000000000
[ 48.834541] x2 : 0000000000000000 x1 : ffff800084bf0118 x0 : ffff800084bf0000
[ 48.834547] Kernel panic - not syncing: Asynchronous SError Interrupt
[ 48.834549] CPU: 0 UID: 0 PID: 1067 Comm: v4l2h265dec0:sr Not tainted 6.12.9-gc9e21a1ebd75-dirty #7
[ 48.834554] Hardware name: ti Texas Instruments J721S2 EVM/Texas Instruments J721S2 EVM, BIOS 2025.01-00345-gbaf3aaa8ecfa 01/01/2025
[ 48.834556] Call trace:
[ 48.834559] dump_backtrace+0x94/0xec
[ 48.834574] show_stack+0x18/0x24
[ 48.834579] dump_stack_lvl+0x38/0x90
[ 48.834585] dump_stack+0x18/0x24
[ 48.834588] panic+0x35c/0x3e0
[ 48.834592] nmi_panic+0x40/0x8c
[ 48.834595] arm64_serror_panic+0x64/0x70
[ 48.834598] do_serror+0x3c/0x78
[ 48.834601] el1h_64_error_handler+0x34/0x4c
[ 48.834605] el1h_64_error+0x64/0x68
[ 48.834608] wave5_dec_clr_disp_flag+0x40/0x80 [wave5]
[ 48.834615] wave5_vpu_dec_clr_disp_flag+0x54/0x80 [wave5]
[ 48.834622] wave5_vpu_dec_buf_queue+0x19c/0x1a0 [wave5]
[ 48.834628] __enqueue_in_driver+0x3c/0x74 [videobuf2_common]
[ 48.834639] vb2_core_qbuf+0x508/0x61c [videobuf2_common]
[ 48.834646] vb2_qbuf+0xa4/0x168 [videobuf2_v4l2]
[ 48.834656] v4l2_m2m_qbuf+0x80/0x238 [v4l2_mem2mem]
[ 48.834666] v4l2_m2m_ioctl_qbuf+0x18/0x24 [v4l2_mem2mem]
[ 48.834673] v4l_qbuf+0x48/0x5c [videodev]
[ 48.834704] __video_do_ioctl+0x180/0x3f0 [videodev]
[ 48.834725] video_usercopy+0x2ec/0x68c [videodev]
[ 48.834745] video_ioctl2+0x18/0x24 [videodev]
[ 48.834766] v4l2_ioctl+0x40/0x60 [videodev]
[ 48.834786] __arm64_sys_ioctl+0xa8/0xec
[ 48.834793] invoke_syscall+0x44/0x100
[ 48.834800] el0_svc_common.constprop.0+0xc0/0xe0
[ 48.834804] do_el0_svc+0x1c/0x28
[ 48.834809] el0_svc+0x30/0xd0
[ 48.834813] el0t_64_sync_handler+0xc0/0xc4
[ 48.834816] el0t_64_sync+0x190/0x194
[ 48.834820] SMP: stopping secondary CPUs
[ 48.834831] Kernel Offset: disabled
[ 48.834833] CPU features: 0x08,00002002,80200000,4200421b
[ 48.834837] Memory Limit: none
[ 49.161404] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
Fixes: 2092b3833487 ("media: chips-media: wave5: Support runtime suspend/resume")
Cc: stable@vger.kernel.org
Signed-off-by: Jackson Lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Tested-by: Brandon Brnich <b-brnich@ti.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../platform/chips-media/wave5/wave5-vpu-dec.c | 5 ++---
.../platform/chips-media/wave5/wave5-vpu-enc.c | 3 ---
.../media/platform/chips-media/wave5/wave5-vpu.c | 2 +-
.../platform/chips-media/wave5/wave5-vpuapi.c | 15 ---------------
4 files changed, 3 insertions(+), 22 deletions(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
index a4387ed58cac3..a90f00f589e04 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
@@ -1243,6 +1243,7 @@ static void wave5_vpu_dec_buf_queue_dst(struct vb2_buffer *vb)
struct vpu_instance *inst = vb2_get_drv_priv(vb->vb2_queue);
struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx;
+ pm_runtime_resume_and_get(inst->dev->dev);
vbuf->sequence = inst->queued_dst_buf_num++;
if (inst->state == VPU_INST_STATE_PIC_RUN) {
@@ -1275,6 +1276,7 @@ static void wave5_vpu_dec_buf_queue_dst(struct vb2_buffer *vb)
} else {
v4l2_m2m_buf_queue(m2m_ctx, vbuf);
}
+ pm_runtime_put_autosuspend(inst->dev->dev);
}
static void wave5_vpu_dec_buf_queue(struct vb2_buffer *vb)
@@ -1827,9 +1829,6 @@ static int wave5_vpu_open_dec(struct file *filp)
if (ret)
goto cleanup_inst;
- if (list_empty(&dev->instances))
- pm_runtime_use_autosuspend(inst->dev->dev);
-
list_add_tail(&inst->list, &dev->instances);
mutex_unlock(&dev->dev_lock);
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
index a254830e4009e..5388efa63f73d 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
@@ -1773,9 +1773,6 @@ static int wave5_vpu_open_enc(struct file *filp)
if (ret)
goto cleanup_inst;
- if (list_empty(&dev->instances))
- pm_runtime_use_autosuspend(inst->dev->dev);
-
list_add_tail(&inst->list, &dev->instances);
mutex_unlock(&dev->dev_lock);
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 77d6c934d0b9d..0026f58403620 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -322,7 +322,7 @@ static int wave5_vpu_probe(struct platform_device *pdev)
dev_info(&pdev->dev, "Product Code: 0x%x\n", dev->product_code);
dev_info(&pdev->dev, "Firmware Revision: %u\n", fw_revision);
- pm_runtime_set_autosuspend_delay(&pdev->dev, 100);
+ pm_runtime_set_autosuspend_delay(&pdev->dev, 500);
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_enable(&pdev->dev);
wave5_vpu_sleep_wake(&pdev->dev, true, NULL, 0);
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
index e5e879a13e8b8..e94d6ebc9f816 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
@@ -207,8 +207,6 @@ int wave5_vpu_dec_close(struct vpu_instance *inst, u32 *fail_res)
int retry = 0;
struct vpu_device *vpu_dev = inst->dev;
int i;
- int inst_count = 0;
- struct vpu_instance *inst_elm;
*fail_res = 0;
if (!inst->codec_info)
@@ -250,11 +248,6 @@ int wave5_vpu_dec_close(struct vpu_instance *inst, u32 *fail_res)
wave5_vdi_free_dma_memory(vpu_dev, &p_dec_info->vb_task);
- list_for_each_entry(inst_elm, &vpu_dev->instances, list)
- inst_count++;
- if (inst_count == 1)
- pm_runtime_dont_use_autosuspend(vpu_dev->dev);
-
unlock_and_return:
mutex_unlock(&vpu_dev->hw_lock);
pm_runtime_put_sync(inst->dev->dev);
@@ -720,8 +713,6 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
int ret;
int retry = 0;
struct vpu_device *vpu_dev = inst->dev;
- int inst_count = 0;
- struct vpu_instance *inst_elm;
*fail_res = 0;
if (!inst->codec_info)
@@ -764,12 +755,6 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
}
wave5_vdi_free_dma_memory(vpu_dev, &p_enc_info->vb_task);
-
- list_for_each_entry(inst_elm, &vpu_dev->instances, list)
- inst_count++;
- if (inst_count == 1)
- pm_runtime_dont_use_autosuspend(vpu_dev->dev);
-
mutex_unlock(&vpu_dev->hw_lock);
pm_runtime_put_sync(inst->dev->dev);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 489/752] media: chips-media: wave5: Fix Null reference while testing fluster
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (32 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 488/752] media: chips-media: wave5: Fix SError of kernel panic when closed Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 490/752] media: verisilicon: AV1: Fix enable cdef computation Sasha Levin
` (250 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Jackson Lee, stable, Nas Chung, Brandon Brnich, Nicolas Dufresne,
Hans Verkuil, Sasha Levin
From: Jackson Lee <jackson.lee@chipsnmedia.com>
[ Upstream commit e66ff2b08e4ee1c4d3b84f24818e5bcc178cc3a4 ]
When multi instances are created/destroyed, many interrupts happens
and structures for decoder are removed.
"struct vpu_instance" this structure is shared for all flow in the decoder,
so if the structure is not protected by lock, Null dereference
could happens sometimes.
IRQ Handler was spilt to two phases and Lock was added as well.
Fixes: 9707a6254a8a ("media: chips-media: wave5: Add the v4l2 layer")
Cc: stable@vger.kernel.org
Signed-off-by: Jackson Lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Tested-by: Brandon Brnich <b-brnich@ti.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../platform/chips-media/wave5/wave5-helper.c | 28 +++++-
.../platform/chips-media/wave5/wave5-helper.h | 1 +
.../chips-media/wave5/wave5-vpu-dec.c | 5 +
.../chips-media/wave5/wave5-vpu-enc.c | 5 +
.../platform/chips-media/wave5/wave5-vpu.c | 97 +++++++++++++++++--
.../platform/chips-media/wave5/wave5-vpuapi.h | 6 ++
6 files changed, 131 insertions(+), 11 deletions(-)
diff --git a/drivers/media/platform/chips-media/wave5/wave5-helper.c b/drivers/media/platform/chips-media/wave5/wave5-helper.c
index f03ad9c0de221..53a0ac068c2e2 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-helper.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-helper.c
@@ -27,6 +27,11 @@ const char *state_to_str(enum vpu_instance_state state)
}
}
+int wave5_kfifo_alloc(struct vpu_instance *inst)
+{
+ return kfifo_alloc(&inst->irq_status, 16 * sizeof(int), GFP_KERNEL);
+}
+
void wave5_cleanup_instance(struct vpu_instance *inst, struct file *filp)
{
int i;
@@ -49,7 +54,7 @@ void wave5_cleanup_instance(struct vpu_instance *inst, struct file *filp)
v4l2_fh_del(&inst->v4l2_fh, filp);
v4l2_fh_exit(&inst->v4l2_fh);
}
- list_del_init(&inst->list);
+ kfifo_free(&inst->irq_status);
ida_free(&inst->dev->inst_ida, inst->id);
kfree(inst->codec_info);
kfree(inst);
@@ -61,8 +66,29 @@ int wave5_vpu_release_device(struct file *filp,
{
struct vpu_instance *inst = file_to_vpu_inst(filp);
int ret = 0;
+ unsigned long flags;
v4l2_m2m_ctx_release(inst->v4l2_fh.m2m_ctx);
+ /*
+ * To prevent Null reference exception, the existing irq handler were
+ * separated to two modules.
+ * One is to queue interrupt reason into the irq handler,
+ * the other is irq_thread to call the wave5_vpu_dec_finish_decode
+ * to get decoded frame.
+ * The list of instances should be protected between all flow of the
+ * decoding process, but to protect the list in the irq_handler, spin lock
+ * should be used, and mutex should be used in the irq_thread because spin lock
+ * is not able to be used because mutex is already being used
+ * in the wave5_vpu_dec_finish_decode.
+ * So the spin lock and mutex were used to protect the list in the release function.
+ */
+ ret = mutex_lock_interruptible(&inst->dev->irq_lock);
+ if (ret)
+ return ret;
+ spin_lock_irqsave(&inst->dev->irq_spinlock, flags);
+ list_del_init(&inst->list);
+ spin_unlock_irqrestore(&inst->dev->irq_spinlock, flags);
+ mutex_unlock(&inst->dev->irq_lock);
if (inst->state != VPU_INST_STATE_NONE) {
u32 fail_res;
diff --git a/drivers/media/platform/chips-media/wave5/wave5-helper.h b/drivers/media/platform/chips-media/wave5/wave5-helper.h
index 976a402e426ff..d61fdbda359d6 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-helper.h
+++ b/drivers/media/platform/chips-media/wave5/wave5-helper.h
@@ -33,4 +33,5 @@ void wave5_update_pix_fmt(struct v4l2_pix_format_mplane *pix_mp,
unsigned int width,
unsigned int height,
const struct v4l2_frmsize_stepwise *frmsize);
+int wave5_kfifo_alloc(struct vpu_instance *inst);
#endif
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
index a90f00f589e04..cff2fa17c3f59 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
@@ -1810,6 +1810,11 @@ static int wave5_vpu_open_dec(struct file *filp)
inst->xfer_func = V4L2_XFER_FUNC_DEFAULT;
init_completion(&inst->irq_done);
+ ret = wave5_kfifo_alloc(inst);
+ if (ret) {
+ dev_err(inst->dev->dev, "failed to allocate fifo\n");
+ goto cleanup_inst;
+ }
inst->id = ida_alloc(&inst->dev->inst_ida, GFP_KERNEL);
if (inst->id < 0) {
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
index 5388efa63f73d..24fc0d0d3f4aa 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
@@ -1759,6 +1759,11 @@ static int wave5_vpu_open_enc(struct file *filp)
inst->frame_rate = 30;
init_completion(&inst->irq_done);
+ ret = wave5_kfifo_alloc(inst);
+ if (ret) {
+ dev_err(inst->dev->dev, "failed to allocate fifo\n");
+ goto cleanup_inst;
+ }
inst->id = ida_alloc(&inst->dev->inst_ida, GFP_KERNEL);
if (inst->id < 0) {
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
index 0026f58403620..3216b49976447 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
@@ -51,8 +51,11 @@ static void wave5_vpu_handle_irq(void *dev_id)
u32 seq_done;
u32 cmd_done;
u32 irq_reason;
- struct vpu_instance *inst;
+ u32 irq_subreason;
+ struct vpu_instance *inst, *tmp;
struct vpu_device *dev = dev_id;
+ int val;
+ unsigned long flags;
irq_reason = wave5_vdi_read_register(dev, W5_VPU_VINT_REASON);
seq_done = wave5_vdi_read_register(dev, W5_RET_SEQ_DONE_INSTANCE_INFO);
@@ -60,7 +63,8 @@ static void wave5_vpu_handle_irq(void *dev_id)
wave5_vdi_write_register(dev, W5_VPU_VINT_REASON_CLR, irq_reason);
wave5_vdi_write_register(dev, W5_VPU_VINT_CLEAR, 0x1);
- list_for_each_entry(inst, &dev->instances, list) {
+ spin_lock_irqsave(&dev->irq_spinlock, flags);
+ list_for_each_entry_safe(inst, tmp, &dev->instances, list) {
if (irq_reason & BIT(INT_WAVE5_INIT_SEQ) ||
irq_reason & BIT(INT_WAVE5_ENC_SET_PARAM)) {
@@ -82,22 +86,54 @@ static void wave5_vpu_handle_irq(void *dev_id)
irq_reason & BIT(INT_WAVE5_ENC_PIC)) {
if (cmd_done & BIT(inst->id)) {
cmd_done &= ~BIT(inst->id);
- wave5_vdi_write_register(dev, W5_RET_QUEUE_CMD_DONE_INST,
- cmd_done);
- inst->ops->finish_process(inst);
+ if (dev->irq >= 0) {
+ irq_subreason =
+ wave5_vdi_read_register(dev, W5_VPU_VINT_REASON);
+ if (!(irq_subreason & BIT(INT_WAVE5_DEC_PIC)))
+ wave5_vdi_write_register(dev,
+ W5_RET_QUEUE_CMD_DONE_INST,
+ cmd_done);
+ }
+ val = BIT(INT_WAVE5_DEC_PIC);
+ kfifo_in(&inst->irq_status, &val, sizeof(int));
}
}
+ }
+ spin_unlock_irqrestore(&dev->irq_spinlock, flags);
+
+ if (dev->irq < 0)
+ up(&dev->irq_sem);
+}
+
+static irqreturn_t wave5_vpu_irq(int irq, void *dev_id)
+{
+ struct vpu_device *dev = dev_id;
- wave5_vpu_clear_interrupt(inst, irq_reason);
+ if (wave5_vdi_read_register(dev, W5_VPU_VPU_INT_STS)) {
+ wave5_vpu_handle_irq(dev);
+ return IRQ_WAKE_THREAD;
}
+
+ return IRQ_HANDLED;
}
static irqreturn_t wave5_vpu_irq_thread(int irq, void *dev_id)
{
struct vpu_device *dev = dev_id;
+ struct vpu_instance *inst, *tmp;
+ int irq_status, ret;
- if (wave5_vdi_read_register(dev, W5_VPU_VPU_INT_STS))
- wave5_vpu_handle_irq(dev);
+ mutex_lock(&dev->irq_lock);
+ list_for_each_entry_safe(inst, tmp, &dev->instances, list) {
+ while (kfifo_len(&inst->irq_status)) {
+ ret = kfifo_out(&inst->irq_status, &irq_status, sizeof(int));
+ if (!ret)
+ break;
+
+ inst->ops->finish_process(inst);
+ }
+ }
+ mutex_unlock(&dev->irq_lock);
return IRQ_HANDLED;
}
@@ -121,6 +157,35 @@ static enum hrtimer_restart wave5_vpu_timer_callback(struct hrtimer *timer)
return HRTIMER_RESTART;
}
+static int irq_thread(void *data)
+{
+ struct vpu_device *dev = (struct vpu_device *)data;
+ struct vpu_instance *inst, *tmp;
+ int irq_status, ret;
+
+ while (!kthread_should_stop()) {
+ if (down_interruptible(&dev->irq_sem))
+ continue;
+
+ if (kthread_should_stop())
+ break;
+
+ mutex_lock(&dev->irq_lock);
+ list_for_each_entry_safe(inst, tmp, &dev->instances, list) {
+ while (kfifo_len(&inst->irq_status)) {
+ ret = kfifo_out(&inst->irq_status, &irq_status, sizeof(int));
+ if (!ret)
+ break;
+
+ inst->ops->finish_process(inst);
+ }
+ }
+ mutex_unlock(&dev->irq_lock);
+ }
+
+ return 0;
+}
+
static int wave5_vpu_load_firmware(struct device *dev, const char *fw_name,
u32 *revision)
{
@@ -224,6 +289,8 @@ static int wave5_vpu_probe(struct platform_device *pdev)
mutex_init(&dev->dev_lock);
mutex_init(&dev->hw_lock);
+ mutex_init(&dev->irq_lock);
+ spin_lock_init(&dev->irq_spinlock);
dev_set_drvdata(&pdev->dev, dev);
dev->dev = &pdev->dev;
@@ -266,9 +333,13 @@ static int wave5_vpu_probe(struct platform_device *pdev)
}
dev->product = wave5_vpu_get_product_id(dev);
+ INIT_LIST_HEAD(&dev->instances);
+
dev->irq = platform_get_irq(pdev, 0);
if (dev->irq < 0) {
dev_err(&pdev->dev, "failed to get irq resource, falling back to polling\n");
+ sema_init(&dev->irq_sem, 1);
+ dev->irq_thread = kthread_run(irq_thread, dev, "irq thread");
hrtimer_setup(&dev->hrtimer, &wave5_vpu_timer_callback, CLOCK_MONOTONIC,
HRTIMER_MODE_REL_PINNED);
dev->worker = kthread_run_worker(0, "vpu_irq_thread");
@@ -280,7 +351,7 @@ static int wave5_vpu_probe(struct platform_device *pdev)
dev->vpu_poll_interval = vpu_poll_interval;
kthread_init_work(&dev->work, wave5_vpu_irq_work_fn);
} else {
- ret = devm_request_threaded_irq(&pdev->dev, dev->irq, NULL,
+ ret = devm_request_threaded_irq(&pdev->dev, dev->irq, wave5_vpu_irq,
wave5_vpu_irq_thread, IRQF_ONESHOT, "vpu_irq", dev);
if (ret) {
dev_err(&pdev->dev, "Register interrupt handler, fail: %d\n", ret);
@@ -288,7 +359,6 @@ static int wave5_vpu_probe(struct platform_device *pdev)
}
}
- INIT_LIST_HEAD(&dev->instances);
ret = v4l2_device_register(&pdev->dev, &dev->v4l2_dev);
if (ret) {
dev_err(&pdev->dev, "v4l2_device_register, fail: %d\n", ret);
@@ -356,6 +426,12 @@ static void wave5_vpu_remove(struct platform_device *pdev)
v4l2_device_unregister(&dev->v4l2_dev);
if (dev->irq < 0) {
+ if (dev->irq_thread) {
+ kthread_stop(dev->irq_thread);
+ up(&dev->irq_sem);
+ dev->irq_thread = NULL;
+ }
+
hrtimer_cancel(&dev->hrtimer);
kthread_cancel_work_sync(&dev->work);
kthread_destroy_worker(dev->worker);
@@ -366,6 +442,7 @@ static void wave5_vpu_remove(struct platform_device *pdev)
mutex_destroy(&dev->dev_lock);
mutex_destroy(&dev->hw_lock);
+ mutex_destroy(&dev->irq_lock);
reset_control_assert(dev->resets);
clk_bulk_disable_unprepare(dev->num_clks, dev->clks);
wave5_vdi_release(&pdev->dev);
diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h
index 45615c15beca3..bc101397204da 100644
--- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h
+++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.h
@@ -8,6 +8,7 @@
#ifndef VPUAPI_H_INCLUDED
#define VPUAPI_H_INCLUDED
+#include <linux/kfifo.h>
#include <linux/idr.h>
#include <linux/genalloc.h>
#include <media/v4l2-device.h>
@@ -747,6 +748,7 @@ struct vpu_device {
struct video_device *video_dev_enc;
struct mutex dev_lock; /* lock for the src, dst v4l2 queues */
struct mutex hw_lock; /* lock hw configurations */
+ struct mutex irq_lock;
int irq;
enum product_id product;
struct vpu_attr attr;
@@ -764,7 +766,10 @@ struct vpu_device {
struct kthread_worker *worker;
int vpu_poll_interval;
int num_clks;
+ struct task_struct *irq_thread;
+ struct semaphore irq_sem; /* signal to irq_thread when interrupt happens*/
struct reset_control *resets;
+ spinlock_t irq_spinlock; /* protect instances list */
};
struct vpu_instance;
@@ -788,6 +793,7 @@ struct vpu_instance {
enum v4l2_ycbcr_encoding ycbcr_enc;
enum v4l2_quantization quantization;
+ struct kfifo irq_status;
enum vpu_instance_state state;
enum vpu_instance_type type;
const struct vpu_instance_ops *ops;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 490/752] media: verisilicon: AV1: Fix enable cdef computation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (33 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 489/752] media: chips-media: wave5: Fix Null reference while testing fluster Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 491/752] media: verisilicon: AV1: Fix tx mode bit setting Sasha Levin
` (249 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Benjamin Gaignard, stable, Jianfeng Liu, Nicolas Dufresne,
Hans Verkuil, Sasha Levin
From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
[ Upstream commit e0f99b810e1181374370f91cd996d761549e147f ]
If all the fields of the CDEF parameters are zero (which is the default),
then av1_enable_cdef register needs to be unset
(despite the V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF possibly being set).
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Fixes: 727a400686a2c ("media: verisilicon: Add Rockchip AV1 decoder")
Cc: stable@vger.kernel.org
Reported-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Closes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4786
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
[hverkuil: dropped Link tag since it just duplicated the Closes: URL]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../platform/verisilicon/rockchip_vpu981_hw_av1_dec.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
index e4703bb6be7c1..f4f7cb45b1f1b 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
@@ -1396,8 +1396,16 @@ static void rockchip_vpu981_av1_dec_set_cdef(struct hantro_ctx *ctx)
u16 luma_sec_strength = 0;
u32 chroma_pri_strength = 0;
u16 chroma_sec_strength = 0;
+ bool enable_cdef;
int i;
+ enable_cdef = !(cdef->bits == 0 &&
+ cdef->damping_minus_3 == 0 &&
+ cdef->y_pri_strength[0] == 0 &&
+ cdef->y_sec_strength[0] == 0 &&
+ cdef->uv_pri_strength[0] == 0 &&
+ cdef->uv_sec_strength[0] == 0);
+ hantro_reg_write(vpu, &av1_enable_cdef, enable_cdef);
hantro_reg_write(vpu, &av1_cdef_bits, cdef->bits);
hantro_reg_write(vpu, &av1_cdef_damping, cdef->damping_minus_3);
@@ -1953,8 +1961,6 @@ static void rockchip_vpu981_av1_dec_set_parameters(struct hantro_ctx *ctx)
!!(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_SHOW_FRAME));
hantro_reg_write(vpu, &av1_switchable_motion_mode,
!!(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_IS_MOTION_MODE_SWITCHABLE));
- hantro_reg_write(vpu, &av1_enable_cdef,
- !!(ctrls->sequence->flags & V4L2_AV1_SEQUENCE_FLAG_ENABLE_CDEF));
hantro_reg_write(vpu, &av1_allow_masked_compound,
!!(ctrls->sequence->flags
& V4L2_AV1_SEQUENCE_FLAG_ENABLE_MASKED_COMPOUND));
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 491/752] media: verisilicon: AV1: Fix tx mode bit setting
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (34 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 490/752] media: verisilicon: AV1: Fix enable cdef computation Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 492/752] arm64: dts: qcom: x1e80100: Add missing TCSR ref clock to the DP PHYs Sasha Levin
` (248 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Benjamin Gaignard, stable, Nicolas Dufresne, Hans Verkuil,
Sasha Levin
From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
[ Upstream commit cb3f945c012ab152fd2323e0df34c2b640071738 ]
AV1 specification describes 3 possibles tx modes: 4x4 only, largest and
select. The hardware allows 5 possibles tx modes: 4x4 only, 8x8, 16x16,
32x32 and select. Since the both aren't exactly matching we need to add
a mapping function to set the correct mode on hardware.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Fixes: 727a400686a2c ("media: verisilicon: Add Rockchip AV1 decoder")
Cc: stable@vger.kernel.org
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../verisilicon/rockchip_vpu981_hw_av1_dec.c | 27 ++++++++++++++++++-
1 file changed, 26 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
index f4f7cb45b1f1b..f52b8208e6b93 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
@@ -72,6 +72,14 @@
: AV1_DIV_ROUND_UP_POW2((_value_), (_n_))); \
})
+enum rockchip_av1_tx_mode {
+ ROCKCHIP_AV1_TX_MODE_ONLY_4X4 = 0,
+ ROCKCHIP_AV1_TX_MODE_8X8 = 1,
+ ROCKCHIP_AV1_TX_MODE_16x16 = 2,
+ ROCKCHIP_AV1_TX_MODE_32x32 = 3,
+ ROCKCHIP_AV1_TX_MODE_SELECT = 4,
+};
+
struct rockchip_av1_film_grain {
u8 scaling_lut_y[256];
u8 scaling_lut_cb[256];
@@ -1935,11 +1943,26 @@ static void rockchip_vpu981_av1_dec_set_reference_frames(struct hantro_ctx *ctx)
rockchip_vpu981_av1_dec_set_other_frames(ctx);
}
+static int rockchip_vpu981_av1_get_hardware_tx_mode(enum v4l2_av1_tx_mode tx_mode)
+{
+ switch (tx_mode) {
+ case V4L2_AV1_TX_MODE_ONLY_4X4:
+ return ROCKCHIP_AV1_TX_MODE_ONLY_4X4;
+ case V4L2_AV1_TX_MODE_LARGEST:
+ return ROCKCHIP_AV1_TX_MODE_32x32;
+ case V4L2_AV1_TX_MODE_SELECT:
+ return ROCKCHIP_AV1_TX_MODE_SELECT;
+ }
+
+ return ROCKCHIP_AV1_TX_MODE_32x32;
+}
+
static void rockchip_vpu981_av1_dec_set_parameters(struct hantro_ctx *ctx)
{
struct hantro_dev *vpu = ctx->dev;
struct hantro_av1_dec_hw_ctx *av1_dec = &ctx->av1_dec;
struct hantro_av1_dec_ctrls *ctrls = &av1_dec->ctrls;
+ int tx_mode;
hantro_reg_write(vpu, &av1_skip_mode,
!!(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_SKIP_MODE_PRESENT));
@@ -2005,7 +2028,9 @@ static void rockchip_vpu981_av1_dec_set_parameters(struct hantro_ctx *ctx)
!!(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_ALLOW_HIGH_PRECISION_MV));
hantro_reg_write(vpu, &av1_comp_pred_mode,
(ctrls->frame->flags & V4L2_AV1_FRAME_FLAG_REFERENCE_SELECT) ? 2 : 0);
- hantro_reg_write(vpu, &av1_transform_mode, (ctrls->frame->tx_mode == 1) ? 3 : 4);
+
+ tx_mode = rockchip_vpu981_av1_get_hardware_tx_mode(ctrls->frame->tx_mode);
+ hantro_reg_write(vpu, &av1_transform_mode, tx_mode);
hantro_reg_write(vpu, &av1_max_cb_size,
(ctrls->sequence->flags
& V4L2_AV1_SEQUENCE_FLAG_USE_128X128_SUPERBLOCK) ? 7 : 6);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 492/752] arm64: dts: qcom: x1e80100: Add missing TCSR ref clock to the DP PHYs
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (35 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 491/752] media: verisilicon: AV1: Fix tx mode bit setting Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 493/752] arm64: dts: qcom: sm8750: Fix BAM DMA probing Sasha Levin
` (247 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Abel Vesa, stable, Bjorn Andersson, Sasha Levin
From: Abel Vesa <abel.vesa@linaro.org>
[ Upstream commit 0907cab01ff9746ecf08592edd9bd85d2636be58 ]
The DP PHYs on X1E80100 need the ref clock which is provided by the
TCSR CC.
The current X Elite devices supported upstream work fine without this
clock, because the boot firmware leaves this clock enabled. But we should
not rely on that. Also, even though this change breaks the ABI, it is
needed in order to make the driver disables this clock along with the
other ones, for a proper bring-down of the entire PHY.
So lets attach it to each of the DP PHYs in order to do that.
Cc: stable@vger.kernel.org # v6.9
Fixes: 1940c25eaa63 ("arm64: dts: qcom: x1e80100: Add display nodes")
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://lore.kernel.org/r/20251224-phy-qcom-edp-add-missing-refclk-v5-3-3f45d349b5ac@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/x1e80100.dtsi | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
index 512a75da4f13f..6d97329995fe7 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi
+++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
@@ -5811,9 +5811,11 @@ mdss_dp2_phy: phy@aec2a00 {
<0 0x0aec2000 0 0x1c8>;
clocks = <&dispcc DISP_CC_MDSS_DPTX2_AUX_CLK>,
- <&dispcc DISP_CC_MDSS_AHB_CLK>;
+ <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&tcsr TCSR_EDP_CLKREF_EN>;
clock-names = "aux",
- "cfg_ahb";
+ "cfg_ahb",
+ "ref";
power-domains = <&rpmhpd RPMHPD_MX>;
@@ -5831,9 +5833,11 @@ mdss_dp3_phy: phy@aec5a00 {
<0 0x0aec5000 0 0x1c8>;
clocks = <&dispcc DISP_CC_MDSS_DPTX3_AUX_CLK>,
- <&dispcc DISP_CC_MDSS_AHB_CLK>;
+ <&dispcc DISP_CC_MDSS_AHB_CLK>,
+ <&tcsr TCSR_EDP_CLKREF_EN>;
clock-names = "aux",
- "cfg_ahb";
+ "cfg_ahb",
+ "ref";
power-domains = <&rpmhpd RPMHPD_MX>;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 493/752] arm64: dts: qcom: sm8750: Fix BAM DMA probing
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (36 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 492/752] arm64: dts: qcom: x1e80100: Add missing TCSR ref clock to the DP PHYs Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 494/752] ARM: omap2: Fix reference count leaks in omap_control_init() Sasha Levin
` (246 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Krzysztof Kozlowski, stable, Konrad Dybcio, Bjorn Andersson,
Sasha Levin
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
[ Upstream commit 1c6192ec9c4ab8bdb7b2cf8763b7ef7e38671ffe ]
Bindings always required "qcom,num-ees" and "num-channels" properties,
as reported by dtbs_check:
sm8750-mtp.dtb: dma-controller@1dc4000 (qcom,bam-v1.7.4): 'anyOf' conditional failed, one must be fixed:
'qcom,powered-remotely' is a required property
'num-channels' is a required property
'qcom,num-ees' is a required property
'clocks' is a required property
'clock-names' is a required property
However since commit 5068b5254812 ("dmaengine: qcom: bam_dma: Fix DT
error handling for num-channels/ees") missing properties are actually
fatal and BAM does not probe:
bam-dma-engine 1dc4000.dma-controller: num-channels unspecified in dt
bam-dma-engine 1dc4000.dma-controller: probe with driver bam-dma-engine failed with error -22
Fixes: eeb0f3e4ea67 ("arm64: dts: qcom: sm8750: Add QCrypto nodes")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20251229115734.205744-2-krzysztof.kozlowski@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/qcom/sm8750.dtsi | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sm8750.dtsi b/arch/arm64/boot/dts/qcom/sm8750.dtsi
index a82d9867c7cb6..33963fee1f699 100644
--- a/arch/arm64/boot/dts/qcom/sm8750.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8750.dtsi
@@ -2072,6 +2072,8 @@ cryptobam: dma-controller@1dc4000 {
<&apps_smmu 0x481 0>;
qcom,ee = <0>;
+ qcom,num-ees = <4>;
+ num-channels = <20>;
qcom,controlled-remotely;
};
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 494/752] ARM: omap2: Fix reference count leaks in omap_control_init()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (37 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 493/752] arm64: dts: qcom: sm8750: Fix BAM DMA probing Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 495/752] arm64: kernel: initialize missing kexec_buf->random field Sasha Levin
` (245 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Wentao Liang, stable, Andreas Kemnade, Kevin Hilman, Sasha Levin
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit 93a04ab480c8bbcb7d9004be139c538c8a0c1bc8 ]
The of_get_child_by_name() function increments the reference count
of child nodes, causing multiple reference leaks in omap_control_init():
1. scm_conf node never released in normal/error paths
2. clocks node leak when checking existence
3. Missing scm_conf release before np in error paths
Fix these leaks by adding proper of_node_put() calls and separate error
handling.
Fixes: e5b635742e98 ("ARM: OMAP2+: control: add syscon support for register accesses")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20251217142122.1861292-1-vulab@iscas.ac.cn
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm/mach-omap2/control.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 79860b23030de..eb6fc7c61b6e0 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -732,7 +732,7 @@ int __init omap2_control_base_init(void)
*/
int __init omap_control_init(void)
{
- struct device_node *np, *scm_conf;
+ struct device_node *np, *scm_conf, *clocks_node;
const struct of_device_id *match;
const struct omap_prcm_init_data *data;
int ret;
@@ -753,16 +753,19 @@ int __init omap_control_init(void)
if (IS_ERR(syscon)) {
ret = PTR_ERR(syscon);
- goto of_node_put;
+ goto err_put_scm_conf;
}
- if (of_get_child_by_name(scm_conf, "clocks")) {
+ clocks_node = of_get_child_by_name(scm_conf, "clocks");
+ if (clocks_node) {
+ of_node_put(clocks_node);
ret = omap2_clk_provider_init(scm_conf,
data->index,
syscon, NULL);
if (ret)
- goto of_node_put;
+ goto err_put_scm_conf;
}
+ of_node_put(scm_conf);
} else {
/* No scm_conf found, direct access */
ret = omap2_clk_provider_init(np, data->index, NULL,
@@ -780,6 +783,9 @@ int __init omap_control_init(void)
return 0;
+err_put_scm_conf:
+ if (scm_conf)
+ of_node_put(scm_conf);
of_node_put:
of_node_put(np);
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 495/752] arm64: kernel: initialize missing kexec_buf->random field
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (38 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 494/752] ARM: omap2: Fix reference count leaks in omap_control_init() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 496/752] powerpc/pseries: Fix MSI-X allocation failure when quota is exceeded Sasha Levin
` (244 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Yeoreum Yun, Breno Leitao, stable, Andrew Morton, Pratyush Yadav,
Will Deacon, Sasha Levin
From: Yeoreum Yun <yeoreum.yun@arm.com>
[ Upstream commit 15dd20dda979ebab72f6df97845828e78d63ab91 ]
Commit bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
introduced the kexec_buf->random field to enable random placement of
kexec_buf.
However, this field was never properly initialized for kexec images
that do not need to be placed randomly, leading to the following UBSAN
warning:
[ +0.364528] ------------[ cut here ]------------
[ +0.000019] UBSAN: invalid-load in ./include/linux/kexec.h:210:12
[ +0.000131] load of value 2 is not a valid value for type 'bool' (aka '_Bool')
[ +0.000003] CPU: 4 UID: 0 PID: 927 Comm: kexec Not tainted 6.18.0-rc7+ #3 PREEMPT(full)
[ +0.000002] Hardware name: QEMU QEMU Virtual Machine, BIOS 0.0.0 02/06/2015
[ +0.000000] Call trace:
[ +0.000001] show_stack+0x24/0x40 (C)
[ +0.000006] __dump_stack+0x28/0x48
[ +0.000002] dump_stack_lvl+0x7c/0xb0
[ +0.000002] dump_stack+0x18/0x34
[ +0.000001] ubsan_epilogue+0x10/0x50
[ +0.000002] __ubsan_handle_load_invalid_value+0xc8/0xd0
[ +0.000003] locate_mem_hole_callback+0x28c/0x2a0
[ +0.000003] kexec_locate_mem_hole+0xf4/0x2f0
[ +0.000001] kexec_add_buffer+0xa8/0x178
[ +0.000002] image_load+0xf0/0x258
[ +0.000001] __arm64_sys_kexec_file_load+0x510/0x718
[ +0.000002] invoke_syscall+0x68/0xe8
[ +0.000001] el0_svc_common+0xb0/0xf8
[ +0.000002] do_el0_svc+0x28/0x48
[ +0.000001] el0_svc+0x40/0xe8
[ +0.000002] el0t_64_sync_handler+0x84/0x140
[ +0.000002] el0t_64_sync+0x1bc/0x1c0
To address this, initialise kexec_buf->random field properly.
Fixes: bf454ec31add ("kexec_file: allow to place kexec_buf randomly")
Suggested-by: Breno Leitao <leitao@debian.org>
Cc: stable@vger.kernel.org
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Link: https://lore.kernel.org/all/oninomspajhxp4omtdapxnckxydbk2nzmrix7rggmpukpnzadw@c67o7njgdgm3/ [1]
Link: https://lore.kernel.org/all/20250825180531.94bfb86a26a43127c0a1296f@linux-foundation.org/ [2]
Link: https://lkml.kernel.org/r/20250826-akpm-v1-1-3c831f0e3799@debian.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kernel/kexec_image.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c
index 532d72ea42ee8..b70f4df15a1ae 100644
--- a/arch/arm64/kernel/kexec_image.c
+++ b/arch/arm64/kernel/kexec_image.c
@@ -41,7 +41,7 @@ static void *image_load(struct kimage *image,
struct arm64_image_header *h;
u64 flags, value;
bool be_image, be_kernel;
- struct kexec_buf kbuf;
+ struct kexec_buf kbuf = {};
unsigned long text_offset, kernel_segment_number;
struct kexec_segment *kernel_segment;
int ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 496/752] powerpc/pseries: Fix MSI-X allocation failure when quota is exceeded
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (39 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 495/752] arm64: kernel: initialize missing kexec_buf->random field Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 497/752] KVM: x86: Return "unsupported" instead of "invalid" on access to unsupported PV MSR Sasha Levin
` (243 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Nam Cao, Nilay Shroff, stable, Madhavan Srinivasan, Sasha Levin
From: Nam Cao <namcao@linutronix.de>
[ Upstream commit c0215e2d72debcd9cbc1c002fb012d50a3140387 ]
Nilay reported that since commit daaa574aba6f ("powerpc/pseries/msi: Switch
to msi_create_parent_irq_domain()"), the NVMe driver cannot enable MSI-X
when the device's MSI-X table size is larger than the firmware's MSI quota
for the device.
This is because the commit changes how rtas_prepare_msi_irqs() is called:
- Before, it is called when interrupts are allocated at the global
interrupt domain with nvec_in being the number of allocated interrupts.
rtas_prepare_msi_irqs() can return a positive number and the allocation
will be retried.
- Now, it is called at the creation of per-device interrupt domain with
nvec_in being the number of interrupts that the device supports. If
rtas_prepare_msi_irqs() returns positive, domain creation just fails.
For Nilay's NVMe driver case, rtas_prepare_msi_irqs() returns a positive
number (the quota). This causes per-device interrupt domain creation to
fail and thus the NVMe driver cannot enable MSI-X.
Rework to make this scenario works again:
- pseries_msi_ops_prepare() only prepares as many interrupts as the quota
permit.
- pseries_irq_domain_alloc() fails if the device's quota is exceeded.
Now, if the quota is exceeded, pseries_msi_ops_prepare() will only prepare
as allowed by the quota. If device drivers attempt to allocate more
interrupts than the quota permits, pseries_irq_domain_alloc() will return
an error code and msi_handle_pci_fail() will allow device drivers a retry.
Reported-by: Nilay Shroff <nilay@linux.ibm.com>
Closes: https://lore.kernel.org/linuxppc-dev/6af2c4c2-97f6-4758-be33-256638ef39e5@linux.ibm.com/
Fixes: daaa574aba6f ("powerpc/pseries/msi: Switch to msi_create_parent_irq_domain()")
Signed-off-by: Nam Cao <namcao@linutronix.de>
Cc: stable@vger.kernel.org
Tested-by: Nilay Shroff <nilay@linux.ibm.com>
Acked-by: Nilay Shroff <nilay@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260107100230.1466093-1-namcao@linutronix.de
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/platforms/pseries/msi.c | 44 ++++++++++++++++++++++++++--
1 file changed, 41 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c
index a82aaa786e9e0..edc30cda5dbcb 100644
--- a/arch/powerpc/platforms/pseries/msi.c
+++ b/arch/powerpc/platforms/pseries/msi.c
@@ -19,6 +19,11 @@
#include "pseries.h"
+struct pseries_msi_device {
+ unsigned int msi_quota;
+ unsigned int msi_used;
+};
+
static int query_token, change_token;
#define RTAS_QUERY_FN 0
@@ -433,8 +438,28 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev
struct msi_domain_info *info = domain->host_data;
struct pci_dev *pdev = to_pci_dev(dev);
int type = (info->flags & MSI_FLAG_PCI_MSIX) ? PCI_CAP_ID_MSIX : PCI_CAP_ID_MSI;
+ int ret;
+
+ struct pseries_msi_device *pseries_dev __free(kfree)
+ = kmalloc(sizeof(*pseries_dev), GFP_KERNEL);
+ if (!pseries_dev)
+ return -ENOMEM;
+
+ while (1) {
+ ret = rtas_prepare_msi_irqs(pdev, nvec, type, arg);
+ if (!ret)
+ break;
+ else if (ret > 0)
+ nvec = ret;
+ else
+ return ret;
+ }
- return rtas_prepare_msi_irqs(pdev, nvec, type, arg);
+ pseries_dev->msi_quota = nvec;
+ pseries_dev->msi_used = 0;
+
+ arg->scratchpad[0].ptr = no_free_ptr(pseries_dev);
+ return 0;
}
/*
@@ -443,9 +468,13 @@ static int pseries_msi_ops_prepare(struct irq_domain *domain, struct device *dev
*/
static void pseries_msi_ops_teardown(struct irq_domain *domain, msi_alloc_info_t *arg)
{
+ struct pseries_msi_device *pseries_dev = arg->scratchpad[0].ptr;
struct pci_dev *pdev = to_pci_dev(domain->dev);
rtas_disable_msi(pdev);
+
+ WARN_ON(pseries_dev->msi_used);
+ kfree(pseries_dev);
}
static void pseries_msi_shutdown(struct irq_data *d)
@@ -546,12 +575,18 @@ static int pseries_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
unsigned int nr_irqs, void *arg)
{
struct pci_controller *phb = domain->host_data;
+ struct pseries_msi_device *pseries_dev;
msi_alloc_info_t *info = arg;
struct msi_desc *desc = info->desc;
struct pci_dev *pdev = msi_desc_to_pci_dev(desc);
int hwirq;
int i, ret;
+ pseries_dev = info->scratchpad[0].ptr;
+
+ if (pseries_dev->msi_used + nr_irqs > pseries_dev->msi_quota)
+ return -ENOSPC;
+
hwirq = rtas_query_irq_number(pci_get_pdn(pdev), desc->msi_index);
if (hwirq < 0) {
dev_err(&pdev->dev, "Failed to query HW IRQ: %d\n", hwirq);
@@ -567,9 +602,10 @@ static int pseries_irq_domain_alloc(struct irq_domain *domain, unsigned int virq
goto out;
irq_domain_set_hwirq_and_chip(domain, virq + i, hwirq + i,
- &pseries_msi_irq_chip, domain->host_data);
+ &pseries_msi_irq_chip, pseries_dev);
}
+ pseries_dev->msi_used++;
return 0;
out:
@@ -582,9 +618,11 @@ static void pseries_irq_domain_free(struct irq_domain *domain, unsigned int virq
unsigned int nr_irqs)
{
struct irq_data *d = irq_domain_get_irq_data(domain, virq);
- struct pci_controller *phb = irq_data_get_irq_chip_data(d);
+ struct pseries_msi_device *pseries_dev = irq_data_get_irq_chip_data(d);
+ struct pci_controller *phb = domain->host_data;
pr_debug("%s bridge %pOF %d #%d\n", __func__, phb->dn, virq, nr_irqs);
+ pseries_dev->msi_used -= nr_irqs;
irq_domain_free_irqs_parent(domain, virq, nr_irqs);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 497/752] KVM: x86: Return "unsupported" instead of "invalid" on access to unsupported PV MSR
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (40 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 496/752] powerpc/pseries: Fix MSI-X allocation failure when quota is exceeded Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 498/752] KVM: nSVM: Remove a user-triggerable WARN on nested_svm_load_cr3() succeeding Sasha Levin
` (242 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Sean Christopherson, stable, Jim Mattson, Sasha Levin
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit 5bb9ac1865123356337a389af935d3913ee917ed ]
Return KVM_MSR_RET_UNSUPPORTED instead of '1' (which for all intents and
purposes means "invalid") when rejecting accesses to KVM PV MSRs to adhere
to KVM's ABI of allowing host reads and writes of '0' to MSRs that are
advertised to userspace via KVM_GET_MSR_INDEX_LIST, even if the vCPU model
doesn't support the MSR.
E.g. running a QEMU VM with
-cpu host,-kvmclock,kvm-pv-enforce-cpuid
yields:
qemu: error: failed to set MSR 0x12 to 0x0
qemu: target/i386/kvm/kvm.c:3301: kvm_buf_set_msrs:
Assertion `ret == cpu->kvm_msr_buf->nmsrs' failed.
Fixes: 66570e966dd9 ("kvm: x86: only provide PV features if enabled in guest's CPUID")
Cc: stable@vger.kernel.org
Reviewed-by: Jim Mattson <jmattson@google.com>
Link: https://patch.msgid.link/20251230205948.4094097-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/x86.c | 40 ++++++++++++++++++++--------------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index c075ee23aeade..79d0abaf71dde 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -4136,47 +4136,47 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
break;
case MSR_KVM_WALL_CLOCK_NEW:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE2))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
vcpu->kvm->arch.wall_clock = data;
kvm_write_wall_clock(vcpu->kvm, data, 0);
break;
case MSR_KVM_WALL_CLOCK:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
vcpu->kvm->arch.wall_clock = data;
kvm_write_wall_clock(vcpu->kvm, data, 0);
break;
case MSR_KVM_SYSTEM_TIME_NEW:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE2))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
kvm_write_system_time(vcpu, data, false, msr_info->host_initiated);
break;
case MSR_KVM_SYSTEM_TIME:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
kvm_write_system_time(vcpu, data, true, msr_info->host_initiated);
break;
case MSR_KVM_ASYNC_PF_EN:
if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
if (kvm_pv_enable_async_pf(vcpu, data))
return 1;
break;
case MSR_KVM_ASYNC_PF_INT:
if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
if (kvm_pv_enable_async_pf_int(vcpu, data))
return 1;
break;
case MSR_KVM_ASYNC_PF_ACK:
if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
if (data & 0x1) {
vcpu->arch.apf.pageready_pending = false;
kvm_check_async_pf_completion(vcpu);
@@ -4184,7 +4184,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
break;
case MSR_KVM_STEAL_TIME:
if (!guest_pv_has(vcpu, KVM_FEATURE_STEAL_TIME))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
if (unlikely(!sched_info_on()))
return 1;
@@ -4202,7 +4202,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
break;
case MSR_KVM_PV_EOI_EN:
if (!guest_pv_has(vcpu, KVM_FEATURE_PV_EOI))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
if (kvm_lapic_set_pv_eoi(vcpu, data, sizeof(u8)))
return 1;
@@ -4210,7 +4210,7 @@ int kvm_set_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
case MSR_KVM_POLL_CONTROL:
if (!guest_pv_has(vcpu, KVM_FEATURE_POLL_CONTROL))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
/* only enable bit supported */
if (data & (-1ULL << 1))
@@ -4511,61 +4511,61 @@ int kvm_get_msr_common(struct kvm_vcpu *vcpu, struct msr_data *msr_info)
break;
case MSR_KVM_WALL_CLOCK:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->kvm->arch.wall_clock;
break;
case MSR_KVM_WALL_CLOCK_NEW:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE2))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->kvm->arch.wall_clock;
break;
case MSR_KVM_SYSTEM_TIME:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.time;
break;
case MSR_KVM_SYSTEM_TIME_NEW:
if (!guest_pv_has(vcpu, KVM_FEATURE_CLOCKSOURCE2))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.time;
break;
case MSR_KVM_ASYNC_PF_EN:
if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.apf.msr_en_val;
break;
case MSR_KVM_ASYNC_PF_INT:
if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.apf.msr_int_val;
break;
case MSR_KVM_ASYNC_PF_ACK:
if (!guest_pv_has(vcpu, KVM_FEATURE_ASYNC_PF_INT))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = 0;
break;
case MSR_KVM_STEAL_TIME:
if (!guest_pv_has(vcpu, KVM_FEATURE_STEAL_TIME))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.st.msr_val;
break;
case MSR_KVM_PV_EOI_EN:
if (!guest_pv_has(vcpu, KVM_FEATURE_PV_EOI))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.pv_eoi.msr_val;
break;
case MSR_KVM_POLL_CONTROL:
if (!guest_pv_has(vcpu, KVM_FEATURE_POLL_CONTROL))
- return 1;
+ return KVM_MSR_RET_UNSUPPORTED;
msr_info->data = vcpu->arch.msr_kvm_poll_control;
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 498/752] KVM: nSVM: Remove a user-triggerable WARN on nested_svm_load_cr3() succeeding
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (41 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 497/752] KVM: x86: Return "unsupported" instead of "invalid" on access to unsupported PV MSR Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 499/752] arm64: Disable branch profiling for all arm64 code Sasha Levin
` (241 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Sean Christopherson, stable, Yosry Ahmed, Sasha Levin
From: Sean Christopherson <seanjc@google.com>
[ Upstream commit fc3ba56385d03501eb582e4b86691ba378e556f9 ]
Drop the WARN in svm_set_nested_state() on nested_svm_load_cr3() failing
as it is trivially easy to trigger from userspace by modifying CPUID after
loading CR3. E.g. modifying the state restoration selftest like so:
--- tools/testing/selftests/kvm/x86/state_test.c
+++ tools/testing/selftests/kvm/x86/state_test.c
@@ -280,7 +280,16 @@ int main(int argc, char *argv[])
/* Restore state in a new VM. */
vcpu = vm_recreate_with_one_vcpu(vm);
- vcpu_load_state(vcpu, state);
+
+ if (stage == 4) {
+ state->sregs.cr3 = BIT(44);
+ vcpu_load_state(vcpu, state);
+
+ vcpu_set_cpuid_property(vcpu, X86_PROPERTY_MAX_PHY_ADDR, 36);
+ __vcpu_nested_state_set(vcpu, &state->nested);
+ } else {
+ vcpu_load_state(vcpu, state);
+ }
/*
* Restore XSAVE state in a dummy vCPU, first without doing
generates:
WARNING: CPU: 30 PID: 938 at arch/x86/kvm/svm/nested.c:1877 svm_set_nested_state+0x34a/0x360 [kvm_amd]
Modules linked in: kvm_amd kvm irqbypass [last unloaded: kvm]
CPU: 30 UID: 1000 PID: 938 Comm: state_test Tainted: G W 6.18.0-rc7-58e10b63777d-next-vm
Tainted: [W]=WARN
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:svm_set_nested_state+0x34a/0x360 [kvm_amd]
Call Trace:
<TASK>
kvm_arch_vcpu_ioctl+0xf33/0x1700 [kvm]
kvm_vcpu_ioctl+0x4e6/0x8f0 [kvm]
__x64_sys_ioctl+0x8f/0xd0
do_syscall_64+0x61/0xad0
entry_SYSCALL_64_after_hwframe+0x4b/0x53
Simply delete the WARN instead of trying to prevent userspace from shoving
"illegal" state into CR3. For better or worse, KVM's ABI allows userspace
to set CPUID after SREGS, and vice versa, and KVM is very permissive when
it comes to guest CPUID. I.e. attempting to enforce the virtual CPU model
when setting CPUID could break userspace. Given that the WARN doesn't
provide any meaningful protection for KVM or benefit for userspace, simply
drop it even though the odds of breaking userspace are minuscule.
Opportunistically delete a spurious newline.
Fixes: b222b0b88162 ("KVM: nSVM: refactor the CR3 reload on migration")
Cc: stable@vger.kernel.org
Cc: Yosry Ahmed <yosry.ahmed@linux.dev>
Reviewed-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20251216161755.1775409-1-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/svm/nested.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/arch/x86/kvm/svm/nested.c b/arch/x86/kvm/svm/nested.c
index e56c9b37e2b5b..db35033999a8e 100644
--- a/arch/x86/kvm/svm/nested.c
+++ b/arch/x86/kvm/svm/nested.c
@@ -1880,10 +1880,9 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu,
* thus MMU might not be initialized correctly.
* Set it again to fix this.
*/
-
ret = nested_svm_load_cr3(&svm->vcpu, vcpu->arch.cr3,
nested_npt_enabled(svm), false);
- if (WARN_ON_ONCE(ret))
+ if (ret)
goto out_free;
svm->nested.force_msr_bitmap_recalc = true;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 499/752] arm64: Disable branch profiling for all arm64 code
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (42 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 498/752] KVM: nSVM: Remove a user-triggerable WARN on nested_svm_load_cr3() succeeding Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 500/752] pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping Sasha Levin
` (240 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Breno Leitao, stable, Mark Rutland, Will Deacon, Sasha Levin
From: Breno Leitao <leitao@debian.org>
[ Upstream commit f22c81bebf8bda6e54dc132df0ed54f6bf8756f9 ]
The arm64 kernel doesn't boot with annotated branches
(PROFILE_ANNOTATED_BRANCHES) enabled and CONFIG_DEBUG_VIRTUAL together.
Bisecting it, I found that disabling branch profiling in arch/arm64/mm
solved the problem. Narrowing down a bit further, I found that
physaddr.c is the file that needs to have branch profiling disabled to
get the machine to boot.
I suspect that it might invoke some ftrace helper very early in the boot
process and ftrace is still not enabled(!?).
Rather than playing whack-a-mole with individual files, disable branch
profiling for the entire arch/arm64 tree, similar to what x86 already
does in arch/x86/Kbuild.
Cc: stable@vger.kernel.org
Signed-off-by: Breno Leitao <leitao@debian.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/Kbuild | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/arch/arm64/Kbuild b/arch/arm64/Kbuild
index 5bfbf7d79c99b..d876bc0e54211 100644
--- a/arch/arm64/Kbuild
+++ b/arch/arm64/Kbuild
@@ -1,4 +1,8 @@
# SPDX-License-Identifier: GPL-2.0-only
+
+# Branch profiling isn't noinstr-safe
+subdir-ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING
+
obj-y += kernel/ mm/ net/
obj-$(CONFIG_KVM) += kvm/
obj-$(CONFIG_XEN) += xen/
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 500/752] pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (43 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 499/752] arm64: Disable branch profiling for all arm64 code Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 501/752] HID: hid-pl: handle probe errors Sasha Levin
` (239 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Bartosz Golaszewski, stable, Martin Blumenstingl, Neil Armstrong,
Linus Walleij, Sasha Levin
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ Upstream commit d6df4abe95a409e812c5d9af9657fe63ac299e3a ]
The GPIO controller is configured as non-sleeping but it uses generic
pinctrl helpers which use a mutex for synchronization. This will cause
lockdep splats when used together with shared GPIOs going through the
GPIO shared proxy driver.
Fixes: 6e9be3abb78c ("pinctrl: Add driver support for Amlogic SoCs")
Cc: stable@vger.kernel.org
Reported-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Closes: https://lore.kernel.org/all/CAFBinCAc7CO8gfNQakCu3LfkYXuyTd2iRpMRm8EKXSL0mwOnJw@mail.gmail.com/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Signed-off-by: Linus Walleij <linusw@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/meson/pinctrl-amlogic-a4.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
index f05d8261624a4..40542edd557e0 100644
--- a/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
+++ b/drivers/pinctrl/meson/pinctrl-amlogic-a4.c
@@ -895,7 +895,7 @@ static const struct gpio_chip aml_gpio_template = {
.direction_input = aml_gpio_direction_input,
.direction_output = aml_gpio_direction_output,
.get_direction = aml_gpio_get_direction,
- .can_sleep = false,
+ .can_sleep = true,
};
static void init_bank_register_bit(struct aml_pinctrl *info,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 501/752] HID: hid-pl: handle probe errors
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (44 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 500/752] pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 502/752] HID: magicmouse: Do not crash on missing msc->input Sasha Levin
` (238 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Oliver Neukum, stable, Jiri Kosina, Sasha Levin
From: Oliver Neukum <oneukum@suse.com>
[ Upstream commit 3756a272d2cf356d2203da8474d173257f5f8521 ]
Errors in init must be reported back or we'll
follow a NULL pointer the first time FF is used.
Fixes: 20eb127906709 ("hid: force feedback driver for PantherLord USB/PS2 2in1 Adapter")
Cc: stable@vger.kernel.org
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-pl.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-pl.c b/drivers/hid/hid-pl.c
index 3c8827081deae..dc11d5322fc0f 100644
--- a/drivers/hid/hid-pl.c
+++ b/drivers/hid/hid-pl.c
@@ -194,9 +194,14 @@ static int pl_probe(struct hid_device *hdev, const struct hid_device_id *id)
goto err;
}
- plff_init(hdev);
+ ret = plff_init(hdev);
+ if (ret)
+ goto stop;
return 0;
+
+stop:
+ hid_hw_stop(hdev);
err:
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 502/752] HID: magicmouse: Do not crash on missing msc->input
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (45 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 501/752] HID: hid-pl: handle probe errors Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 503/752] HID: prodikeys: Check presence of pm->input_ep82 Sasha Levin
` (237 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Günther Noack, stable, Jiri Kosina, Sasha Levin
From: Günther Noack <gnoack@google.com>
[ Upstream commit 17abd396548035fbd6179ee1a431bd75d49676a7 ]
Fake USB devices can send their own report descriptors for which the
input_mapping() hook does not get called. In this case, msc->input stays NULL,
leading to a crash at a later time.
Detect this condition in the input_configured() hook and reject the device.
This is not supposed to happen with actual magic mouse devices, but can be
provoked by imposing as a magic mouse USB device.
Cc: stable@vger.kernel.org
Signed-off-by: Günther Noack <gnoack@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-magicmouse.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 7d4a25c6de0eb..91f621ceb924b 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -725,6 +725,11 @@ static int magicmouse_input_configured(struct hid_device *hdev,
struct magicmouse_sc *msc = hid_get_drvdata(hdev);
int ret;
+ if (!msc->input) {
+ hid_err(hdev, "magicmouse setup input failed (no input)");
+ return -EINVAL;
+ }
+
ret = magicmouse_setup_input(msc->input, hdev);
if (ret) {
hid_err(hdev, "magicmouse setup input failed (%d)\n", ret);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 503/752] HID: prodikeys: Check presence of pm->input_ep82
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (46 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 502/752] HID: magicmouse: Do not crash on missing msc->input Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 504/752] HID: logitech-hidpp: Check maxfield in hidpp_get_report_length() Sasha Levin
` (236 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Günther Noack, stable, Jiri Kosina, Sasha Levin
From: Günther Noack <gnoack@google.com>
[ Upstream commit cee8337e1bad168136aecfe6416ecd7d3aa7529a ]
Fake USB devices can send their own report descriptors for which the
input_mapping() hook does not get called. In this case, pm->input_ep82 stays
NULL, which leads to a crash later.
This does not happen with the real device, but can be provoked by imposing as
one.
Cc: stable@vger.kernel.org
Signed-off-by: Günther Noack <gnoack@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-prodikeys.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/hid/hid-prodikeys.c b/drivers/hid/hid-prodikeys.c
index 74bddb2c3e82e..6e413df38358a 100644
--- a/drivers/hid/hid-prodikeys.c
+++ b/drivers/hid/hid-prodikeys.c
@@ -378,6 +378,10 @@ static int pcmidi_handle_report4(struct pcmidi_snd *pm, u8 *data)
bit_mask = (bit_mask << 8) | data[2];
bit_mask = (bit_mask << 8) | data[3];
+ /* robustness in case input_mapping hook does not get called */
+ if (!pm->input_ep82)
+ return 0;
+
/* break keys */
for (bit_index = 0; bit_index < 24; bit_index++) {
if (!((0x01 << bit_index) & bit_mask)) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 504/752] HID: logitech-hidpp: Check maxfield in hidpp_get_report_length()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (47 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 503/752] HID: prodikeys: Check presence of pm->input_ep82 Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 505/752] fs: ensure that internal tmpfs mount gets mount id zero Sasha Levin
` (235 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Günther Noack, stable, Jiri Kosina, Sasha Levin
From: Günther Noack <gnoack@google.com>
[ Upstream commit 1547d41f9f19d691c2c9ce4c29f746297baef9e9 ]
Do not crash when a report has no fields.
Fake USB gadgets can send their own HID report descriptors and can define report
structures without valid fields. This can be used to crash the kernel over USB.
Cc: stable@vger.kernel.org
Signed-off-by: Günther Noack <gnoack@google.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hid/hid-logitech-hidpp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index d117cf0b6de04..6b463ce112a3c 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -4313,7 +4313,7 @@ static int hidpp_get_report_length(struct hid_device *hdev, int id)
re = &(hdev->report_enum[HID_OUTPUT_REPORT]);
report = re->report_id_hash[id];
- if (!report)
+ if (!report || !report->maxfield)
return 0;
return report->field[0]->report_count + 1;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 505/752] fs: ensure that internal tmpfs mount gets mount id zero
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (48 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 504/752] HID: logitech-hidpp: Check maxfield in hidpp_get_report_length() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 506/752] arm64: dts: apple: t8112-j473: Keep the HDMI port powered on Sasha Levin
` (234 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Christian Brauner, Jeff Layton, stable, Sasha Levin
From: Christian Brauner <brauner@kernel.org>
[ Upstream commit a2062463e894039a6fdc2334b96afd91d44b64a8 ]
and the rootfs get mount id one as it always has. Before we actually
mount the rootfs we create an internal tmpfs mount which has mount id
zero but is never exposed anywhere. Continue that "tradition".
Link: https://patch.msgid.link/20260112-work-immutable-rootfs-v2-1-88dd1c34a204@kernel.org
Fixes: 7f9bfafc5f49 ("fs: use xarray for old mount id")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/namespace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/namespace.c b/fs/namespace.c
index 5b31682db450e..b312905c2be5b 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -221,7 +221,7 @@ static int mnt_alloc_id(struct mount *mnt)
int res;
xa_lock(&mnt_id_xa);
- res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, XA_LIMIT(1, INT_MAX), GFP_KERNEL);
+ res = __xa_alloc(&mnt_id_xa, &mnt->mnt_id, mnt, xa_limit_31b, GFP_KERNEL);
if (!res)
mnt->mnt_id_unique = ++mnt_id_ctr;
xa_unlock(&mnt_id_xa);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 506/752] arm64: dts: apple: t8112-j473: Keep the HDMI port powered on
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (49 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 505/752] fs: ensure that internal tmpfs mount gets mount id zero Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 507/752] media: amphion: Drop min_queued_buffers assignment Sasha Levin
` (233 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Janne Grunau, stable, Sven Peter, Sasha Levin
From: Janne Grunau <j@jannau.net>
[ Upstream commit 3e4e729325131fe6f7473a0673f7d8cdde53f5a0 ]
Add the display controller and DPTX phy power-domains to the framebuffer
node to keep the framebuffer and display out working after device probing
finished.
The OS has more control about the display pipeline used for the HDMI
output on M2 based devices. The HDMI output is driven by an integrated
DisplayPort to HDMI converter (Parade PS190). The DPTX phy is now
controlled by the OS and no longer by firmware running on the display
co-processor. This allows using the second display controller on the
second USB type-c port or tunneling 2 DisplayPort connections over
USB4/Thunderbolt.
The m1n1 bootloader uses the second display controller to drive the HDMI
output. Adjust for this difference compared to the notebooks as well.
Fixes: 2d5ce3fbef32 ("arm64: dts: apple: t8112: Initial t8112 (M2) device trees")
Cc: stable@vger.kernel.org
Signed-off-by: Janne Grunau <j@jannau.net>
Link: https://patch.msgid.link/20260108-apple-dt-pmgr-fixes-v1-1-cfdce629c0a8@jannau.net
Signed-off-by: Sven Peter <sven@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/apple/t8112-j473.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8112-j473.dts b/arch/arm64/boot/dts/apple/t8112-j473.dts
index 06fe257f08be4..4ae1ce919dafc 100644
--- a/arch/arm64/boot/dts/apple/t8112-j473.dts
+++ b/arch/arm64/boot/dts/apple/t8112-j473.dts
@@ -21,6 +21,25 @@ aliases {
};
};
+/*
+ * Keep the power-domains used for the HDMI port on.
+ */
+&framebuffer0 {
+ power-domains = <&ps_dispext_cpu0>, <&ps_dptx_ext_phy>;
+};
+
+/*
+ * The M2 Mac mini uses dispext for the HDMI output so it's not necessary to
+ * keep disp0 power-domains always-on.
+ */
+&ps_disp0_sys {
+ /delete-property/ apple,always-on;
+};
+
+&ps_disp0_fe {
+ /delete-property/ apple,always-on;
+};
+
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 507/752] media: amphion: Drop min_queued_buffers assignment
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (50 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 506/752] arm64: dts: apple: t8112-j473: Keep the HDMI port powered on Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 508/752] media: rockchip: rga: Fix possible ERR_PTR dereference in rga_buf_init() Sasha Levin
` (232 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Ming Qian, stable, Nicolas Dufresne, Frank Li, Hans Verkuil,
Sasha Levin
From: Ming Qian <ming.qian@oss.nxp.com>
[ Upstream commit 5633ec763a2a18cef6c5ac9250e4f4b8786e7999 ]
The min_queued_buffers field controls when start_streaming() is called
by the vb2 core (it delays the callback until at least N buffers are
queued). Setting it to 1 affects the timing of start_streaming(), which
breaks the seek flow in decoder scenarios and causes test failures.
The current driver implementation does not rely on this minimum buffer
requirement and handles streaming start correctly with the default
value of 0, so remove these assignments.
Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support")
Cc: stable@vger.kernel.org
Signed-off-by: Ming Qian <ming.qian@oss.nxp.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/amphion/vpu_v4l2.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
index 47dff9a35bb46..1fb887b9098c6 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -670,7 +670,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
src_vq->mem_ops = &vb2_vmalloc_memops;
src_vq->drv_priv = inst;
src_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
- src_vq->min_queued_buffers = 1;
src_vq->dev = inst->vpu->dev;
src_vq->lock = &inst->lock;
ret = vb2_queue_init(src_vq);
@@ -687,7 +686,6 @@ static int vpu_m2m_queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_q
dst_vq->mem_ops = &vb2_vmalloc_memops;
dst_vq->drv_priv = inst;
dst_vq->buf_struct_size = sizeof(struct vpu_vb2_buffer);
- dst_vq->min_queued_buffers = 1;
dst_vq->dev = inst->vpu->dev;
dst_vq->lock = &inst->lock;
ret = vb2_queue_init(dst_vq);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 508/752] media: rockchip: rga: Fix possible ERR_PTR dereference in rga_buf_init()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (51 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 507/752] media: amphion: Drop min_queued_buffers assignment Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 509/752] media: verisilicon: AV1: Set IDR flag for intra_only frame type Sasha Levin
` (231 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Alper Ak, stable, Michael Tretter, Nicolas Dufresne, Hans Verkuil,
Sasha Levin
From: Alper Ak <alperyasinak1@gmail.com>
[ Upstream commit 81f8e0e6a2e115df9274d0289779f8fca694479c ]
rga_get_frame() can return ERR_PTR(-EINVAL) when buffer type is
unsupported or invalid. rga_buf_init() does not check the return value
and unconditionally dereferences the pointer when accessing f->size.
Add proper ERR_PTR checking and return the error to prevent
dereferencing an invalid pointer.
Fixes: 6040702ade23 ("media: rockchip: rga: allocate DMA descriptors per buffer")
Cc: stable@vger.kernel.org
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/rockchip/rga/rga-buf.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/rockchip/rga/rga-buf.c b/drivers/media/platform/rockchip/rga/rga-buf.c
index 730bdf98565a5..bb575873f2b24 100644
--- a/drivers/media/platform/rockchip/rga/rga-buf.c
+++ b/drivers/media/platform/rockchip/rga/rga-buf.c
@@ -80,6 +80,9 @@ static int rga_buf_init(struct vb2_buffer *vb)
struct rga_frame *f = rga_get_frame(ctx, vb->vb2_queue->type);
size_t n_desc = 0;
+ if (IS_ERR(f))
+ return PTR_ERR(f);
+
n_desc = DIV_ROUND_UP(f->size, PAGE_SIZE);
rbuf->n_desc = n_desc;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 509/752] media: verisilicon: AV1: Set IDR flag for intra_only frame type
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (52 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 508/752] media: rockchip: rga: Fix possible ERR_PTR dereference in rga_buf_init() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 510/752] media: radio-keene: fix memory leak in error path Sasha Levin
` (230 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Benjamin Gaignard, Jianfeng Liu, stable, Nicolas Dufresne,
Hans Verkuil, Sasha Levin
From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
[ Upstream commit 1c1b79f40ee4444fa1ac96079751608b724c6b2b ]
Intra_only frame could be considered as a key frame so Instantaneous
Decoding Refresh (IDR) flag must be set of the both case and not only
for key frames.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Reported-by: Jianfeng Liu <liujianfeng1994@gmail.com>
Fixes: 727a400686a2c ("media: verisilicon: Add Rockchip AV1 decoder")
Cc: stable@vger.kernel.org
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
index f52b8208e6b93..500e94bcb0293 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
@@ -2018,7 +2018,7 @@ static void rockchip_vpu981_av1_dec_set_parameters(struct hantro_ctx *ctx)
!!(ctrls->frame->quantization.flags
& V4L2_AV1_QUANTIZATION_FLAG_DELTA_Q_PRESENT));
- hantro_reg_write(vpu, &av1_idr_pic_e, !ctrls->frame->frame_type);
+ hantro_reg_write(vpu, &av1_idr_pic_e, IS_INTRA(ctrls->frame->frame_type));
hantro_reg_write(vpu, &av1_quant_base_qindex, ctrls->frame->quantization.base_q_idx);
hantro_reg_write(vpu, &av1_bit_depth_y_minus8, ctx->bit_depth - 8);
hantro_reg_write(vpu, &av1_bit_depth_c_minus8, ctx->bit_depth - 8);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 510/752] media: radio-keene: fix memory leak in error path
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (53 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 509/752] media: verisilicon: AV1: Set IDR flag for intra_only frame type Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 511/752] media: cx88: Add missing unmap in snd_cx88_hw_params() Sasha Levin
` (229 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Shaurya Rane, syzbot+a41b73dce23962a74c72, stable, Hans Verkuil,
Sasha Levin
From: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
[ Upstream commit b8bf939d77c0cd01118e953bbf554e0fa15e9006 ]
Fix a memory leak in usb_keene_probe(). The v4l2 control handler is
initialized and controls are added, but if v4l2_device_register() or
video_register_device() fails afterward, the handler was never freed,
leaking memory.
Add v4l2_ctrl_handler_free() call in the err_v4l2 error path to ensure
the control handler is properly freed for all error paths after it is
initialized.
Reported-by: syzbot+a41b73dce23962a74c72@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=a41b73dce23962a74c72
Fixes: 1bf20c3a0c61 ("[media] radio-keene: add a driver for the Keene FM Transmitter")
Cc: stable@vger.kernel.org
Signed-off-by: Shaurya Rane <ssrane_b23@ee.vjti.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/radio/radio-keene.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/radio/radio-keene.c b/drivers/media/radio/radio-keene.c
index f3b57f0cb1ec4..c133305fd0194 100644
--- a/drivers/media/radio/radio-keene.c
+++ b/drivers/media/radio/radio-keene.c
@@ -338,7 +338,6 @@ static int usb_keene_probe(struct usb_interface *intf,
if (hdl->error) {
retval = hdl->error;
- v4l2_ctrl_handler_free(hdl);
goto err_v4l2;
}
retval = v4l2_device_register(&intf->dev, &radio->v4l2_dev);
@@ -384,6 +383,7 @@ static int usb_keene_probe(struct usb_interface *intf,
err_vdev:
v4l2_device_unregister(&radio->v4l2_dev);
err_v4l2:
+ v4l2_ctrl_handler_free(&radio->hdl);
kfree(radio->buffer);
kfree(radio);
err:
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 511/752] media: cx88: Add missing unmap in snd_cx88_hw_params()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (54 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 510/752] media: radio-keene: fix memory leak in error path Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 512/752] media: cx23885: Add missing unmap in snd_cx23885_hw_params() Sasha Levin
` (228 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Hans Verkuil, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit dbc527d980f7ba8559de38f8c1e4158c71a78915 ]
In error path, add cx88_alsa_dma_unmap() to release
resource acquired by cx88_alsa_dma_map().
Fixes: b2c75abde0de ("[media] cx88: drop videobuf abuse in cx88-alsa")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/pci/cx88/cx88-alsa.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/pci/cx88/cx88-alsa.c b/drivers/media/pci/cx88/cx88-alsa.c
index 29fb1311e4434..4e574d8390b4d 100644
--- a/drivers/media/pci/cx88/cx88-alsa.c
+++ b/drivers/media/pci/cx88/cx88-alsa.c
@@ -483,8 +483,10 @@ static int snd_cx88_hw_params(struct snd_pcm_substream *substream,
ret = cx88_risc_databuffer(chip->pci, &buf->risc, buf->sglist,
chip->period_size, chip->num_periods, 1);
- if (ret < 0)
+ if (ret < 0) {
+ cx88_alsa_dma_unmap(chip);
goto error;
+ }
/* Loop back to start of program */
buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_IRQ1 | RISC_CNT_INC);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 512/752] media: cx23885: Add missing unmap in snd_cx23885_hw_params()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (55 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 511/752] media: cx88: Add missing unmap in snd_cx88_hw_params() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 513/752] media: cx25821: Add missing unmap in snd_cx25821_hw_params() Sasha Levin
` (227 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Hans Verkuil, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit 141c81849fab2ad4d6e3fdaff7cbaa873e8b5eb2 ]
In error path, add cx23885_alsa_dma_unmap() to release the
resource acquired by cx23885_alsa_dma_map().
Fixes: 9529a4b0cf49 ("[media] cx23885: drop videobuf abuse in cx23885-alsa")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/pci/cx23885/cx23885-alsa.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/pci/cx23885/cx23885-alsa.c b/drivers/media/pci/cx23885/cx23885-alsa.c
index 25dc8d4dc5b73..717fc6c9ef21f 100644
--- a/drivers/media/pci/cx23885/cx23885-alsa.c
+++ b/drivers/media/pci/cx23885/cx23885-alsa.c
@@ -392,8 +392,10 @@ static int snd_cx23885_hw_params(struct snd_pcm_substream *substream,
ret = cx23885_risc_databuffer(chip->pci, &buf->risc, buf->sglist,
chip->period_size, chip->num_periods, 1);
- if (ret < 0)
+ if (ret < 0) {
+ cx23885_alsa_dma_unmap(chip);
goto error;
+ }
/* Loop back to start of program */
buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 513/752] media: cx25821: Add missing unmap in snd_cx25821_hw_params()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (56 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 512/752] media: cx23885: Add missing unmap in snd_cx23885_hw_params() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 514/752] media: i2c/tw9903: Fix potential memory leak in tw9903_probe() Sasha Levin
` (226 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Hans Verkuil, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit 863f50d583445c3c8b28a0fc4bb9c18fd9656f41 ]
In error path, add cx25821_alsa_dma_unmap() to release the
resource acquired by cx25821_alsa_dma_map()
Fixes: 8d8e6d6005de ("[media] cx28521: drop videobuf abuse in cx25821-alsa")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/pci/cx25821/cx25821-alsa.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/pci/cx25821/cx25821-alsa.c b/drivers/media/pci/cx25821/cx25821-alsa.c
index a42f0c03a7ca8..f463365163b7e 100644
--- a/drivers/media/pci/cx25821/cx25821-alsa.c
+++ b/drivers/media/pci/cx25821/cx25821-alsa.c
@@ -535,6 +535,7 @@ static int snd_cx25821_hw_params(struct snd_pcm_substream *substream,
chip->period_size, chip->num_periods, 1);
if (ret < 0) {
pr_info("DEBUG: ERROR after cx25821_risc_databuffer_audio()\n");
+ cx25821_alsa_dma_unmap(chip);
goto error;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 514/752] media: i2c/tw9903: Fix potential memory leak in tw9903_probe()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (57 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 513/752] media: cx25821: Add missing unmap in snd_cx25821_hw_params() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 515/752] media: i2c/tw9906: Fix potential memory leak in tw9906_probe() Sasha Levin
` (225 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Abdun Nihaal, stable, Hans Verkuil, Sasha Levin
From: Abdun Nihaal <nihaal@cse.iitm.ac.in>
[ Upstream commit 9cea16fea47e5553f51d10957677ff735b1eff03 ]
In one of the error paths in tw9903_probe(), the memory allocated in
v4l2_ctrl_handler_init() and v4l2_ctrl_new_std() is not freed. Fix that
by calling v4l2_ctrl_handler_free() on the handler in that error path.
Cc: stable@vger.kernel.org
Fixes: 0890ec19c65d ("[media] tw9903: add new tw9903 video decoder")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/tw9903.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/i2c/tw9903.c b/drivers/media/i2c/tw9903.c
index b996a05e56f28..c3eafd5d5dc82 100644
--- a/drivers/media/i2c/tw9903.c
+++ b/drivers/media/i2c/tw9903.c
@@ -228,6 +228,7 @@ static int tw9903_probe(struct i2c_client *client)
if (write_regs(sd, initial_registers) < 0) {
v4l2_err(client, "error initializing TW9903\n");
+ v4l2_ctrl_handler_free(hdl);
return -EINVAL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 515/752] media: i2c/tw9906: Fix potential memory leak in tw9906_probe()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (58 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 514/752] media: i2c/tw9903: Fix potential memory leak in tw9903_probe() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 516/752] media: i2c: ov01a10: Fix the horizontal flip control Sasha Levin
` (224 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches; +Cc: Abdun Nihaal, stable, Hans Verkuil, Sasha Levin
From: Abdun Nihaal <nihaal@cse.iitm.ac.in>
[ Upstream commit cad237b6c875fbee5d353a2b289e98d240d17ec8 ]
In one of the error paths in tw9906_probe(), the memory allocated in
v4l2_ctrl_handler_init() and v4l2_ctrl_new_std() is not freed. Fix that
by calling v4l2_ctrl_handler_free() on the handler in that error path.
Cc: stable@vger.kernel.org
Fixes: a000e9a02b58 ("[media] tw9906: add Techwell tw9906 video decoder")
Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/tw9906.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/i2c/tw9906.c b/drivers/media/i2c/tw9906.c
index 6220f4fddbabc..0ab43fe42d7f4 100644
--- a/drivers/media/i2c/tw9906.c
+++ b/drivers/media/i2c/tw9906.c
@@ -196,6 +196,7 @@ static int tw9906_probe(struct i2c_client *client)
if (write_regs(sd, initial_registers) < 0) {
v4l2_err(client, "error initializing TW9906\n");
+ v4l2_ctrl_handler_free(hdl);
return -EINVAL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 516/752] media: i2c: ov01a10: Fix the horizontal flip control
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (59 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 515/752] media: i2c/tw9906: Fix potential memory leak in tw9906_probe() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 517/752] media: i2c: ov01a10: Fix reported pixel-rate value Sasha Levin
` (223 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Hans de Goede, stable, Mehdi Djait, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Hans de Goede <hansg@kernel.org>
[ Upstream commit ada20c3db0db4f2834d9515f6105111871f04a4d ]
During sensor calibration I noticed that with the hflip control set
to false/disabled the image was mirrored.
So it seems that the horizontal flip control is inverted and needs to
be set to 1 to not flip (just like the similar problem recently fixed
on the ov08x40 sensor).
Invert the hflip control to fix the sensor mirroring by default.
As the comment above the newly added OV01A10_MEDIA_BUS_FMT define explains
the control being inverted also means that the native Bayer-order of
the sensor actually is GBRG not BGGR, but so as to not break userspace
the Bayer-order is kept at BGGR.
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index 141cb6f75b555..e5df01f979781 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -75,6 +75,15 @@
#define OV01A10_REG_X_WIN 0x3811
#define OV01A10_REG_Y_WIN 0x3813
+/*
+ * The native ov01a10 bayer-pattern is GBRG, but there was a driver bug enabling
+ * hflip/mirroring by default resulting in BGGR. Because of this bug Intel's
+ * proprietary IPU6 userspace stack expects BGGR. So we report BGGR to not break
+ * userspace and fix things up by shifting the crop window-x coordinate by 1
+ * when hflip is *disabled*.
+ */
+#define OV01A10_MEDIA_BUS_FMT MEDIA_BUS_FMT_SBGGR10_1X10
+
struct ov01a10_reg {
u16 address;
u8 val;
@@ -185,14 +194,14 @@ static const struct ov01a10_reg sensor_1280x800_setting[] = {
{0x380e, 0x03},
{0x380f, 0x80},
{0x3810, 0x00},
- {0x3811, 0x08},
+ {0x3811, 0x09},
{0x3812, 0x00},
{0x3813, 0x08},
{0x3814, 0x01},
{0x3815, 0x01},
{0x3816, 0x01},
{0x3817, 0x01},
- {0x3820, 0xa0},
+ {0x3820, 0xa8},
{0x3822, 0x13},
{0x3832, 0x28},
{0x3833, 0x10},
@@ -411,7 +420,7 @@ static int ov01a10_set_hflip(struct ov01a10 *ov01a10, u32 hflip)
int ret;
u32 val, offset;
- offset = hflip ? 0x9 : 0x8;
+ offset = hflip ? 0x8 : 0x9;
ret = ov01a10_write_reg(ov01a10, OV01A10_REG_X_WIN, 1, offset);
if (ret)
return ret;
@@ -420,8 +429,8 @@ static int ov01a10_set_hflip(struct ov01a10 *ov01a10, u32 hflip)
if (ret)
return ret;
- val = hflip ? val | FIELD_PREP(OV01A10_HFLIP_MASK, 0x1) :
- val & ~OV01A10_HFLIP_MASK;
+ val = hflip ? val & ~OV01A10_HFLIP_MASK :
+ val | FIELD_PREP(OV01A10_HFLIP_MASK, 0x1);
return ov01a10_write_reg(ov01a10, OV01A10_REG_FORMAT1, 1, val);
}
@@ -610,7 +619,7 @@ static void ov01a10_update_pad_format(const struct ov01a10_mode *mode,
{
fmt->width = mode->width;
fmt->height = mode->height;
- fmt->code = MEDIA_BUS_FMT_SBGGR10_1X10;
+ fmt->code = OV01A10_MEDIA_BUS_FMT;
fmt->field = V4L2_FIELD_NONE;
fmt->colorspace = V4L2_COLORSPACE_RAW;
}
@@ -751,7 +760,7 @@ static int ov01a10_enum_mbus_code(struct v4l2_subdev *sd,
if (code->index > 0)
return -EINVAL;
- code->code = MEDIA_BUS_FMT_SBGGR10_1X10;
+ code->code = OV01A10_MEDIA_BUS_FMT;
return 0;
}
@@ -761,7 +770,7 @@ static int ov01a10_enum_frame_size(struct v4l2_subdev *sd,
struct v4l2_subdev_frame_size_enum *fse)
{
if (fse->index >= ARRAY_SIZE(supported_modes) ||
- fse->code != MEDIA_BUS_FMT_SBGGR10_1X10)
+ fse->code != OV01A10_MEDIA_BUS_FMT)
return -EINVAL;
fse->min_width = supported_modes[fse->index].width;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 517/752] media: i2c: ov01a10: Fix reported pixel-rate value
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (60 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 516/752] media: i2c: ov01a10: Fix the horizontal flip control Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 518/752] media: i2c: ov01a10: Fix analogue gain range Sasha Levin
` (222 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Hans de Goede, stable, Mehdi Djait, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Hans de Goede <hansg@kernel.org>
[ Upstream commit 9c632eebf6af4cb7b0f85503fe1ebc5176ff0db1 ]
CSI lanes are double-clocked so with a single lane at 400MHZ the resulting
pixel-rate for 10-bits pixels is 400 MHz * 2 / 10 = 80 MHz, not 40 MHz.
This also matches with the observed frame-rate of 60 fps with the default
vblank setting: 80000000 / (1488 * 896) = 60.
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index e5df01f979781..0b1a1ecfffd0e 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -16,7 +16,7 @@
#include <media/v4l2-fwnode.h>
#define OV01A10_LINK_FREQ_400MHZ 400000000ULL
-#define OV01A10_SCLK 40000000LL
+#define OV01A10_SCLK 80000000LL
#define OV01A10_DATA_LANES 1
#define OV01A10_REG_CHIP_ID 0x300a
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 518/752] media: i2c: ov01a10: Fix analogue gain range
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (61 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 517/752] media: i2c: ov01a10: Fix reported pixel-rate value Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 519/752] media: i2c: ov01a10: Add missing v4l2_subdev_cleanup() calls Sasha Levin
` (221 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Hans de Goede, stable, Mehdi Djait, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Hans de Goede <hansg@kernel.org>
[ Upstream commit 109e0feacaeca5ec2dd71d7d17c73232ce5cbddc ]
A analogue maximum gain of 0xffff / 65525 seems unlikely and testing
indeed shows that the gain control wraps-around at 16383, so set the
maximum gain to 0x3fff / 16383.
The minimum gain of 0x100 is correct. Setting bits 8-11 to 0x0 results
in the same gain values as setting these bits to 0x1, with bits 0-7
still increasing the gain when going from 0x000 - 0x0ff in the exact
same range as when going from 0x100 - 0x1ff.
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
[Sakari Ailus: mention analogue gain and update the limit from 4096.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index 0b1a1ecfffd0e..834ca46acb75f 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -48,7 +48,7 @@
/* analog gain controls */
#define OV01A10_REG_ANALOG_GAIN 0x3508
#define OV01A10_ANAL_GAIN_MIN 0x100
-#define OV01A10_ANAL_GAIN_MAX 0xffff
+#define OV01A10_ANAL_GAIN_MAX 0x3fff
#define OV01A10_ANAL_GAIN_STEP 1
/* digital gain controls */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 519/752] media: i2c: ov01a10: Add missing v4l2_subdev_cleanup() calls
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (62 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 518/752] media: i2c: ov01a10: Fix analogue gain range Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 520/752] media: i2c: ov01a10: Fix passing stream instead of pad to v4l2_subdev_state_get_format() Sasha Levin
` (220 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Hans de Goede, stable, Mehdi Djait, Bingbu Cao, Sakari Ailus,
Hans Verkuil, Sasha Levin
From: Hans de Goede <hansg@kernel.org>
[ Upstream commit 0dfec6e30c334364145d0acb38bb8c216b9a7a78 ]
Add missing v4l2_subdev_cleanup() calls to cleanup after
v4l2_subdev_init_finalize().
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index 834ca46acb75f..1e22df12989ae 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -864,6 +864,7 @@ static void ov01a10_remove(struct i2c_client *client)
struct v4l2_subdev *sd = i2c_get_clientdata(client);
v4l2_async_unregister_subdev(sd);
+ v4l2_subdev_cleanup(sd);
media_entity_cleanup(&sd->entity);
v4l2_ctrl_handler_free(sd->ctrl_handler);
@@ -934,6 +935,7 @@ static int ov01a10_probe(struct i2c_client *client)
err_pm_disable:
pm_runtime_disable(dev);
pm_runtime_set_suspended(&client->dev);
+ v4l2_subdev_cleanup(&ov01a10->sd);
err_media_entity_cleanup:
media_entity_cleanup(&ov01a10->sd.entity);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 520/752] media: i2c: ov01a10: Fix passing stream instead of pad to v4l2_subdev_state_get_format()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (63 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 519/752] media: i2c: ov01a10: Add missing v4l2_subdev_cleanup() calls Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 521/752] media: i2c: ov01a10: Fix test-pattern disabling Sasha Levin
` (219 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Hans de Goede, stable, Mehdi Djait, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Hans de Goede <hansg@kernel.org>
[ Upstream commit f8563a375e7fba7c776eb591d4498be592c19098 ]
The 2 argument version of v4l2_subdev_state_get_format() takes the pad
as second argument, not the stream.
Fixes: bc0e8d91feec ("media: v4l: subdev: Switch to stream-aware state functions")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index 1e22df12989ae..dd2b6d381175a 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -731,7 +731,7 @@ static int ov01a10_set_format(struct v4l2_subdev *sd,
h_blank);
}
- format = v4l2_subdev_state_get_format(sd_state, fmt->stream);
+ format = v4l2_subdev_state_get_format(sd_state, fmt->pad);
*format = fmt->format;
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 521/752] media: i2c: ov01a10: Fix test-pattern disabling
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (64 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 520/752] media: i2c: ov01a10: Fix passing stream instead of pad to v4l2_subdev_state_get_format() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 522/752] media: qcom: camss: vfe: Fix out-of-bounds access in vfe_isr_reg_update() Sasha Levin
` (218 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Hans de Goede, stable, Mehdi Djait, Bingbu Cao, Sakari Ailus,
Hans Verkuil, Sasha Levin
From: Hans de Goede <hansg@kernel.org>
[ Upstream commit 409fb57c1b3deada4b8e153eb6344afb3c2dfb9c ]
When the test-pattern control gets set to 0 (Disabled) 0 should be written
to the test-pattern register, rather then doing nothing.
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Hans de Goede <hansg@kernel.org>
Tested-by: Mehdi Djait <mehdi.djait@linux.intel.com> # Dell XPS 9315
Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Reviewed-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index dd2b6d381175a..3ad516e4d3698 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -249,9 +249,8 @@ static const struct ov01a10_reg sensor_1280x800_setting[] = {
static const char * const ov01a10_test_pattern_menu[] = {
"Disabled",
"Color Bar",
- "Top-Bottom Darker Color Bar",
- "Right-Left Darker Color Bar",
- "Color Bar type 4",
+ "Left-Right Darker Color Bar",
+ "Bottom-Top Darker Color Bar",
};
static const s64 link_freq_menu_items[] = {
@@ -406,10 +405,8 @@ static int ov01a10_update_digital_gain(struct ov01a10 *ov01a10, u32 d_gain)
static int ov01a10_test_pattern(struct ov01a10 *ov01a10, u32 pattern)
{
- if (!pattern)
- return 0;
-
- pattern = (pattern - 1) | OV01A10_TEST_PATTERN_ENABLE;
+ if (pattern)
+ pattern |= OV01A10_TEST_PATTERN_ENABLE;
return ov01a10_write_reg(ov01a10, OV01A10_REG_TEST_PATTERN, 1, pattern);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 522/752] media: qcom: camss: vfe: Fix out-of-bounds access in vfe_isr_reg_update()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (65 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 521/752] media: i2c: ov01a10: Fix test-pattern disabling Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 523/752] media: ccs: Avoid possible division by zero Sasha Levin
` (217 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Alper Ak, stable, Bryan O'Donoghue, Bryan O'Donoghue,
Hans Verkuil, Sasha Levin
From: Alper Ak <alperyasinak1@gmail.com>
[ Upstream commit d965919af524e68cb2ab1a685872050ad2ee933d ]
vfe_isr() iterates using MSM_VFE_IMAGE_MASTERS_NUM(7) as the loop
bound and passes the index to vfe_isr_reg_update(). However,
vfe->line[] array is defined with VFE_LINE_NUM_MAX(4):
struct vfe_line line[VFE_LINE_NUM_MAX];
When index is 4, 5, 6, the access to vfe->line[line_id] exceeds
the array bounds and resulting in out-of-bounds memory access.
Fix this by using separate loops for output lines and write masters.
Fixes: 4edc8eae715c ("media: camss: Add initial support for VFE hardware version Titan 480")
Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/camss/camss-vfe-480.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss-vfe-480.c b/drivers/media/platform/qcom/camss/camss-vfe-480.c
index 4feea590a47bc..d73f733fde045 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe-480.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe-480.c
@@ -202,11 +202,13 @@ static irqreturn_t vfe_isr(int irq, void *dev)
writel_relaxed(status, vfe->base + VFE_BUS_IRQ_CLEAR(0));
writel_relaxed(1, vfe->base + VFE_BUS_IRQ_CLEAR_GLOBAL);
- /* Loop through all WMs IRQs */
- for (i = 0; i < MSM_VFE_IMAGE_MASTERS_NUM; i++) {
+ for (i = 0; i < MAX_VFE_OUTPUT_LINES; i++) {
if (status & BUS_IRQ_MASK_0_RDI_RUP(vfe, i))
vfe_isr_reg_update(vfe, i);
+ }
+ /* Loop through all WMs IRQs */
+ for (i = 0; i < MSM_VFE_IMAGE_MASTERS_NUM; i++) {
if (status & BUS_IRQ_MASK_0_COMP_DONE(vfe, RDI_COMP_GROUP(i)))
vfe_buf_done(vfe, i);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 523/752] media: ccs: Avoid possible division by zero
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (66 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 522/752] media: qcom: camss: vfe: Fix out-of-bounds access in vfe_isr_reg_update() Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 524/752] media: i2c: ov5647: Initialize subdev before controls Sasha Levin
` (216 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Sakari Ailus, Josh Poimboeuf, stable, Nathan Chancellor,
Hans Verkuil, Sasha Levin
From: Sakari Ailus <sakari.ailus@linux.intel.com>
[ Upstream commit 679f0b7b6a409750a25754c8833e268e5fdde742 ]
Calculating maximum M for scaler configuration involves dividing by
MIN_X_OUTPUT_SIZE limit register's value. Albeit the value is presumably
non-zero, the driver was missing the check it in fact was. Fix this.
Reported-by: Josh Poimboeuf <jpoimboe@kernel.org>
Closes: https://lore.kernel.org/all/ahukd6b3wonye3zgtptvwzvrxldcruazs2exfvll6etjhmcxyj@vq3eh6pd375b/
Fixes: ccfc97bdb5ae ("[media] smiapp: Add driver")
Cc: stable@vger.kernel.org # for 5.15 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org> # build
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ccs/ccs-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index 08e78f0bf2528..01ddfa332c700 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -2346,7 +2346,7 @@ static void ccs_set_compose_scaler(struct v4l2_subdev *subdev,
* CCS_LIM(sensor, SCALER_N_MIN) / sel->r.height;
max_m = crops[CCS_PAD_SINK]->width
* CCS_LIM(sensor, SCALER_N_MIN)
- / CCS_LIM(sensor, MIN_X_OUTPUT_SIZE);
+ / (CCS_LIM(sensor, MIN_X_OUTPUT_SIZE) ?: 1);
a = clamp(a, CCS_LIM(sensor, SCALER_M_MIN),
CCS_LIM(sensor, SCALER_M_MAX));
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 524/752] media: i2c: ov5647: Initialize subdev before controls
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (67 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 523/752] media: ccs: Avoid possible division by zero Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 525/752] media: i2c: ov5647: Correct pixel array offset Sasha Levin
` (215 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Jai Luthra, stable, Jacopo Mondi, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Jai Luthra <jai.luthra@ideasonboard.com>
[ Upstream commit eee13cbccacb6d0a3120c126b8544030905b069d ]
In ov5647_init_controls() we call v4l2_get_subdevdata, but it is
initialized by v4l2_i2c_subdev_init() in the probe, which currently
happens after init_controls(). This can result in a segfault if the
error condition is hit, and we try to access i2c_client, so fix the
order.
Fixes: 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
Cc: stable@vger.kernel.org
Suggested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5647.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index e193fef4fcedf..f9fac858dc7ba 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1420,15 +1420,15 @@ static int ov5647_probe(struct i2c_client *client)
sensor->mode = OV5647_DEFAULT_MODE;
- ret = ov5647_init_controls(sensor);
- if (ret)
- goto mutex_destroy;
-
sd = &sensor->sd;
v4l2_i2c_subdev_init(sd, client, &ov5647_subdev_ops);
sd->internal_ops = &ov5647_subdev_internal_ops;
sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE | V4L2_SUBDEV_FL_HAS_EVENTS;
+ ret = ov5647_init_controls(sensor);
+ if (ret)
+ goto mutex_destroy;
+
sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
ret = media_entity_pads_init(&sd->entity, 1, &sensor->pad);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 525/752] media: i2c: ov5647: Correct pixel array offset
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (68 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 524/752] media: i2c: ov5647: Initialize subdev before controls Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 526/752] media: i2c: ov5647: Correct minimum VBLANK value Sasha Levin
` (214 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: David Plowman, stable, Jacopo Mondi, Jai Luthra, Sakari Ailus,
Hans Verkuil, Sasha Levin
From: David Plowman <david.plowman@raspberrypi.com>
[ Upstream commit a4e62e597f21bb37db0ad13aca486094e9188167 ]
The top offset in the pixel array is actually 6 (see page 3-1 of the
OV5647 data sheet).
Fixes: 14f70a3232aa ("media: ov5647: Add support for get_selection()")
Cc: stable@vger.kernel.org
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5647.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index f9fac858dc7ba..d9e300406f58e 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -69,7 +69,7 @@
#define OV5647_NATIVE_HEIGHT 1956U
#define OV5647_PIXEL_ARRAY_LEFT 16U
-#define OV5647_PIXEL_ARRAY_TOP 16U
+#define OV5647_PIXEL_ARRAY_TOP 6U
#define OV5647_PIXEL_ARRAY_WIDTH 2592U
#define OV5647_PIXEL_ARRAY_HEIGHT 1944U
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 526/752] media: i2c: ov5647: Correct minimum VBLANK value
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (69 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 525/752] media: i2c: ov5647: Correct pixel array offset Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 527/752] media: i2c: ov5647: Sensor should report RAW color space Sasha Levin
` (213 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: David Plowman, stable, Jacopo Mondi, Jai Luthra, Sakari Ailus,
Hans Verkuil, Sasha Levin
From: David Plowman <david.plowman@raspberrypi.com>
[ Upstream commit 1438248c5a82c86b4e1f0311c3bb827af747a8cf ]
Trial and error reveals that the minimum vblank value appears to be 24
(the OV5647 data sheet does not give any clues). This fixes streaming
lock-ups in full resolution mode.
Fixes: 2512c06441e3 ("media: ov5647: Support V4L2_CID_VBLANK control")
Cc: stable@vger.kernel.org
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5647.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index d9e300406f58e..191954497e3db 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -73,7 +73,7 @@
#define OV5647_PIXEL_ARRAY_WIDTH 2592U
#define OV5647_PIXEL_ARRAY_HEIGHT 1944U
-#define OV5647_VBLANK_MIN 4
+#define OV5647_VBLANK_MIN 24
#define OV5647_VTS_MAX 32767
#define OV5647_EXPOSURE_MIN 4
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 527/752] media: i2c: ov5647: Sensor should report RAW color space
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (70 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 526/752] media: i2c: ov5647: Correct minimum VBLANK value Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 528/752] media: i2c: ov5647: Fix PIXEL_RATE value for VGA mode Sasha Levin
` (212 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: David Plowman, stable, Jacopo Mondi, Jai Luthra, Sakari Ailus,
Hans Verkuil, Sasha Levin
From: David Plowman <david.plowman@raspberrypi.com>
[ Upstream commit f007586b1e89dcea40168415d0422cb7a0fc31b1 ]
As this sensor captures RAW bayer frames, the colorspace should be
V4L2_COLORSPACE_RAW instead of SRGB.
Fixes: a8df5af695a1 ("media: ov5647: Add SGGBR10_1X10 modes")
Cc: stable@vger.kernel.org
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5647.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index 191954497e3db..c0f1121b025e5 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -508,7 +508,7 @@ static const struct ov5647_mode ov5647_modes[] = {
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
- .colorspace = V4L2_COLORSPACE_SRGB,
+ .colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 2592,
.height = 1944
@@ -529,7 +529,7 @@ static const struct ov5647_mode ov5647_modes[] = {
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
- .colorspace = V4L2_COLORSPACE_SRGB,
+ .colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 1920,
.height = 1080
@@ -550,7 +550,7 @@ static const struct ov5647_mode ov5647_modes[] = {
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
- .colorspace = V4L2_COLORSPACE_SRGB,
+ .colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 1296,
.height = 972
@@ -571,7 +571,7 @@ static const struct ov5647_mode ov5647_modes[] = {
{
.format = {
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
- .colorspace = V4L2_COLORSPACE_SRGB,
+ .colorspace = V4L2_COLORSPACE_RAW,
.field = V4L2_FIELD_NONE,
.width = 640,
.height = 480
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 528/752] media: i2c: ov5647: Fix PIXEL_RATE value for VGA mode
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (71 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 527/752] media: i2c: ov5647: Sensor should report RAW color space Sasha Levin
@ 2026-02-28 17:43 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 529/752] media: ccs: Fix setting initial sub-device state Sasha Levin
` (211 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:43 UTC (permalink / raw)
To: patches
Cc: Jai Luthra, stable, Dave Stevenson, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Jai Luthra <jai.luthra@ideasonboard.com>
[ Upstream commit c063632b494b02e891442d10f17e37b7fcfab9b3 ]
The pixel rate for VGA (640x480) mode is configured in the mode's table
to be 58.333 MPix/s instead of 55 MPix/s, so fix it.
Fixes: 911f4516ee2b ("media: ov5647: Support V4L2_CID_PIXEL_RATE")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/all/CAPY8ntA2TCf9FuB6Nk%2BOn%2By6N_PMuYPAOAr3Yx8YESwe4skWvw@mail.gmail.com/
Suggested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5647.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index c0f1121b025e5..bf5b0bd8d6acb 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -582,7 +582,7 @@ static const struct ov5647_mode ov5647_modes[] = {
.width = 2560,
.height = 1920,
},
- .pixel_rate = 55000000,
+ .pixel_rate = 58333000,
.hts = 1852,
.vts = 0x1f8,
.reg_list = ov5647_640x480_10bpp,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 529/752] media: ccs: Fix setting initial sub-device state
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (72 preceding siblings ...)
2026-02-28 17:43 ` [PATCH 6.18 528/752] media: i2c: ov5647: Fix PIXEL_RATE value for VGA mode Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 530/752] media: i2c: ov5647: use our own mutex for the ctrl lock Sasha Levin
` (210 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Sakari Ailus, stable, Hans Verkuil, Sasha Levin
From: Sakari Ailus <sakari.ailus@linux.intel.com>
[ Upstream commit 31e5191aa11931b53e1242acef4f4375f00ca523 ]
Fix setting sub-device state for non-source sub-devices.
Fixes: 5755be5f15d9 ("media: v4l2-subdev: Rename .init_cfg() operation to .init_state()")
Cc: stable@vger.kernel.org # for v6.8 and later
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ccs/ccs-core.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index 01ddfa332c700..3f7162f3d1e32 100644
--- a/drivers/media/i2c/ccs/ccs-core.c
+++ b/drivers/media/i2c/ccs/ccs-core.c
@@ -2940,6 +2940,8 @@ static void ccs_cleanup(struct ccs_sensor *sensor)
ccs_free_controls(sensor);
}
+static const struct v4l2_subdev_internal_ops ccs_internal_ops;
+
static int ccs_init_subdev(struct ccs_sensor *sensor,
struct ccs_subdev *ssd, const char *name,
unsigned short num_pads, u32 function,
@@ -2952,8 +2954,10 @@ static int ccs_init_subdev(struct ccs_sensor *sensor,
if (!ssd)
return 0;
- if (ssd != sensor->src)
+ if (ssd != sensor->src) {
v4l2_subdev_init(&ssd->sd, &ccs_ops);
+ ssd->sd.internal_ops = &ccs_internal_ops;
+ }
ssd->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
ssd->sd.entity.function = function;
@@ -3062,6 +3066,10 @@ static const struct media_entity_operations ccs_entity_ops = {
.link_validate = v4l2_subdev_link_validate,
};
+static const struct v4l2_subdev_internal_ops ccs_internal_ops = {
+ .init_state = ccs_init_state,
+};
+
static const struct v4l2_subdev_internal_ops ccs_internal_src_ops = {
.init_state = ccs_init_state,
.registered = ccs_registered,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 530/752] media: i2c: ov5647: use our own mutex for the ctrl lock
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (73 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 529/752] media: ccs: Fix setting initial sub-device state Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 531/752] media: dw9714: Fix powerup sequence Sasha Levin
` (209 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Xiaolei Wang, stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Xiaolei Wang <xiaolei.wang@windriver.com>
[ Upstream commit 973e42fd5d2b397bff34f0c249014902dbf65912 ]
__v4l2_ctrl_handler_setup() and __v4l2_ctrl_modify_range() contains an
assertion to verify that the v4l2_ctrl_handler::lock is held, as it should
only be called when the lock has already been acquired. Therefore use our
own mutex for the ctrl lock, otherwise a warning will be reported.
Fixes: 4974c2f19fd8 ("media: ov5647: Support gain, exposure and AWB controls")
Cc: stable@vger.kernel.org
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>
[Sakari Ailus: Fix a minor conflict.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov5647.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/i2c/ov5647.c b/drivers/media/i2c/ov5647.c
index bf5b0bd8d6acb..5fb10e02ba6e2 100644
--- a/drivers/media/i2c/ov5647.c
+++ b/drivers/media/i2c/ov5647.c
@@ -1291,6 +1291,8 @@ static int ov5647_init_controls(struct ov5647 *sensor)
v4l2_ctrl_handler_init(&sensor->ctrls, 9);
+ sensor->ctrls.lock = &sensor->lock;
+
v4l2_ctrl_new_std(&sensor->ctrls, &ov5647_ctrl_ops,
V4L2_CID_AUTOGAIN, 0, 1, 1, 0);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 531/752] media: dw9714: Fix powerup sequence
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (74 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 530/752] media: i2c: ov5647: use our own mutex for the ctrl lock Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 532/752] media: ipu6: Fix typo and wrong constant in ipu6-mmu.c Sasha Levin
` (208 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Ricardo Ribalda, Hans de Goede, Neil Sun, Naomi Huang, stable,
Sakari Ailus, Hans Verkuil, Sasha Levin
From: Ricardo Ribalda <ribalda@chromium.org>
[ Upstream commit 401aec35ac7bd04b4018a519257b945abb88e26c ]
We have experienced seen multiple I2C errors while doing stress test on
the module:
dw9714 i2c-PRP0001:01: dw9714_vcm_resume I2C failure: -5
dw9714 i2c-PRP0001:01: I2C write fail
Inspecting the powerup sequence we found that it does not match the
documentation at:
https://blog.arducam.com/downloads/DW9714A-DONGWOON(Autofocus_motor_manual).pdf
"""
(2) DW9714A requires waiting time of 12ms after power on. During this
waiting time, the offset calibration of internal amplifier is
operating for minimization of output offset current .
"""
This patch increases the powerup delay to follow the documentation.
Fixes: 9d00ccabfbb5 ("media: i2c: dw9714: Fix occasional probe errors")
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Tested-by: Neil Sun <neil.sun@lcfuturecenter.com>
Reported-by: Naomi Huang <naomi.huang@lcfuturecenter.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/dw9714.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/dw9714.c b/drivers/media/i2c/dw9714.c
index 1e7ad355a388c..3288de539452e 100644
--- a/drivers/media/i2c/dw9714.c
+++ b/drivers/media/i2c/dw9714.c
@@ -149,7 +149,7 @@ static int dw9714_power_up(struct dw9714_device *dw9714_dev)
gpiod_set_value_cansleep(dw9714_dev->powerdown_gpio, 0);
- usleep_range(1000, 2000);
+ usleep_range(12000, 14000);
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 532/752] media: ipu6: Fix typo and wrong constant in ipu6-mmu.c
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (75 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 531/752] media: dw9714: Fix powerup sequence Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 533/752] media: ipu6: Fix RPM reference leak in probe error paths Sasha Levin
` (207 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Bingbu Cao, stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Bingbu Cao <bingbu.cao@intel.com>
[ Upstream commit 3e0fcc91277d5af114a58aaa68f34b44e8d8a411 ]
Fix two coding errors in ipu6-mmu.c:
1. Fix syntax error in page_table_dump() where the closing parenthesis
and semicolon were swapped in the TBL_PHYS_ADDR macro call.
2. Fix incorrect loop bound in alloc_l2_pt(). When initializing L2 page
table entries, the loop was incorrectly using ISP_L1PT_PTES instead
of ISP_L2PT_PTES.
Fixes: 9163d83573e4 ("media: intel/ipu6: add IPU6 DMA mapping API and MMU table")
Cc: stable@vger.kernel.org
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/pci/intel/ipu6/ipu6-mmu.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/pci/intel/ipu6/ipu6-mmu.c b/drivers/media/pci/intel/ipu6/ipu6-mmu.c
index 6d1c0b90169d4..85cc6d5b4dd11 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-mmu.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-mmu.c
@@ -102,7 +102,7 @@ static void page_table_dump(struct ipu6_mmu_info *mmu_info)
if (mmu_info->l1_pt[l1_idx] == mmu_info->dummy_l2_pteval)
continue;
- l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx];)
+ l2_phys = TBL_PHYS_ADDR(mmu_info->l1_pt[l1_idx]);
dev_dbg(mmu_info->dev,
"l1 entry %u; iovas 0x%8.8x-0x%8.8x, at %pap\n",
l1_idx, iova, iova + ISP_PAGE_SIZE, &l2_phys);
@@ -248,7 +248,7 @@ static u32 *alloc_l2_pt(struct ipu6_mmu_info *mmu_info)
dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt);
- for (i = 0; i < ISP_L1PT_PTES; i++)
+ for (i = 0; i < ISP_L2PT_PTES; i++)
pt[i] = mmu_info->dummy_page_pteval;
return pt;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 533/752] media: ipu6: Fix RPM reference leak in probe error paths
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (76 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 532/752] media: ipu6: Fix typo and wrong constant in ipu6-mmu.c Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 534/752] media: staging/ipu7: Ignore interrupts when device is suspended Sasha Levin
` (206 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Bingbu Cao, Stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Bingbu Cao <bingbu.cao@intel.com>
[ Upstream commit 6099f78e4c9223f4de4169d2fd1cded01279da1a ]
Several error paths in ipu6_pci_probe() were jumping directly to
out_ipu6_bus_del_devices without releasing the runtime PM reference.
Add pm_runtime_put_sync() before cleaning up other resources.
Cc: Stable@vger.kernel.org
Fixes: 25fedc021985 ("media: intel/ipu6: add Intel IPU6 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/pci/intel/ipu6/ipu6.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/media/pci/intel/ipu6/ipu6.c b/drivers/media/pci/intel/ipu6/ipu6.c
index 1f4f20b9c94dc..a2768f44017a5 100644
--- a/drivers/media/pci/intel/ipu6/ipu6.c
+++ b/drivers/media/pci/intel/ipu6/ipu6.c
@@ -630,21 +630,21 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (ret) {
dev_err_probe(&isp->pdev->dev, ret,
"Failed to set MMU hardware\n");
- goto out_ipu6_bus_del_devices;
+ goto out_ipu6_rpm_put;
}
ret = ipu6_buttress_map_fw_image(isp->psys, isp->cpd_fw,
&isp->psys->fw_sgt);
if (ret) {
dev_err_probe(&isp->pdev->dev, ret, "failed to map fw image\n");
- goto out_ipu6_bus_del_devices;
+ goto out_ipu6_rpm_put;
}
ret = ipu6_cpd_create_pkg_dir(isp->psys, isp->cpd_fw->data);
if (ret) {
dev_err_probe(&isp->pdev->dev, ret,
"failed to create pkg dir\n");
- goto out_ipu6_bus_del_devices;
+ goto out_ipu6_rpm_put;
}
ret = devm_request_threaded_irq(dev, pdev->irq, ipu6_buttress_isr,
@@ -652,7 +652,7 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
IRQF_SHARED, IPU6_NAME, isp);
if (ret) {
dev_err_probe(dev, ret, "Requesting irq failed\n");
- goto out_ipu6_bus_del_devices;
+ goto out_ipu6_rpm_put;
}
ret = ipu6_buttress_authenticate(isp);
@@ -683,6 +683,8 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
out_free_irq:
devm_free_irq(dev, pdev->irq, isp);
+out_ipu6_rpm_put:
+ pm_runtime_put_sync(&isp->psys->auxdev.dev);
out_ipu6_bus_del_devices:
if (isp->psys) {
ipu6_cpd_free_pkg_dir(isp->psys);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 534/752] media: staging/ipu7: Ignore interrupts when device is suspended
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (77 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 533/752] media: ipu6: Fix RPM reference leak in probe error paths Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 535/752] media: staging/ipu7: Call synchronous RPM suspend in probe failure Sasha Levin
` (205 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Bingbu Cao, Stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Bingbu Cao <bingbu.cao@intel.com>
[ Upstream commit 9ad65684b9285c5d66fb417d50e91a25ef8c994d ]
IPU7 devices have shared interrupts with others. In some case when IPU7
device is suspended, driver get unexpected interrupt and invalid irq
status 0xffffffff from ISR_STATUS and PB LOCAL_STATUS registers as
interrupt is triggered from other device on shared irq line.
In order to avoid this issue use pm_runtime_get_if_active() to check if
IPU7 device is resumed, ignore the invalid irq status and use
synchronize_irq() in suspend.
Cc: Stable@vger.kernel.org
Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/media/ipu7/ipu7-buttress.c | 17 ++++++++++++++++-
drivers/staging/media/ipu7/ipu7.c | 4 ++++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/media/ipu7/ipu7-buttress.c b/drivers/staging/media/ipu7/ipu7-buttress.c
index e5707f5e300ba..40c6c8473357c 100644
--- a/drivers/staging/media/ipu7/ipu7-buttress.c
+++ b/drivers/staging/media/ipu7/ipu7-buttress.c
@@ -342,14 +342,23 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr)
u32 disable_irqs = 0;
u32 irq_status;
unsigned int i;
+ int active;
- pm_runtime_get_noresume(dev);
+ active = pm_runtime_get_if_active(dev);
+ if (active <= 0)
+ return IRQ_NONE;
pb_irq = readl(isp->pb_base + INTERRUPT_STATUS);
writel(pb_irq, isp->pb_base + INTERRUPT_STATUS);
/* check btrs ATS, CFI and IMR errors, BIT(0) is unused for IPU */
pb_local_irq = readl(isp->pb_base + BTRS_LOCAL_INTERRUPT_MASK);
+ if (pb_local_irq == 0xffffffff) {
+ dev_warn_once(dev, "invalid PB irq status\n");
+ pm_runtime_put_noidle(dev);
+ return IRQ_NONE;
+ }
+
if (pb_local_irq & ~BIT(0)) {
dev_warn(dev, "PB interrupt status 0x%x local 0x%x\n", pb_irq,
pb_local_irq);
@@ -370,6 +379,12 @@ irqreturn_t ipu_buttress_isr(int irq, void *isp_ptr)
return IRQ_NONE;
}
+ if (irq_status == 0xffffffff) {
+ dev_warn_once(dev, "invalid irq status 0x%08x\n", irq_status);
+ pm_runtime_put_noidle(dev);
+ return IRQ_NONE;
+ }
+
do {
writel(irq_status, isp->base + BUTTRESS_REG_IRQ_CLEAR);
diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c
index 5cddc09c72bf2..6c8c3eea44acb 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -2684,6 +2684,10 @@ static void ipu7_pci_reset_done(struct pci_dev *pdev)
*/
static int ipu7_suspend(struct device *dev)
{
+ struct pci_dev *pdev = to_pci_dev(dev);
+
+ synchronize_irq(pdev->irq);
+
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 535/752] media: staging/ipu7: Call synchronous RPM suspend in probe failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (78 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 534/752] media: staging/ipu7: Ignore interrupts when device is suspended Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 536/752] media: staging/ipu7: Update CDPHY register settings Sasha Levin
` (204 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Bingbu Cao, Stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Bingbu Cao <bingbu.cao@intel.com>
[ Upstream commit 1433e6ccc25e9ea596683ab66e1c51f37fc7d491 ]
If firmware authentication failed during driver probe, driver call an
asynchronous API to suspend the psys device but the bus device will be
removed soon, thus runtime PM of bus device will be disabled soon, that
will cancel the suspend request, so use synchronous suspend to make
sure the runtime suspend before disabling its RPM.
IPU7 hardware has constraints that the PSYS device must be powered off
before ISYS, otherwise it will cause machine check error.
Cc: Stable@vger.kernel.org
Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/media/ipu7/ipu7.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/ipu7/ipu7.c b/drivers/staging/media/ipu7/ipu7.c
index 6c8c3eea44acb..fa5a1867626f8 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -2620,7 +2620,7 @@ static int ipu7_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
if (!IS_ERR_OR_NULL(isp->isys) && !IS_ERR_OR_NULL(isp->isys->mmu))
ipu7_mmu_cleanup(isp->isys->mmu);
if (!IS_ERR_OR_NULL(isp->psys))
- pm_runtime_put(&isp->psys->auxdev.dev);
+ pm_runtime_put_sync(&isp->psys->auxdev.dev);
ipu7_bus_del_devices(pdev);
release_firmware(isp->cpd_fw);
buttress_exit:
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 536/752] media: staging/ipu7: Update CDPHY register settings
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (79 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 535/752] media: staging/ipu7: Call synchronous RPM suspend in probe failure Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 537/752] media: staging/ipu7: Fix the loop bound in l2 table alloc Sasha Levin
` (203 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Bingbu Cao, Stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Bingbu Cao <bingbu.cao@intel.com>
[ Upstream commit f7923e6bafcad686adb51cc100ba1860f8b43922 ]
Some CPHY settings needs to updated according to the latest guide from
SNPS. This patch program 45ohm for tuning resistance to fix CPHY problem
and update the ITMINRX and GMODE for CPHY.
Cc: Stable@vger.kernel.org
Fixes: a516d36bdc3d ("media: staging/ipu7: add IPU7 input system device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/media/ipu7/ipu7-isys-csi-phy.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c b/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c
index b8c5db7ae3009..d8f3592ad6201 100644
--- a/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c
+++ b/drivers/staging/media/ipu7/ipu7-isys-csi-phy.c
@@ -124,6 +124,7 @@ static const struct cdr_fbk_cap_prog_params table7[] = {
{ 1350, 1589, 4 },
{ 1590, 1949, 5 },
{ 1950, 2499, 6 },
+ { 2500, 3500, 7 },
{ }
};
@@ -838,9 +839,10 @@ static void ipu7_isys_cphy_config(struct ipu7_isys *isys, u8 id, u8 lanes,
dwc_phy_write_mask(isys, id, reg + 0x400 * i,
reset_thresh, 9, 11);
+ /* Tuning ITMINRX to 2 for CPHY */
reg = CORE_DIG_CLANE_0_RW_LP_0;
for (i = 0; i < trios; i++)
- dwc_phy_write_mask(isys, id, reg + 0x400 * i, 1, 12, 15);
+ dwc_phy_write_mask(isys, id, reg + 0x400 * i, 2, 12, 15);
reg = CORE_DIG_CLANE_0_RW_LP_2;
for (i = 0; i < trios; i++)
@@ -860,7 +862,11 @@ static void ipu7_isys_cphy_config(struct ipu7_isys *isys, u8 id, u8 lanes,
for (i = 0; i < (lanes + 1); i++) {
reg = CORE_DIG_IOCTRL_RW_AFE_LANE0_CTRL_2_9 + 0x400 * i;
dwc_phy_write_mask(isys, id, reg, 4U, 0, 2);
- dwc_phy_write_mask(isys, id, reg, 0U, 3, 4);
+ /* Set GMODE to 2 when CPHY >= 1.5Gsps */
+ if (mbps >= 1500)
+ dwc_phy_write_mask(isys, id, reg, 2U, 3, 4);
+ else
+ dwc_phy_write_mask(isys, id, reg, 0U, 3, 4);
reg = CORE_DIG_IOCTRL_RW_AFE_LANE0_CTRL_2_7 + 0x400 * i;
dwc_phy_write_mask(isys, id, reg, cap_prog, 10, 12);
@@ -930,8 +936,9 @@ static int ipu7_isys_phy_config(struct ipu7_isys *isys, u8 id, u8 lanes,
7, 12, 14);
dwc_phy_write_mask(isys, id, CORE_DIG_IOCTRL_RW_AFE_CB_CTRL_2_7,
0, 8, 10);
+ /* resistance tuning: 1 for 45ohm, 0 for 50ohm */
dwc_phy_write_mask(isys, id, CORE_DIG_IOCTRL_RW_AFE_CB_CTRL_2_5,
- 0, 8, 8);
+ 1, 8, 8);
if (aggregation)
phy_mode = isys->csi2[0].phy_mode;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 537/752] media: staging/ipu7: Fix the loop bound in l2 table alloc
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (80 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 536/752] media: staging/ipu7: Update CDPHY register settings Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 538/752] platform/x86: ISST: Add missing write block check Sasha Levin
` (202 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Bingbu Cao, stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Bingbu Cao <bingbu.cao@intel.com>
[ Upstream commit 98cc19a353abc8b48b7d58fd7a455e09e7c3aba3 ]
This patch fixes the incorrect loop bound in alloc_l2_pt(). When
initializing L2 page table entries, the loop was incorrectly using
ISP_L1PT_PTES instead of ISP_L2PT_PTES though the ISP_L1PT_PTES is
equal to ISP_L2PT_PTES.
Fixes: 71d81c25683a ("media: staging/ipu7: add IPU7 DMA APIs and MMU mapping")
Cc: stable@vger.kernel.org
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/media/ipu7/ipu7-mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/ipu7/ipu7-mmu.c b/drivers/staging/media/ipu7/ipu7-mmu.c
index ded1986eb8ba3..ea35cce4830ad 100644
--- a/drivers/staging/media/ipu7/ipu7-mmu.c
+++ b/drivers/staging/media/ipu7/ipu7-mmu.c
@@ -231,7 +231,7 @@ static u32 *alloc_l2_pt(struct ipu7_mmu_info *mmu_info)
dev_dbg(mmu_info->dev, "alloc_l2: get_zeroed_page() = %p\n", pt);
- for (i = 0; i < ISP_L1PT_PTES; i++)
+ for (i = 0; i < ISP_L2PT_PTES; i++)
pt[i] = mmu_info->dummy_page_pteval;
return pt;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 538/752] platform/x86: ISST: Add missing write block check
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (81 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 537/752] media: staging/ipu7: Fix the loop bound in l2 table alloc Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 539/752] platform/x86: ISST: Store and restore all domains data Sasha Levin
` (201 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Srinivas Pandruvada, stable, Ilpo Järvinen, Sasha Levin
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ Upstream commit 0e5aef2795008c80c515f6fa04e377c6e5715958 ]
If writes are blocked, then return error during SST-CP enable command.
Add missing write block check in this code path.
Fixes: 8bed9ff7dbcc ("platform/x86: ISST: Process read/write blocked feature status")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260107060256.1634188-2-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index 34bff2f65a835..f587709ddd473 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -612,6 +612,9 @@ static long isst_if_core_power_state(void __user *argp)
return -EINVAL;
if (core_power.get_set) {
+ if (power_domain_info->write_blocked)
+ return -EPERM;
+
_write_cp_info("cp_enable", core_power.enable, SST_CP_CONTROL_OFFSET,
SST_CP_ENABLE_START, SST_CP_ENABLE_WIDTH, SST_MUL_FACTOR_NONE)
_write_cp_info("cp_prio_type", core_power.priority_type, SST_CP_CONTROL_OFFSET,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 539/752] platform/x86: ISST: Store and restore all domains data
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (82 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 538/752] platform/x86: ISST: Add missing write block check Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 540/752] dm-integrity: fix a typo in the code for write/discard race Sasha Levin
` (200 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Srinivas Pandruvada, stable, Ilpo Järvinen, Sasha Levin
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
[ Upstream commit dc7901b5a1563a9c9eb29b3b0b0dac3162065cd8 ]
The suspend/resume callbacks currently only store and restore the
configuration for power domain 0. However, other power domains may also
have modified configurations that need to be preserved across suspend/
resume cycles.
Extend the store/restore functionality to handle all power domains.
Fixes: 91576acab020 ("platform/x86: ISST: Add suspend/resume callbacks")
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
CC: stable@vger.kernel.org
Link: https://patch.msgid.link/20260107060256.1634188-3-srinivas.pandruvada@linux.intel.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../intel/speed_select_if/isst_tpmi_core.c | 54 +++++++++++--------
1 file changed, 33 insertions(+), 21 deletions(-)
diff --git a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
index f587709ddd473..13b11c3a2ec4e 100644
--- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
+++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
@@ -1723,55 +1723,67 @@ EXPORT_SYMBOL_NS_GPL(tpmi_sst_dev_remove, "INTEL_TPMI_SST");
void tpmi_sst_dev_suspend(struct auxiliary_device *auxdev)
{
struct tpmi_sst_struct *tpmi_sst = auxiliary_get_drvdata(auxdev);
- struct tpmi_per_power_domain_info *power_domain_info;
+ struct tpmi_per_power_domain_info *power_domain_info, *pd_info;
struct oobmsm_plat_info *plat_info;
void __iomem *cp_base;
+ int num_resources, i;
plat_info = tpmi_get_platform_data(auxdev);
if (!plat_info)
return;
power_domain_info = tpmi_sst->power_domain_info[plat_info->partition];
+ num_resources = tpmi_sst->number_of_power_domains[plat_info->partition];
- cp_base = power_domain_info->sst_base + power_domain_info->sst_header.cp_offset;
- power_domain_info->saved_sst_cp_control = readq(cp_base + SST_CP_CONTROL_OFFSET);
-
- memcpy_fromio(power_domain_info->saved_clos_configs, cp_base + SST_CLOS_CONFIG_0_OFFSET,
- sizeof(power_domain_info->saved_clos_configs));
+ for (i = 0; i < num_resources; i++) {
+ pd_info = &power_domain_info[i];
+ if (!pd_info || !pd_info->sst_base)
+ continue;
- memcpy_fromio(power_domain_info->saved_clos_assocs, cp_base + SST_CLOS_ASSOC_0_OFFSET,
- sizeof(power_domain_info->saved_clos_assocs));
+ cp_base = pd_info->sst_base + pd_info->sst_header.cp_offset;
+ pd_info->saved_sst_cp_control = readq(cp_base + SST_CP_CONTROL_OFFSET);
+ memcpy_fromio(pd_info->saved_clos_configs, cp_base + SST_CLOS_CONFIG_0_OFFSET,
+ sizeof(pd_info->saved_clos_configs));
+ memcpy_fromio(pd_info->saved_clos_assocs, cp_base + SST_CLOS_ASSOC_0_OFFSET,
+ sizeof(pd_info->saved_clos_assocs));
- power_domain_info->saved_pp_control = readq(power_domain_info->sst_base +
- power_domain_info->sst_header.pp_offset +
- SST_PP_CONTROL_OFFSET);
+ pd_info->saved_pp_control = readq(pd_info->sst_base +
+ pd_info->sst_header.pp_offset +
+ SST_PP_CONTROL_OFFSET);
+ }
}
EXPORT_SYMBOL_NS_GPL(tpmi_sst_dev_suspend, "INTEL_TPMI_SST");
void tpmi_sst_dev_resume(struct auxiliary_device *auxdev)
{
struct tpmi_sst_struct *tpmi_sst = auxiliary_get_drvdata(auxdev);
- struct tpmi_per_power_domain_info *power_domain_info;
+ struct tpmi_per_power_domain_info *power_domain_info, *pd_info;
struct oobmsm_plat_info *plat_info;
void __iomem *cp_base;
+ int num_resources, i;
plat_info = tpmi_get_platform_data(auxdev);
if (!plat_info)
return;
power_domain_info = tpmi_sst->power_domain_info[plat_info->partition];
+ num_resources = tpmi_sst->number_of_power_domains[plat_info->partition];
- cp_base = power_domain_info->sst_base + power_domain_info->sst_header.cp_offset;
- writeq(power_domain_info->saved_sst_cp_control, cp_base + SST_CP_CONTROL_OFFSET);
-
- memcpy_toio(cp_base + SST_CLOS_CONFIG_0_OFFSET, power_domain_info->saved_clos_configs,
- sizeof(power_domain_info->saved_clos_configs));
+ for (i = 0; i < num_resources; i++) {
+ pd_info = &power_domain_info[i];
+ if (!pd_info || !pd_info->sst_base)
+ continue;
- memcpy_toio(cp_base + SST_CLOS_ASSOC_0_OFFSET, power_domain_info->saved_clos_assocs,
- sizeof(power_domain_info->saved_clos_assocs));
+ cp_base = pd_info->sst_base + pd_info->sst_header.cp_offset;
+ writeq(pd_info->saved_sst_cp_control, cp_base + SST_CP_CONTROL_OFFSET);
+ memcpy_toio(cp_base + SST_CLOS_CONFIG_0_OFFSET, pd_info->saved_clos_configs,
+ sizeof(pd_info->saved_clos_configs));
+ memcpy_toio(cp_base + SST_CLOS_ASSOC_0_OFFSET, pd_info->saved_clos_assocs,
+ sizeof(pd_info->saved_clos_assocs));
- writeq(power_domain_info->saved_pp_control, power_domain_info->sst_base +
- power_domain_info->sst_header.pp_offset + SST_PP_CONTROL_OFFSET);
+ writeq(pd_info->saved_pp_control, power_domain_info->sst_base +
+ pd_info->sst_header.pp_offset + SST_PP_CONTROL_OFFSET);
+ }
}
EXPORT_SYMBOL_NS_GPL(tpmi_sst_dev_resume, "INTEL_TPMI_SST");
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 540/752] dm-integrity: fix a typo in the code for write/discard race
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (83 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 539/752] platform/x86: ISST: Store and restore all domains data Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 541/752] dm: clear cloned request bio pointer when last clone bio completes Sasha Levin
` (199 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Mikulas Patocka, stable, Sasha Levin
From: Mikulas Patocka <mpatocka@redhat.com>
[ Upstream commit c698b7f417801fcd79f0dc844250b3361d38e6b8 ]
If we send a write followed by a discard, it may be possible that the
discarded data end up being overwritten by the previous write from the
journal. The code tries to prevent that, but there was a typo in this
logic that made it not being activated as it should be.
Note that if we end up here the second time (when discard_retried is
true), it means that the write bio is actually racing with the discard
bio, and in this situation it is not specified which of them should win.
Cc: stable@vger.kernel.org
Fixes: 31843edab7cb ("dm integrity: improve discard in journal mode")
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-integrity.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 170bf67a2edd9..79d60495454a5 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -2411,7 +2411,7 @@ static void dm_integrity_map_continue(struct dm_integrity_io *dio, bool from_map
new_pos = find_journal_node(ic, dio->range.logical_sector, &next_sector);
if (unlikely(new_pos != NOT_FOUND) ||
- unlikely(next_sector < dio->range.logical_sector - dio->range.n_sectors)) {
+ unlikely(next_sector < dio->range.logical_sector + dio->range.n_sectors)) {
remove_range_unlocked(ic, &dio->range);
spin_unlock_irq(&ic->endio_wait.lock);
queue_work(ic->commit_wq, &ic->commit_work);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 541/752] dm: clear cloned request bio pointer when last clone bio completes
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (84 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 540/752] dm-integrity: fix a typo in the code for write/discard race Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 542/752] soc: ti: k3-socinfo: Fix regmap leak on probe failure Sasha Levin
` (198 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Michael Liang, Mohamed Khalfella, Mikulas Patocka, stable,
Sasha Levin
From: Michael Liang <mliang@purestorage.com>
[ Upstream commit fb8a6c18fb9a6561f7a15b58b272442b77a242dd ]
Stale rq->bio values have been observed to cause double-initialization of
cloned bios in request-based device-mapper targets, leading to
use-after-free and double-free scenarios.
One such case occurs when using dm-multipath on top of a PCIe NVMe
namespace, where cloned request bios are freed during
blk_complete_request(), but rq->bio is left intact. Subsequent clone
teardown then attempts to free the same bios again via
blk_rq_unprep_clone().
The resulting double-free path looks like:
nvme_pci_complete_batch()
nvme_complete_batch()
blk_mq_end_request_batch()
blk_complete_request() // called on a DM clone request
bio_endio() // first free of all clone bios
...
rq->end_io() // end_clone_request()
dm_complete_request(tio->orig)
dm_softirq_done()
dm_done()
dm_end_request()
blk_rq_unprep_clone() // second free of clone bios
Fix this by clearing the clone request's bio pointer when the last cloned
bio completes, ensuring that later teardown paths do not attempt to free
already-released bios.
Signed-off-by: Michael Liang <mliang@purestorage.com>
Reviewed-by: Mohamed Khalfella <mkhalfella@purestorage.com>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-rq.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/drivers/md/dm-rq.c b/drivers/md/dm-rq.c
index 5e08546696145..923252fb57aec 100644
--- a/drivers/md/dm-rq.c
+++ b/drivers/md/dm-rq.c
@@ -109,14 +109,21 @@ static void end_clone_bio(struct bio *clone)
*/
tio->completed += nr_bytes;
+ if (!is_last)
+ return;
+ /*
+ * At this moment we know this is the last bio of the cloned request,
+ * and all cloned bios have been released, so reset the clone request's
+ * bio pointer to avoid double free.
+ */
+ tio->clone->bio = NULL;
+ exit:
/*
* Update the original request.
* Do not use blk_mq_end_request() here, because it may complete
* the original request before the clone, and break the ordering.
*/
- if (is_last)
- exit:
- blk_update_request(tio->orig, BLK_STS_OK, tio->completed);
+ blk_update_request(tio->orig, BLK_STS_OK, tio->completed);
}
static struct dm_rq_target_io *tio_from_request(struct request *rq)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 542/752] soc: ti: k3-socinfo: Fix regmap leak on probe failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (85 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 541/752] dm: clear cloned request bio pointer when last clone bio completes Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 543/752] soc: ti: pruss: Fix double free in pruss_clk_mux_setup() Sasha Levin
` (197 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Johan Hovold, stable, Andrew Davis, Nishanth Menon, Sasha Levin
From: Johan Hovold <johan@kernel.org>
[ Upstream commit c933138d45176780fabbbe7da263e04d5b3e525d ]
The mmio regmap allocated during probe is never freed.
Switch to using the device managed allocator so that the regmap is
released on probe failures (e.g. probe deferral) and on driver unbind.
Fixes: a5caf03188e4 ("soc: ti: k3-socinfo: Do not use syscon helper to build regmap")
Cc: stable@vger.kernel.org # 6.15
Cc: Andrew Davis <afd@ti.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20251127134942.2121-1-johan@kernel.org
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/ti/k3-socinfo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/ti/k3-socinfo.c b/drivers/soc/ti/k3-socinfo.c
index 50c170a995f90..42275cb5ba1c8 100644
--- a/drivers/soc/ti/k3-socinfo.c
+++ b/drivers/soc/ti/k3-socinfo.c
@@ -141,7 +141,7 @@ static int k3_chipinfo_probe(struct platform_device *pdev)
if (IS_ERR(base))
return PTR_ERR(base);
- regmap = regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
+ regmap = devm_regmap_init_mmio(dev, base, &k3_chipinfo_regmap_cfg);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 543/752] soc: ti: pruss: Fix double free in pruss_clk_mux_setup()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (86 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 542/752] soc: ti: k3-socinfo: Fix regmap leak on probe failure Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 544/752] KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation Sasha Levin
` (196 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Wentao Liang, stable, Nishanth Menon, Sasha Levin
From: Wentao Liang <vulab@iscas.ac.cn>
[ Upstream commit 80db65d4acfb9ff12d00172aed39ea8b98261aad ]
In the pruss_clk_mux_setup(), the devm_add_action_or_reset() indirectly
calls pruss_of_free_clk_provider(), which calls of_node_put(clk_mux_np)
on the error path. However, after the devm_add_action_or_reset()
returns, the of_node_put(clk_mux_np) is called again, causing a double
free.
Fix by returning directly, to avoid the duplicate of_node_put().
Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Link: https://patch.msgid.link/20260113014716.2464741-1-vulab@iscas.ac.cn
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/ti/pruss.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index 038576805bfa0..0fd59c73f585d 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -366,12 +366,10 @@ static int pruss_clk_mux_setup(struct pruss *pruss, struct clk *clk_mux,
ret = devm_add_action_or_reset(dev, pruss_of_free_clk_provider,
clk_mux_np);
- if (ret) {
+ if (ret)
dev_err(dev, "failed to add clkmux free action %d", ret);
- goto put_clk_mux_np;
- }
- return 0;
+ return ret;
put_clk_mux_np:
of_node_put(clk_mux_np);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 544/752] KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (87 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 543/752] soc: ti: pruss: Fix double free in pruss_clk_mux_setup() Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 545/752] bus: omap-ocp2scp: fix OF populate on driver rebind Sasha Levin
` (195 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Yosry Ahmed, Maxim Levitsky, stable, Sean Christopherson,
Sasha Levin
From: Yosry Ahmed <yosry.ahmed@linux.dev>
[ Upstream commit 127ccae2c185f62e6ecb4bf24f9cb307e9b9c619 ]
Commit cc3ed80ae69f ("KVM: nSVM: always use vmcb01 to for vmsave/vmload
of guest state") made KVM always use vmcb01 for the fields controlled by
VMSAVE/VMLOAD, but it missed updating the VMLOAD/VMSAVE emulation code
to always use vmcb01.
As a result, if VMSAVE/VMLOAD is executed by an L2 guest and is not
intercepted by L1, KVM will mistakenly use vmcb02. Always use vmcb01
instead of the current VMCB.
Fixes: cc3ed80ae69f ("KVM: nSVM: always use vmcb01 to for vmsave/vmload of guest state")
Cc: Maxim Levitsky <mlevitsk@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Yosry Ahmed <yosry.ahmed@linux.dev>
Link: https://patch.msgid.link/20260110004821.3411245-2-yosry.ahmed@linux.dev
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/svm/svm.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kvm/svm/svm.c b/arch/x86/kvm/svm/svm.c
index d758bff6e068b..eed104207a11a 100644
--- a/arch/x86/kvm/svm/svm.c
+++ b/arch/x86/kvm/svm/svm.c
@@ -2094,12 +2094,13 @@ static int vmload_vmsave_interception(struct kvm_vcpu *vcpu, bool vmload)
ret = kvm_skip_emulated_instruction(vcpu);
+ /* KVM always performs VMLOAD/VMSAVE on VMCB01 (see __svm_vcpu_run()) */
if (vmload) {
- svm_copy_vmloadsave_state(svm->vmcb, vmcb12);
+ svm_copy_vmloadsave_state(svm->vmcb01.ptr, vmcb12);
svm->sysenter_eip_hi = 0;
svm->sysenter_esp_hi = 0;
} else {
- svm_copy_vmloadsave_state(vmcb12, svm->vmcb);
+ svm_copy_vmloadsave_state(vmcb12, svm->vmcb01.ptr);
}
kvm_vcpu_unmap(vcpu, &map);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 545/752] bus: omap-ocp2scp: fix OF populate on driver rebind
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (88 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 544/752] KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 546/752] clk: clk-apple-nco: Add "apple,t8103-nco" compatible Sasha Levin
` (194 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Johan Hovold, stable, Kevin Hilman, Sasha Levin
From: Johan Hovold <johan@kernel.org>
[ Upstream commit 5eb63e9bb65d88abde647ced50fe6ad40c11de1a ]
Since commit c6e126de43e7 ("of: Keep track of populated platform
devices") child devices will not be created by of_platform_populate()
if the devices had previously been deregistered individually so that the
OF_POPULATED flag is still set in the corresponding OF nodes.
Switch to using of_platform_depopulate() instead of open coding so that
the child devices are created if the driver is rebound.
Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20251219110119.23507-1-johan@kernel.org
Signed-off-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bus/omap-ocp2scp.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/bus/omap-ocp2scp.c b/drivers/bus/omap-ocp2scp.c
index e4dfda7b3b102..eee5ad191ea9c 100644
--- a/drivers/bus/omap-ocp2scp.c
+++ b/drivers/bus/omap-ocp2scp.c
@@ -17,15 +17,6 @@
#define OCP2SCP_TIMING 0x18
#define SYNC2_MASK 0xf
-static int ocp2scp_remove_devices(struct device *dev, void *c)
-{
- struct platform_device *pdev = to_platform_device(dev);
-
- platform_device_unregister(pdev);
-
- return 0;
-}
-
static int omap_ocp2scp_probe(struct platform_device *pdev)
{
int ret;
@@ -79,7 +70,7 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
err0:
- device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
+ of_platform_depopulate(&pdev->dev);
return ret;
}
@@ -87,7 +78,7 @@ static int omap_ocp2scp_probe(struct platform_device *pdev)
static void omap_ocp2scp_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
- device_for_each_child(&pdev->dev, NULL, ocp2scp_remove_devices);
+ of_platform_depopulate(&pdev->dev);
}
#ifdef CONFIG_OF
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 546/752] clk: clk-apple-nco: Add "apple,t8103-nco" compatible
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (89 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 545/752] bus: omap-ocp2scp: fix OF populate on driver rebind Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 547/752] soc: rockchip: grf: Fix wrong RK3576_IOCGRF_MISC_CON definition Sasha Levin
` (193 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Janne Grunau, stable, Stephen Boyd, Neal Gompa, Sasha Levin
From: Janne Grunau <j@jannau.net>
[ Upstream commit ef9b3b4dbe767e4ac642a88dc0507927ac545047 ]
After discussion with the devicetree maintainers we agreed to not extend
lists with the generic compatible "apple,nco" anymore [1]. Use
"apple,t8103-nco" as base compatible as it is the SoC the driver and
bindings were written for.
[1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/
Fixes: 6641057d5dba ("clk: clk-apple-nco: Add driver for Apple NCO")
Cc: stable@vger.kernel.org
Acked-by: Stephen Boyd <sboyd@kernel.org>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-apple-nco.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clk/clk-apple-nco.c b/drivers/clk/clk-apple-nco.c
index d3ced4a0f029e..434c067968bbc 100644
--- a/drivers/clk/clk-apple-nco.c
+++ b/drivers/clk/clk-apple-nco.c
@@ -320,6 +320,7 @@ static int applnco_probe(struct platform_device *pdev)
}
static const struct of_device_id applnco_ids[] = {
+ { .compatible = "apple,t8103-nco" },
{ .compatible = "apple,nco" },
{ }
};
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 547/752] soc: rockchip: grf: Fix wrong RK3576_IOCGRF_MISC_CON definition
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (90 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 546/752] clk: clk-apple-nco: Add "apple,t8103-nco" compatible Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 548/752] soc: rockchip: grf: Support multiple grf to be handled Sasha Levin
` (192 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Shawn Lin, stable, Detlev Casanova, Chaoyi Chen,
Marco Schirrmeister, Heiko Stuebner, Sasha Levin
From: Shawn Lin <shawn.lin@rock-chips.com>
[ Upstream commit 3cdc30c42d4a87444f6c7afbefd6a9381c4caa27 ]
RK3576_IOCGRF_MISC_CON is IOC_GRF + 0x40F0, fix it.
Fixes: e1aaecacfa13 ("soc: rockchip: grf: Add rk3576 default GRF values")
Cc: stable@vger.kernel.org
Cc: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Reviewed-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Tested-by: Marco Schirrmeister <mschirrmeister@gmail.com>
Link: https://patch.msgid.link/1768524932-163929-2-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/rockchip/grf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
index 344870da7675f..9b96499fa1dfc 100644
--- a/drivers/soc/rockchip/grf.c
+++ b/drivers/soc/rockchip/grf.c
@@ -134,7 +134,7 @@ static const struct rockchip_grf_info rk3576_sysgrf __initconst = {
.num_values = ARRAY_SIZE(rk3576_defaults_sys_grf),
};
-#define RK3576_IOCGRF_MISC_CON 0x04F0
+#define RK3576_IOCGRF_MISC_CON 0x40F0
static const struct rockchip_grf_value rk3576_defaults_ioc_grf[] __initconst = {
{ "jtag switching", RK3576_IOCGRF_MISC_CON, FIELD_PREP_WM16_CONST(BIT(1), 0) },
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 548/752] soc: rockchip: grf: Support multiple grf to be handled
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (91 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 547/752] soc: rockchip: grf: Fix wrong RK3576_IOCGRF_MISC_CON definition Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 549/752] media: stm32: dcmipp: avoid naming clock if only one is needed Sasha Levin
` (191 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Shawn Lin, stable, Detlev Casanova, Marco Schirrmeister,
Heiko Stuebner, Sasha Levin
From: Shawn Lin <shawn.lin@rock-chips.com>
[ Upstream commit 75fb63ae031211e9264ac888fabc2ca9cd3fcccf ]
Currently, only the first matched node will be handled. This leads
to jtag switching broken for RK3576, as rk3576-sys-grf is found before
rk3576-ioc-grf. Change the code to scan all the possible node to fix
the problem.
Fixes: e1aaecacfa13 ("soc: rockchip: grf: Add rk3576 default GRF values")
Cc: stable@vger.kernel.org
Cc: Detlev Casanova <detlev.casanova@collabora.com>
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Tested-by: Marco Schirrmeister <mschirrmeister@gmail.com>
Link: https://patch.msgid.link/1768524932-163929-3-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/soc/rockchip/grf.c | 55 +++++++++++++++++++-------------------
1 file changed, 27 insertions(+), 28 deletions(-)
diff --git a/drivers/soc/rockchip/grf.c b/drivers/soc/rockchip/grf.c
index 9b96499fa1dfc..db407fa279850 100644
--- a/drivers/soc/rockchip/grf.c
+++ b/drivers/soc/rockchip/grf.c
@@ -202,34 +202,33 @@ static int __init rockchip_grf_init(void)
struct regmap *grf;
int ret, i;
- np = of_find_matching_node_and_match(NULL, rockchip_grf_dt_match,
- &match);
- if (!np)
- return -ENODEV;
- if (!match || !match->data) {
- pr_err("%s: missing grf data\n", __func__);
- of_node_put(np);
- return -EINVAL;
- }
-
- grf_info = match->data;
-
- grf = syscon_node_to_regmap(np);
- of_node_put(np);
- if (IS_ERR(grf)) {
- pr_err("%s: could not get grf syscon\n", __func__);
- return PTR_ERR(grf);
- }
-
- for (i = 0; i < grf_info->num_values; i++) {
- const struct rockchip_grf_value *val = &grf_info->values[i];
-
- pr_debug("%s: adjusting %s in %#6x to %#10x\n", __func__,
- val->desc, val->reg, val->val);
- ret = regmap_write(grf, val->reg, val->val);
- if (ret < 0)
- pr_err("%s: write to %#6x failed with %d\n",
- __func__, val->reg, ret);
+ for_each_matching_node_and_match(np, rockchip_grf_dt_match, &match) {
+ if (!of_device_is_available(np))
+ continue;
+ if (!match || !match->data) {
+ pr_err("%s: missing grf data\n", __func__);
+ of_node_put(np);
+ return -EINVAL;
+ }
+
+ grf_info = match->data;
+
+ grf = syscon_node_to_regmap(np);
+ if (IS_ERR(grf)) {
+ pr_err("%s: could not get grf syscon\n", __func__);
+ return PTR_ERR(grf);
+ }
+
+ for (i = 0; i < grf_info->num_values; i++) {
+ const struct rockchip_grf_value *val = &grf_info->values[i];
+
+ pr_debug("%s: adjusting %s in %#6x to %#10x\n", __func__,
+ val->desc, val->reg, val->val);
+ ret = regmap_write(grf, val->reg, val->val);
+ if (ret < 0)
+ pr_err("%s: write to %#6x failed with %d\n",
+ __func__, val->reg, ret);
+ }
}
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 549/752] media: stm32: dcmipp: avoid naming clock if only one is needed
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (92 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 548/752] soc: rockchip: grf: Support multiple grf to be handled Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 550/752] media: stm32: dcmipp: bytecap: clear all interrupts upon stream stop Sasha Levin
` (190 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Alain Volmat, Stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Alain Volmat <alain.volmat@foss.st.com>
[ Upstream commit 2f130245f2143fa8f4da77071f844911d2c69319 ]
When DCMIPP requires only a single clock (kclk), avoid relying on its
name to obtain it. The introduction of MP25 support added the mclk,
which necessitated naming the first clock kclk. However, this breaks
backward compatibility with existing MP13 device trees that do not
specify clock names.
Fixes: 686f27f7ea37 ("media: stm32: dcmipp: add core support for the stm32mp25")
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Cc: Stable@vger.kernel.org # 6.14.x: 7f487562af49 media: stm32: dcmipp: correct ret type in dcmipp_graph_notify_bound
Cc: Stable@vger.kernel.org # 6.14.x: c715dd62da30 media: stm32: dcmipp: add has_csi2 & needs_mclk in match data
Cc: Stable@vger.kernel.org # 6.14.x:
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
index 1b7bae3266c8d..49398d0777646 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-core.c
@@ -526,7 +526,12 @@ static int dcmipp_probe(struct platform_device *pdev)
return ret;
}
- kclk = devm_clk_get(&pdev->dev, "kclk");
+ /*
+ * In case of the DCMIPP has only 1 clock (such as on MP13), the
+ * clock might not be named.
+ */
+ kclk = devm_clk_get(&pdev->dev,
+ dcmipp->pipe_cfg->needs_mclk ? "kclk" : NULL);
if (IS_ERR(kclk))
return dev_err_probe(&pdev->dev, PTR_ERR(kclk),
"Unable to get kclk\n");
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 550/752] media: stm32: dcmipp: bytecap: clear all interrupts upon stream stop
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (93 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 549/752] media: stm32: dcmipp: avoid naming clock if only one is needed Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 551/752] media: stm32: dcmipp: byteproc: disable compose for all bayers Sasha Levin
` (189 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Alain Volmat, stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Alain Volmat <alain.volmat@foss.st.com>
[ Upstream commit 222f1279edd9008ee35b62de156ddac84e31443c ]
Ensure that there are no pending interrupts after we have stopped the
pipeline. Indeed, it could happen that new interrupt has been generated
during the stop_streaming processing hence clear them in order to avoid
getting a new interrupt right from the start of a next start_streaming.
Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver")
Cc: stable@vger.kernel.org
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
index 1c1b6b48918ee..b18e273ef4a3e 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
@@ -512,6 +512,9 @@ static void dcmipp_bytecap_stop_streaming(struct vb2_queue *vq)
/* Disable pipe */
reg_clear(vcap, DCMIPP_P0FSCR, DCMIPP_P0FSCR_PIPEN);
+ /* Clear any pending interrupts */
+ reg_write(vcap, DCMIPP_CMFCR, DCMIPP_CMIER_P0ALL);
+
spin_lock_irq(&vcap->irqlock);
/* Return all queued buffers to vb2 in ERROR state */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 551/752] media: stm32: dcmipp: byteproc: disable compose for all bayers
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (94 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 550/752] media: stm32: dcmipp: bytecap: clear all interrupts upon stream stop Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 552/752] media: i2c: ov01a10: Fix digital gain range Sasha Levin
` (188 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Alain Volmat, stable, Sakari Ailus, Hans Verkuil, Sasha Levin
From: Alain Volmat <alain.volmat@foss.st.com>
[ Upstream commit 3363aa2640f1738ad7fc56ea56f5e0301ad97196 ]
Avoid possibility to perform compose on all frames which mbus code is
within the bayer range or jpeg format.
Fixes: 822c72eb1519 ("media: stm32: dcmipp: add bayer 10~14 bits formats")
Cc: stable@vger.kernel.org
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
index db76a02a1848a..ec1d773d5ad12 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-byteproc.c
@@ -130,11 +130,8 @@ static void dcmipp_byteproc_adjust_compose(struct v4l2_rect *r,
r->left = 0;
/* Compose is not possible for JPEG or Bayer formats */
- if (fmt->code == MEDIA_BUS_FMT_JPEG_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SBGGR8_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SGBRG8_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SGRBG8_1X8 ||
- fmt->code == MEDIA_BUS_FMT_SRGGB8_1X8) {
+ if (fmt->code >= MEDIA_BUS_FMT_SBGGR8_1X8 &&
+ fmt->code <= MEDIA_BUS_FMT_JPEG_1X8) {
r->width = fmt->width;
r->height = fmt->height;
return;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 552/752] media: i2c: ov01a10: Fix digital gain range
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (95 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 551/752] media: stm32: dcmipp: byteproc: disable compose for all bayers Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 553/752] arm64: dts: rockchip: Fix SD card support for RK3576 EVB1 Sasha Levin
` (187 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Mehdi Djait, Hans de Goede, stable, Sakari Ailus, Hans Verkuil,
Sasha Levin
From: Mehdi Djait <mehdi.djait@linux.intel.com>
[ Upstream commit 91848c99ed6a98daf77f4cb7d44cf3f13bc6998f ]
Digital gain wraps-around at the maximum of 16838 / 0x3fff.
Fix the maximum digital gain by setting it to 0x3fff.
Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com>
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Fixes: 0827b58dabff ("media: i2c: add ov01a10 image sensor driver")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/i2c/ov01a10.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/i2c/ov01a10.c b/drivers/media/i2c/ov01a10.c
index 3ad516e4d3698..c1a7373a6311c 100644
--- a/drivers/media/i2c/ov01a10.c
+++ b/drivers/media/i2c/ov01a10.c
@@ -57,7 +57,7 @@
#define OV01A10_REG_DIGITAL_GAIN_GR 0x3513
#define OV01A10_REG_DIGITAL_GAIN_R 0x3516
#define OV01A10_DGTL_GAIN_MIN 0
-#define OV01A10_DGTL_GAIN_MAX 0x3ffff
+#define OV01A10_DGTL_GAIN_MAX 0x3fff
#define OV01A10_DGTL_GAIN_STEP 1
#define OV01A10_DGTL_GAIN_DEFAULT 1024
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 553/752] arm64: dts: rockchip: Fix SD card support for RK3576 EVB1
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (96 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 552/752] media: i2c: ov01a10: Fix digital gain range Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 554/752] clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc() Sasha Levin
` (186 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Shawn Lin, stable, Heiko Stuebner, Sasha Levin
From: Shawn Lin <shawn.lin@rock-chips.com>
[ Upstream commit 7226664bf952c4cfddccd74b154a7d994608d153 ]
When runtime suspend is enabled, the associated power domain is powered
off, which resets the registers, including the power control bit. As a result,
the card loses power during runtime suspend. The card should still be able
to process I/O with the help of mmc_blk_mq_rw_recovery(), which is suboptimal.
To address this issue, we must use vmmc-supply with a GPIO based method to
maintain power to the card. Also, add cd-gpios method to make hot-plug work
correctly during idle periods.
Fixes: f135a1a07352 ("arm64: dts: rockchip: Add rk3576 evb1 board")
Cc: stable@vger.kernel.org
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Link: https://patch.msgid.link/1768524932-163929-5-git-send-email-shawn.lin@rock-chips.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../boot/dts/rockchip/rk3576-evb1-v10.dts | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts b/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts
index db8fef7a4f1b9..ffe55f970f461 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts
@@ -223,6 +223,18 @@ vcc_3v3_s0: regulator-vcc-3v3-s0 {
vin-supply = <&vcc_3v3_s3>;
};
+ vcc3v3_sd: regulator-vcc-3v3-sd {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdmmc_pwren>;
+ regulator-name = "vcc3v3_sd";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ vin-supply = <&vcc_3v3_s0>;
+ };
+
vcc_ufs_s0: regulator-vcc-ufs-s0 {
compatible = "regulator-fixed";
regulator-name = "vcc_ufs_s0";
@@ -810,6 +822,12 @@ pcie0_rst: pcie0-rst {
};
};
+ sdmmc {
+ sdmmc_pwren: sdmmc-pwren {
+ rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
usb {
usb_host_pwren: usb-host-pwren {
rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
@@ -851,11 +869,15 @@ &sdmmc {
bus-width = <4>;
cap-mmc-highspeed;
cap-sd-highspeed;
+ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
disable-wp;
max-frequency = <200000000>;
no-sdio;
no-mmc;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdmmc0_clk &sdmmc0_cmd &sdmmc0_det &sdmmc0_bus4>;
sd-uhs-sdr104;
+ vmmc-supply = <&vcc3v3_sd>;
vqmmc-supply = <&vccio_sd_s0>;
status = "okay";
};
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 554/752] clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (97 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 553/752] arm64: dts: rockchip: Fix SD card support for RK3576 EVB1 Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 555/752] s390/pci: Handle futile config accesses of disabled devices directly Sasha Levin
` (185 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Brian Masney, Thierry Reding, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit fce0d0bd9c20fefd180ea9e8362d619182f97a1d ]
If clk_register() fails, call kfree to release "tegra".
Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Brian Masney <bmasney@redhat.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/tegra/clk-tegra124-emc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c
index 2a6db04342815..0f6fb776b2298 100644
--- a/drivers/clk/tegra/clk-tegra124-emc.c
+++ b/drivers/clk/tegra/clk-tegra124-emc.c
@@ -538,8 +538,10 @@ struct clk *tegra124_clk_register_emc(void __iomem *base, struct device_node *np
tegra->hw.init = &init;
clk = clk_register(NULL, &tegra->hw);
- if (IS_ERR(clk))
+ if (IS_ERR(clk)) {
+ kfree(tegra);
return clk;
+ }
tegra->prev_parent = clk_hw_get_parent_by_index(
&tegra->hw, emc_get_parent(&tegra->hw))->clk;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 555/752] s390/pci: Handle futile config accesses of disabled devices directly
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (98 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 554/752] clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc() Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 556/752] mailbox: Prevent out-of-bounds access in fw_mbox_index_xlate() Sasha Levin
` (184 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Niklas Schnelle, stable, Benjamin Block, Farhan Ali,
Heiko Carstens, Sasha Levin
From: Niklas Schnelle <schnelle@linux.ibm.com>
[ Upstream commit 84d875e69818bed600edccb09be4a64b84a34a54 ]
On s390 PCI busses and slots with multiple functions may have holes
because PCI functions are passed-through by the hypervisor on a per
function basis and some functions may be in standby or reserved. This
fact is indicated by returning true from the
hypervisor_isolated_pci_functions() helper and triggers common code to
scan all possible devfn values. Via pci_scan_single_device() this in
turn causes config reads for the device and vendor IDs, even for PCI
functions which are in standby and thereofore disabled.
So far these futile config reads, as well as potentially writes, which
can never succeed were handled by the PCI load/store instructions
themselves. This works as the platform just returns an error for
a disabled and thus not usable function handle. It does cause spamming
of error logs and additional overhead though.
Instead check if the used function handle is enabled in zpci_cfg_load()
and zpci_cfg_write() and if not enable directly return -ENODEV. Also
refactor zpci_cfg_load() and zpci_cfg_store() slightly to accommodate
the new logic while meeting modern kernel style guidelines.
Cc: stable@vger.kernel.org
Fixes: a50297cf8235 ("s390/pci: separate zbus creation from scanning")
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Farhan Ali <alifm@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/s390/pci/pci.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c
index c82c577db2bcd..c541019d91356 100644
--- a/arch/s390/pci/pci.c
+++ b/arch/s390/pci/pci.c
@@ -232,24 +232,33 @@ int zpci_fmb_disable_device(struct zpci_dev *zdev)
static int zpci_cfg_load(struct zpci_dev *zdev, int offset, u32 *val, u8 len)
{
u64 req = ZPCI_CREATE_REQ(zdev->fh, ZPCI_PCIAS_CFGSPC, len);
+ int rc = -ENODEV;
u64 data;
- int rc;
+
+ if (!zdev_enabled(zdev))
+ goto out_err;
rc = __zpci_load(&data, req, offset);
- if (!rc) {
- data = le64_to_cpu((__force __le64) data);
- data >>= (8 - len) * 8;
- *val = (u32) data;
- } else
- *val = 0xffffffff;
+ if (rc)
+ goto out_err;
+ data = le64_to_cpu((__force __le64)data);
+ data >>= (8 - len) * 8;
+ *val = (u32)data;
+ return 0;
+
+out_err:
+ PCI_SET_ERROR_RESPONSE(val);
return rc;
}
static int zpci_cfg_store(struct zpci_dev *zdev, int offset, u32 val, u8 len)
{
u64 req = ZPCI_CREATE_REQ(zdev->fh, ZPCI_PCIAS_CFGSPC, len);
+ int rc = -ENODEV;
u64 data = val;
- int rc;
+
+ if (!zdev_enabled(zdev))
+ return rc;
data <<= (8 - len) * 8;
data = (__force u64) cpu_to_le64(data);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 556/752] mailbox: Prevent out-of-bounds access in fw_mbox_index_xlate()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (99 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 555/752] s390/pci: Handle futile config accesses of disabled devices directly Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 557/752] drm/i915/psr: Don't enable Panel Replay on sink if globally disabled Sasha Levin
` (183 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Joonwon Kang, stable, Jassi Brar, Sasha Levin
From: Joonwon Kang <joonwonkang@google.com>
[ Upstream commit fcd7f96c783626c07ee3ed75fa3739a8a2052310 ]
Although it is guided that `#mbox-cells` must be at least 1, there are
many instances of `#mbox-cells = <0>;` in the device tree. If that is
the case and the corresponding mailbox controller does not provide
`fw_xlate` and of_xlate` function pointers, `fw_mbox_index_xlate()` will
be used by default and out-of-bounds accesses could occur due to lack of
bounds check in that function.
Cc: stable@vger.kernel.org
Signed-off-by: Joonwon Kang <joonwonkang@google.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mailbox/mailbox.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/mailbox/mailbox.c b/drivers/mailbox/mailbox.c
index 2acc6ec229a45..617ba505691d3 100644
--- a/drivers/mailbox/mailbox.c
+++ b/drivers/mailbox/mailbox.c
@@ -489,12 +489,10 @@ EXPORT_SYMBOL_GPL(mbox_free_channel);
static struct mbox_chan *fw_mbox_index_xlate(struct mbox_controller *mbox,
const struct fwnode_reference_args *sp)
{
- int ind = sp->args[0];
-
- if (ind >= mbox->num_chans)
+ if (sp->nargs < 1 || sp->args[0] >= mbox->num_chans)
return ERR_PTR(-EINVAL);
- return &mbox->chans[ind];
+ return &mbox->chans[sp->args[0]];
}
/**
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 557/752] drm/i915/psr: Don't enable Panel Replay on sink if globally disabled
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (100 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 556/752] mailbox: Prevent out-of-bounds access in fw_mbox_index_xlate() Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 558/752] reset: gpio: suppress bind attributes in sysfs Sasha Levin
` (182 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Jouni Högander, Mika Kahola, Jani Nikula, Rodrigo Vivi,
stable, Joonas Lahtinen, Sasha Levin
From: Jouni Högander <jouni.hogander@intel.com>
[ Upstream commit 69f83f167463bad26104af7fbc114ce1f80366b0 ]
With some panels informing support for Panel Replay we are observing
problems if having Panel Replay enable bit set on sink when forced to use
PSR instead of Panel Replay. Avoid these problems by not setting Panel
Replay enable bit in sink when Panel Replay is globally disabled during
link training. I.e. disabled by module parameter.
The enable bit is still set when disabling Panel Replay via debugfs
interface. Added note comment about this.
Fixes: 68f3a505b367 ("drm/i915/psr: Enable Panel Replay on sink always when it's supported")
Cc: Mika Kahola <mika.kahola@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: <stable@vger.kernel.org> # v6.15+
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20260115070039.368965-1-jouni.hogander@intel.com
(cherry picked from commit c5a52cd04e24f0ae53fda26f74ab027b8c548e0e)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/i915/display/intel_psr.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 6d9c95e5c0255..38d1df919d1ab 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -813,7 +813,12 @@ static void intel_psr_enable_sink(struct intel_dp *intel_dp,
void intel_psr_panel_replay_enable_sink(struct intel_dp *intel_dp)
{
- if (CAN_PANEL_REPLAY(intel_dp))
+ /*
+ * NOTE: We might want to trigger mode set when
+ * disabling/enabling Panel Replay via debugfs interface to
+ * ensure this bit is cleared/set accordingly.
+ */
+ if (CAN_PANEL_REPLAY(intel_dp) && panel_replay_global_enabled(intel_dp))
drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG,
DP_PANEL_REPLAY_ENABLE);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 558/752] reset: gpio: suppress bind attributes in sysfs
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (101 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 557/752] drm/i915/psr: Don't enable Panel Replay on sink if globally disabled Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 559/752] dm-integrity: fix recalculation in bitmap mode Sasha Levin
` (181 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Bartosz Golaszewski, stable, Krzysztof Kozlowski, Philipp Zabel,
Sasha Levin
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ Upstream commit 16de4c6a8fe9ff497ca1aba33ef0dbee09f11952 ]
This is a special device that's created dynamically and is supposed to
stay in memory forever. We also currently don't have a devlink between
it and the actual reset consumer. Suppress sysfs bind attributes so that
user-space can't unbind the device because - as of now - it will cause a
use-after-free splat from any user that puts the reset control handle.
Fixes: cee544a40e44 ("reset: gpio: Add GPIO-based reset controller")
Cc: stable@vger.kernel.org
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/reset/reset-gpio.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/reset/reset-gpio.c b/drivers/reset/reset-gpio.c
index 2290b25b67035..15353ba5758c3 100644
--- a/drivers/reset/reset-gpio.c
+++ b/drivers/reset/reset-gpio.c
@@ -110,6 +110,7 @@ static struct platform_driver reset_gpio_driver = {
.id_table = reset_gpio_ids,
.driver = {
.name = "reset-gpio",
+ .suppress_bind_attrs = true,
},
};
module_platform_driver(reset_gpio_driver);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 559/752] dm-integrity: fix recalculation in bitmap mode
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (102 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 558/752] reset: gpio: suppress bind attributes in sysfs Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 560/752] dm-unstripe: fix mapping bug when there are multiple targets in a table Sasha Levin
` (180 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Mikulas Patocka, Ondrej Kozina, stable, Sasha Levin
From: Mikulas Patocka <mpatocka@redhat.com>
[ Upstream commit 118ba36e446c01e3cd34b3eedabf1d9436525e1d ]
There's a logic quirk in the handling of suspend in the bitmap mode:
This is the sequence of calls if we are reloading a dm-integrity table:
* dm_integrity_ctr reads a superblock with the flag SB_FLAG_DIRTY_BITMAP
set.
* dm_integrity_postsuspend initializes a journal and clears the flag
SB_FLAG_DIRTY_BITMAP.
* dm_integrity_resume sees the superblock with SB_FLAG_DIRTY_BITMAP set -
thus it interprets the journal as if it were a bitmap.
This quirk causes recalculation problem if the user increases the size of
the device in the bitmap mode.
Fix this by reading a fresh copy on the superblock in
dm_integrity_resume. This commit also fixes another logic quirk - the
branch that sets bitmap bits if the device was extended should only be
executed if the flag SB_FLAG_DIRTY_BITMAP is set.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Tested-by: Ondrej Kozina <okozina@redhat.com>
Fixes: 468dfca38b1a ("dm integrity: add a bitmap mode")
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-integrity.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c
index 79d60495454a5..ba52631052503 100644
--- a/drivers/md/dm-integrity.c
+++ b/drivers/md/dm-integrity.c
@@ -3788,14 +3788,27 @@ static void dm_integrity_resume(struct dm_target *ti)
struct dm_integrity_c *ic = ti->private;
__u64 old_provided_data_sectors = le64_to_cpu(ic->sb->provided_data_sectors);
int r;
+ __le32 flags;
DEBUG_print("resume\n");
ic->wrote_to_journal = false;
+ flags = ic->sb->flags & cpu_to_le32(SB_FLAG_RECALCULATING);
+ r = sync_rw_sb(ic, REQ_OP_READ);
+ if (r)
+ dm_integrity_io_error(ic, "reading superblock", r);
+ if ((ic->sb->flags & flags) != flags) {
+ ic->sb->flags |= flags;
+ r = sync_rw_sb(ic, REQ_OP_WRITE | REQ_FUA);
+ if (unlikely(r))
+ dm_integrity_io_error(ic, "writing superblock", r);
+ }
+
if (ic->provided_data_sectors != old_provided_data_sectors) {
if (ic->provided_data_sectors > old_provided_data_sectors &&
ic->mode == 'B' &&
+ ic->sb->flags & cpu_to_le32(SB_FLAG_DIRTY_BITMAP) &&
ic->sb->log2_blocks_per_bitmap_bit == ic->log2_blocks_per_bitmap_bit) {
rw_journal_sectors(ic, REQ_OP_READ, 0,
ic->n_bitmap_blocks * (BITMAP_BLOCK_SIZE >> SECTOR_SHIFT), NULL);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 560/752] dm-unstripe: fix mapping bug when there are multiple targets in a table
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (103 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 559/752] dm-integrity: fix recalculation in bitmap mode Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 561/752] rtc: pcf8563: use correct of_node for output clock Sasha Levin
` (179 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Matt Whitlock, Mikulas Patocka, stable, Sasha Levin
From: Matt Whitlock <kernel@mattwhitlock.name>
[ Upstream commit 83c10e8dd43628d0bf86486616556cd749a3c310 ]
The "unstriped" device-mapper target incorrectly calculates the sector
offset on the mapped device when the target's origin is not zero.
Take for example this hypothetical concatenation of the members of a
two-disk RAID0:
linearized: 0 2097152 unstriped 2 128 0 /dev/md/raid0 0
linearized: 2097152 2097152 unstriped 2 128 1 /dev/md/raid0 0
The intent in this example is to create a single device named
/dev/mapper/linearized that comprises all of the chunks of the first disk
of the RAID0 set, followed by all of the chunks of the second disk of the
RAID0 set.
This fails because dm-unstripe.c's map_to_core function does its
computations based on the sector number within the mapper device rather
than the sector number within the target. The bug turns invisible when
the target's origin is at sector zero of the mapper device, as is the
common case. In the example above, however, what happens is that the
first half of the mapper device gets mapped correctly to the first disk
of the RAID0, but the second half of the mapper device gets mapped past
the end of the RAID0 device, and accesses to any of those sectors return
errors.
Signed-off-by: Matt Whitlock <kernel@mattwhitlock.name>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Cc: stable@vger.kernel.org
Fixes: 18a5bf270532 ("dm: add unstriped target")
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-unstripe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-unstripe.c b/drivers/md/dm-unstripe.c
index e8a9432057dce..17be483595642 100644
--- a/drivers/md/dm-unstripe.c
+++ b/drivers/md/dm-unstripe.c
@@ -117,7 +117,7 @@ static void unstripe_dtr(struct dm_target *ti)
static sector_t map_to_core(struct dm_target *ti, struct bio *bio)
{
struct unstripe_c *uc = ti->private;
- sector_t sector = bio->bi_iter.bi_sector;
+ sector_t sector = dm_target_offset(ti, bio->bi_iter.bi_sector);
sector_t tmp_sector = sector;
/* Shift us up to the right "row" on the stripe */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 561/752] rtc: pcf8563: use correct of_node for output clock
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (104 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 560/752] dm-unstripe: fix mapping bug when there are multiple targets in a table Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 562/752] drm/tyr: fix register name in error print Sasha Levin
` (178 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: John Keeping, stable, Alexandre Belloni, Sasha Levin
From: John Keeping <jkeeping@inmusicbrands.com>
[ Upstream commit a380a02ea3ddc69c1c1ccca3882748dee33ec3d3 ]
When switching to regmap, the i2c_client pointer was removed from struct
pcf8563 so this function switched to using the RTC device instead. But
the RTC device is a child of the original I2C device and does not have
an associated of_node.
Reference the correct device's of_node to ensure that the output clock
can be found when referenced by other devices and so that the override
clock name is read correctly.
Cc: stable@vger.kernel.org
Fixes: 00f1bb9b8486b ("rtc: pcf8563: Switch to regmap")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Link: https://patch.msgid.link/20260108184749.3413348-1-jkeeping@inmusicbrands.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rtc/rtc-pcf8563.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 4e61011fb7a96..b281e9489df1d 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -424,7 +424,7 @@ static const struct clk_ops pcf8563_clkout_ops = {
static struct clk *pcf8563_clkout_register_clk(struct pcf8563 *pcf8563)
{
- struct device_node *node = pcf8563->rtc->dev.of_node;
+ struct device_node *node = pcf8563->rtc->dev.parent->of_node;
struct clk_init_data init;
struct clk *clk;
int ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 562/752] drm/tyr: fix register name in error print
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (105 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 561/752] rtc: pcf8563: use correct of_node for output clock Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 563/752] arm64: dts: rockchip: Do not enable hdmi_sound node on Pinebook Pro Sasha Levin
` (177 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Dirk Behme, stable, Alice Ryhl, Sasha Levin
From: Dirk Behme <dirk.behme@de.bosch.com>
[ Upstream commit 793e8f7d52814e096f63373eca643d2672366a5a ]
The `..IRQ..` register is printed here. Not the `..INT..` one.
Correct this.
Cc: stable@vger.kernel.org
Fixes: cf4fd52e3236 ("rust: drm: Introduce the Tyr driver for Arm Mali GPUs")
Link: https://lore.kernel.org/rust-for-linux/A04F0357-896E-4ACC-BC0E-DEE8608CE518@collabora.com/
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Link: https://patch.msgid.link/20260119070838.3219739-1-dirk.behme@de.bosch.com
[aliceryhl: update commit message prefix]
[aliceryhl: add cc stable as per Miguel's suggestion]
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/tyr/driver.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tyr/driver.rs b/drivers/gpu/drm/tyr/driver.rs
index d5625dd1e41c8..0052ebe957199 100644
--- a/drivers/gpu/drm/tyr/driver.rs
+++ b/drivers/gpu/drm/tyr/driver.rs
@@ -76,7 +76,7 @@ fn issue_soft_reset(dev: &Device<Bound>, iomem: &Devres<IoMem>) -> Result {
dev_err!(dev, "GPU reset failed with errno\n");
dev_err!(
dev,
- "GPU_INT_RAWSTAT is {}\n",
+ "GPU_IRQ_RAWSTAT is {}\n",
regs::GPU_IRQ_RAWSTAT.read(dev, iomem)?
);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 563/752] arm64: dts: rockchip: Do not enable hdmi_sound node on Pinebook Pro
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (106 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 562/752] drm/tyr: fix register name in error print Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 564/752] media: venus: vdec: fix error state assignment for zero bytesused Sasha Levin
` (176 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Jun Yan, stable, Peter Robinson, Dragan Simic, Heiko Stuebner,
Sasha Levin
From: Jun Yan <jerrysteve1101@gmail.com>
[ Upstream commit b18247f9dab735c9c2d63823d28edc9011e7a1ad ]
Remove the redundant enabling of the hdmi_sound node in the Pinebook Pro
board dts file, because the HDMI output is unused on this device. [1][2]
This change also eliminates the following kernel log warning, which is
caused by the unenabled dependent node of hdmi_sound that ultimately
results in the node's probe failure:
platform hdmi-sound: deferred probe pending: asoc-simple-card: parse error
[1] https://files.pine64.org/doc/PinebookPro/pinebookpro_v2.1_mainboard_schematic.pdf
[2] https://files.pine64.org/doc/PinebookPro/pinebookpro_schematic_v21a_20220419.pdf
Cc: stable@vger.kernel.org
Fixes: 5a65505a69884 ("arm64: dts: rockchip: Add initial support for Pinebook Pro")
Signed-off-by: Jun Yan <jerrysteve1101@gmail.com>
Reviewed-by: Peter Robinson <pbrobinson@gmail.com>
Reviewed-by: Dragan Simic <dsimic@manjaro.org>
Link: https://patch.msgid.link/20260116151253.9223-1-jerrysteve1101@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 4 ----
1 file changed, 4 deletions(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
index eaaca08a76018..a6ac89567bafe 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts
@@ -421,10 +421,6 @@ &gpu {
status = "okay";
};
-&hdmi_sound {
- status = "okay";
-};
-
&i2c0 {
clock-frequency = <400000>;
i2c-scl-falling-time-ns = <4>;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 564/752] media: venus: vdec: fix error state assignment for zero bytesused
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (107 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 563/752] arm64: dts: rockchip: Do not enable hdmi_sound node on Pinebook Pro Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 565/752] media: venus: vdec: restrict EOS addr quirk to IRIS2 only Sasha Levin
` (175 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Renjiang Han, Vikash Garodia, stable, Bryan O'Donoghue,
Hans Verkuil, Sasha Levin
From: Renjiang Han <renjiang.han@oss.qualcomm.com>
[ Upstream commit 93ecd6ee95c38cb533fa25f48d3c1c8cb69f410f ]
When hfi_session_flush is issued, all queued buffers are returned to
the V4L2 driver. Some of these buffers are not processed and have
bytesused = 0. Currently, the driver marks such buffers as error even
during drain operations, which can incorrectly flag EOS buffers.
Only capture buffers with zero payload (and not EOS) should be marked
with VB2_BUF_STATE_ERROR. The check is performed inside the non-EOS
branch to ensure correct handling.
Fixes: 51df3c81ba10b ("media: venus: vdec: Mark flushed buffers with error state")
Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/venus/vdec.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 55c27345b7d89..ba4d9087bff5d 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -1442,10 +1442,10 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
inst->drain_active = false;
inst->codec_state = VENUS_DEC_STATE_STOPPED;
}
+ } else {
+ if (!bytesused)
+ state = VB2_BUF_STATE_ERROR;
}
-
- if (!bytesused)
- state = VB2_BUF_STATE_ERROR;
} else {
vbuf->sequence = inst->sequence_out++;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 565/752] media: venus: vdec: restrict EOS addr quirk to IRIS2 only
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (108 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 564/752] media: venus: vdec: fix error state assignment for zero bytesused Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 566/752] Revert "media: iris: Add sanity check for stop streaming" Sasha Levin
` (174 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Dikshita Agarwal, stable, Mecid, Renjiang Han,
Bryan O'Donoghue, Hans Verkuil, Sasha Levin
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
[ Upstream commit 63c072e2937e6c9995df1b6a28523ed2ae68d364 ]
On SM8250 (IRIS2) with firmware older than 1.0.087, the firmware could
not handle a dummy device address for EOS buffers, so a NULL device
address is sent instead. The existing check used IS_V6() alongside a
firmware version gate:
if (IS_V6(core) && is_fw_rev_or_older(core, 1, 0, 87))
fdata.device_addr = 0;
else
fdata.device_addr = 0xdeadb000;
However, SC7280 which is also V6, uses a firmware string of the form
"1.0.<commit-hash>", which the version parser translates to 1.0.0. This
unintentionally satisfies the `is_fw_rev_or_older(..., 1, 0, 87)`
condition on SC7280. Combined with IS_V6() matching there as well, the
quirk is incorrectly applied to SC7280, causing VP9 decode failures.
Constrain the check to IRIS2 (SM8250) only, which is the only platform
that needed this quirk, by replacing IS_V6() with IS_IRIS2(). This
restores correct behavior on SC7280 (no forced NULL EOS buffer address).
Fixes: 47f867cb1b63 ("media: venus: fix EOS handling in decoder stop command")
Cc: stable@vger.kernel.org
Reported-by: Mecid <mecid@mecomediagroup.de>
Closes: https://github.com/qualcomm-linux/kernel-topics/issues/222
Co-developed-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
Signed-off-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Tested-by: Renjiang Han <renjiang.han@oss.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/venus/vdec.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index ba4d9087bff5d..27cb024427b83 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -567,7 +567,13 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd)
fdata.buffer_type = HFI_BUFFER_INPUT;
fdata.flags |= HFI_BUFFERFLAG_EOS;
- if (IS_V6(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87))
+
+ /* Send NULL EOS addr for only IRIS2 (SM8250),for firmware <= 1.0.87.
+ * SC7280 also reports "1.0.<hash>" parsed as 1.0.0; restricting to IRIS2
+ * avoids misapplying this quirk and breaking VP9 decode on SC7280.
+ */
+
+ if (IS_IRIS2(inst->core) && is_fw_rev_or_older(inst->core, 1, 0, 87))
fdata.device_addr = 0;
else
fdata.device_addr = 0xdeadb000;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 566/752] Revert "media: iris: Add sanity check for stop streaming"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (109 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 565/752] media: venus: vdec: restrict EOS addr quirk to IRIS2 only Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 567/752] media: iris: Fix ffmpeg corrupted frame error Sasha Levin
` (173 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Dikshita Agarwal, Vikash Garodia, stable, Bryan O'Donoghue,
Hans Verkuil, Sasha Levin
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
[ Upstream commit 370e19042fb8ac68109f8bdb0fdd8118baf39318 ]
This reverts commit ad699fa78b59241c9d71a8cafb51525f3dab04d4.
Revert the check that skipped stop_streaming when the instance was in
IRIS_INST_ERROR, as it caused multiple regressions:
1. Buffers were not returned to vb2 when the instance was already in
error state, triggering warnings in the vb2 core because buffer
completion was skipped.
2. If a session failed early (e.g. unsupported configuration), the
instance transitioned to IRIS_INST_ERROR. When userspace attempted
to stop streaming for cleanup, stop_streaming was skipped due to the
added check, preventing proper teardown and leaving the firmware
in an inconsistent state.
Fixes: ad699fa78b59 ("media: iris: Add sanity check for stop streaming")
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_vb2.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c
index db8768d8a8f61..139b821f7952f 100644
--- a/drivers/media/platform/qcom/iris/iris_vb2.c
+++ b/drivers/media/platform/qcom/iris/iris_vb2.c
@@ -231,8 +231,6 @@ void iris_vb2_stop_streaming(struct vb2_queue *q)
return;
mutex_lock(&inst->lock);
- if (inst->state == IRIS_INST_ERROR)
- goto exit;
if (!V4L2_TYPE_IS_OUTPUT(q->type) &&
!V4L2_TYPE_IS_CAPTURE(q->type))
@@ -243,10 +241,10 @@ void iris_vb2_stop_streaming(struct vb2_queue *q)
goto exit;
exit:
- if (ret) {
- iris_helper_buffers_done(inst, q->type, VB2_BUF_STATE_ERROR);
+ iris_helper_buffers_done(inst, q->type, VB2_BUF_STATE_ERROR);
+ if (ret)
iris_inst_change_state(inst, IRIS_INST_ERROR);
- }
+
mutex_unlock(&inst->lock);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 567/752] media: iris: Fix ffmpeg corrupted frame error
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (110 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 566/752] Revert "media: iris: Add sanity check for stop streaming" Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 568/752] media: iris: Fix fps calculation Sasha Levin
` (172 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Vishnu Reddy, stable, Dikshita Agarwal, Bryan O'Donoghue,
Vikash Garodia, Bryan O'Donoghue, Hans Verkuil, Sasha Levin
From: Vishnu Reddy <quic_bvisredd@quicinc.com>
[ Upstream commit 89f7cf35901138d9828d981ce64c131a3da6e867 ]
When the ffmpeg decoder is running, the driver receives the
V4L2_BUF_FLAG_KEYFRAME flag in the input buffer. The driver then forwards
this flag information to the firmware. The firmware, in turn, copies the
input buffer flags directly into the output buffer flags. Upon receiving
the output buffer from the firmware, the driver observes that the buffer
contains the HFI_BUFFERFLAG_DATACORRUPT flag. The root cause is that both
V4L2_BUF_FLAG_KEYFRAME and HFI_BUFFERFLAG_DATACORRUPT are the same value.
As a result, the driver incorrectly interprets the output frame as
corrupted, even though the frame is actually valid. This misinterpretation
causes the driver to report an error and skip good frames, leading to
missing frames in the final video output and triggering ffmpeg's "corrupt
decoded frame" error.
To resolve this issue, the input buffer flags should not be sent to the
firmware during decoding, since the firmware does not require this
information.
Fixes: 17f2a485ca67 ("media: iris: implement vb2 ops for buf_queue and firmware response")
Cc: stable@vger.kernel.org
Signed-off-by: Vishnu Reddy <quic_bvisredd@quicinc.com>
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
index e1788c266bb10..4de03f31eaf38 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
@@ -282,7 +282,7 @@ static int iris_hfi_gen1_queue_input_buffer(struct iris_inst *inst, struct iris_
com_ip_pkt.shdr.session_id = inst->session_id;
com_ip_pkt.time_stamp_hi = upper_32_bits(buf->timestamp);
com_ip_pkt.time_stamp_lo = lower_32_bits(buf->timestamp);
- com_ip_pkt.flags = buf->flags;
+ com_ip_pkt.flags = 0;
com_ip_pkt.mark_target = 0;
com_ip_pkt.mark_data = 0;
com_ip_pkt.offset = buf->data_offset;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 568/752] media: iris: Fix fps calculation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (111 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 567/752] media: iris: Fix ffmpeg corrupted frame error Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 569/752] media: iris: use fallback size when S_FMT is called without width/height Sasha Levin
` (171 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Ricardo Ribalda, Dikshita Agarwal, stable, Bryan O'Donoghue,
Hans Verkuil, Sasha Levin
From: Ricardo Ribalda <ribalda@chromium.org>
[ Upstream commit 71fe80364a6584f404556ac9a6a4aca4ab80fb5b ]
iris_venc_s_param() uses do_div to divide two 64 bits operators, this is
wrong. Luckily for us, both of the operators fit in 32 bits, so we can use
a normal division.
Now that we are at it, mark the fps smaller than 1 as invalid, the code
does not seem to handle them properly.
The following cocci warning is fixed with this patch:
./platform/qcom/iris/iris_venc.c:378:1-7: WARNING: do_div() does a 64-by-32 division, please consider using div64_u64 instead
Fixes: 4ff586ff28e3 ("media: iris: Add support for G/S_PARM for encoder video device")
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_venc.c | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c
index 099bd5ed4ae02..c11ed778cc9e9 100644
--- a/drivers/media/platform/qcom/iris/iris_venc.c
+++ b/drivers/media/platform/qcom/iris/iris_venc.c
@@ -345,8 +345,7 @@ int iris_venc_s_param(struct iris_inst *inst, struct v4l2_streamparm *s_parm)
struct v4l2_fract *timeperframe = NULL;
u32 default_rate = DEFAULT_FPS;
bool is_frame_rate = false;
- u64 us_per_frame, fps;
- u32 max_rate;
+ u32 fps, max_rate;
int ret = 0;
@@ -368,23 +367,19 @@ int iris_venc_s_param(struct iris_inst *inst, struct v4l2_streamparm *s_parm)
timeperframe->denominator = default_rate;
}
- us_per_frame = timeperframe->numerator * (u64)USEC_PER_SEC;
- do_div(us_per_frame, timeperframe->denominator);
-
- if (!us_per_frame)
+ fps = timeperframe->denominator / timeperframe->numerator;
+ if (!fps)
return -EINVAL;
- fps = (u64)USEC_PER_SEC;
- do_div(fps, us_per_frame);
if (fps > max_rate) {
ret = -ENOMEM;
goto reset_rate;
}
if (is_frame_rate)
- inst->frame_rate = (u32)fps;
+ inst->frame_rate = fps;
else
- inst->operating_rate = (u32)fps;
+ inst->operating_rate = fps;
if ((s_parm->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE && vb2_is_streaming(src_q)) ||
(s_parm->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && vb2_is_streaming(dst_q))) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 569/752] media: iris: use fallback size when S_FMT is called without width/height
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (112 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 568/752] media: iris: Fix fps calculation Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 570/752] media: iris: Add buffer to list only after successful allocation Sasha Levin
` (170 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Val Packett, Dikshita Agarwal, stable, Bryan O'Donoghue,
Hans Verkuil, Sasha Levin
From: Val Packett <val@packett.cool>
[ Upstream commit 4980721cb97d6c47700ab61a048ac8819cfeec87 ]
According to 4.5.1.5 of the M2M stateful decoder UAPI documentation,
providing the width and the height to S_FMT is "required only if it
cannot be parsed from the stream", otherwise they can be left as 0
and the S_FMT implementation is expected to return a valid placeholder
resolution that would let REQBUFS succeed.
iris was missing the fallback, so clients like rpi-ffmpeg wouldn't work.
Fix by adding an explicit fallback to defaults.
Fixes: b530b95de22c ("media: iris: implement s_fmt, g_fmt and try_fmt ioctls")
Link: https://github.com/jc-kynesim/rpi-ffmpeg/issues/103
Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Signed-off-by: Val Packett <val@packett.cool>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_vdec.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
index ae13c3e1b426b..c9f9c16cf0846 100644
--- a/drivers/media/platform/qcom/iris/iris_vdec.c
+++ b/drivers/media/platform/qcom/iris/iris_vdec.c
@@ -196,6 +196,14 @@ int iris_vdec_s_fmt(struct iris_inst *inst, struct v4l2_format *f)
if (vb2_is_busy(q))
return -EBUSY;
+ /* Width and height are optional, so fall back to a valid placeholder
+ * resolution until the real one is decoded from the bitstream.
+ */
+ if (f->fmt.pix_mp.width == 0 && f->fmt.pix_mp.height == 0) {
+ f->fmt.pix_mp.width = DEFAULT_WIDTH;
+ f->fmt.pix_mp.height = DEFAULT_HEIGHT;
+ }
+
iris_vdec_try_fmt(inst, f);
switch (f->type) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 570/752] media: iris: Add buffer to list only after successful allocation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (113 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 569/752] media: iris: use fallback size when S_FMT is called without width/height Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 571/752] media: iris: Skip resolution set on first IPSC Sasha Levin
` (169 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Dikshita Agarwal, Bryan O'Donoghue, Vikash Garodia, stable,
Hans Verkuil, Sasha Levin
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
[ Upstream commit 2d0bbd982dfdd67da488a772f7a8a1bdca7642bf ]
Move `list_add_tail()` to after `dma_alloc_attrs()` succeeds when creating
internal buffers. Previously, the buffer was enqueued in `buffers->list`
before the DMA allocation. If the allocation failed, the function returned
`-ENOMEM` while leaving a partially initialized buffer in the list, which
could lead to inconsistent state and potential leaks.
By adding the buffer to the list only after `dma_alloc_attrs()` succeeds,
we ensure the list contains only valid, fully initialized buffers.
Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers")
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_buffer.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_buffer.c b/drivers/media/platform/qcom/iris/iris_buffer.c
index c0900038e7def..006ad855a8e51 100644
--- a/drivers/media/platform/qcom/iris/iris_buffer.c
+++ b/drivers/media/platform/qcom/iris/iris_buffer.c
@@ -340,12 +340,15 @@ static int iris_create_internal_buffer(struct iris_inst *inst,
buffer->index = index;
buffer->buffer_size = buffers->size;
buffer->dma_attrs = DMA_ATTR_WRITE_COMBINE | DMA_ATTR_NO_KERNEL_MAPPING;
- list_add_tail(&buffer->list, &buffers->list);
buffer->kvaddr = dma_alloc_attrs(core->dev, buffer->buffer_size,
&buffer->device_addr, GFP_KERNEL, buffer->dma_attrs);
- if (!buffer->kvaddr)
+ if (!buffer->kvaddr) {
+ kfree(buffer);
return -ENOMEM;
+ }
+
+ list_add_tail(&buffer->list, &buffers->list);
return 0;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 571/752] media: iris: Skip resolution set on first IPSC
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (114 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 570/752] media: iris: Add buffer to list only after successful allocation Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 572/752] media: iris: gen1: Destroy internal buffers after FW releases Sasha Levin
` (168 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Dikshita Agarwal, Bryan O'Donoghue, Vikash Garodia, stable,
Hans Verkuil, Sasha Levin
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
[ Upstream commit 811dbc546f47559dc9d2098c612acfd47e32479e ]
The resolution property is not supposed to be set during reconfig.
Existing iris_drc_pending(inst) check is insufficient, as it doesn't
cover the first port setting change.
Extend the conditional check to also skip resolution setting when
the instance is in IRIS_INST_SUB_FIRST_IPSC.
Fixes: caf205548769 ("media: iris: Avoid updating frame size to firmware during reconfig")
Reviewed-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
index 4de03f31eaf38..ffb50c98a5b6f 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
@@ -733,7 +733,7 @@ static int iris_hfi_gen1_set_resolution(struct iris_inst *inst, u32 plane)
struct hfi_framesize fs;
int ret;
- if (!iris_drc_pending(inst)) {
+ if (!iris_drc_pending(inst) && !(inst->sub_state & IRIS_INST_SUB_FIRST_IPSC)) {
fs.buffer_type = HFI_BUFFER_INPUT;
fs.width = inst->fmt_src->fmt.pix_mp.width;
fs.height = inst->fmt_src->fmt.pix_mp.height;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 572/752] media: iris: gen1: Destroy internal buffers after FW releases
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (115 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 571/752] media: iris: Skip resolution set on first IPSC Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 573/752] media: iris: gen2: Add sanity check for session stop Sasha Levin
` (167 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Dikshita Agarwal, Bryan O'Donoghue, Vikash Garodia, stable,
Bryan O'Donoghue, Hans Verkuil, Sasha Levin
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
[ Upstream commit 1dabf00ee206eceb0f08a1fe5d1ce635f9064338 ]
After the firmware releases internal buffers, the driver was not
destroying them. This left stale allocations that were no longer used,
especially across resolution changes where new buffers are allocated per
the updated requirements. As a result, memory was wasted until session
close.
Destroy internal buffers once the release response is received from the
firmware.
Fixes: 73702f45db81 ("media: iris: allocate, initialize and queue internal buffers")
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
index ffb50c98a5b6f..aca8f540b0520 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_command.c
@@ -441,6 +441,8 @@ static int iris_hfi_gen1_session_unset_buffers(struct iris_inst *inst, struct ir
goto exit;
ret = iris_wait_for_session_response(inst, false);
+ if (!ret)
+ ret = iris_destroy_internal_buffer(inst, buf);
exit:
kfree(pkt);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 573/752] media: iris: gen2: Add sanity check for session stop
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (116 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 572/752] media: iris: gen1: Destroy internal buffers after FW releases Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 574/752] media: iris: Prevent output buffer queuing before stream-on completes Sasha Levin
` (166 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Dikshita Agarwal, Vikash Garodia, stable, Bryan O'Donoghue,
Hans Verkuil, Sasha Levin
From: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
[ Upstream commit 9aa8d63d09cfc44d879427cc5ba308012ca4ab8e ]
In iris_kill_session, inst->state is set to IRIS_INST_ERROR and
session_close is executed, which will kfree(inst_hfi_gen2->packet).
If stop_streaming is called afterward, it will cause a crash.
Add a NULL check for inst_hfi_gen2->packet before sendling STOP packet
to firmware to fix that.
Fixes: 11712ce70f8e ("media: iris: implement vb2 streaming ops")
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
index 4ce71a1425083..5f6e2c9407e67 100644
--- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
+++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
@@ -946,6 +946,9 @@ static int iris_hfi_gen2_session_stop(struct iris_inst *inst, u32 plane)
struct iris_inst_hfi_gen2 *inst_hfi_gen2 = to_iris_inst_hfi_gen2(inst);
int ret = 0;
+ if (!inst_hfi_gen2->packet)
+ return -EINVAL;
+
reinit_completion(&inst->completion);
iris_hfi_gen2_packet_session_command(inst,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 574/752] media: iris: Prevent output buffer queuing before stream-on completes
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (117 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 573/752] media: iris: gen2: Add sanity check for session stop Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 575/752] drm: of: drm_of_panel_bridge_remove(): fix device_node leak Sasha Levin
` (165 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Vishnu Reddy, Dikshita Agarwal, Vikash Garodia, stable,
Bryan O'Donoghue, Hans Verkuil, Sasha Levin
From: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
[ Upstream commit 2c73cfd0cfc44ffe331ccb81f6ac45fc399d9ddb ]
During normal playback, stream-on for input is followed by output, and
only after input stream-on does actual streaming begin. However, when
gst-play performs a seek, both input and output streams are stopped,
and on restart, output stream-on occurs first. At this point, firmware
has not yet started streaming. Queuing output buffers before the firmware
begins streaming causes it to process buffers in an invalid state, leading
to an error response. These buffers are returned to the driver as errors,
forcing the driver into an error state and stopping playback.
Fix this by deferring output buffer queuing until stream-on completes.
Input buffers can still be queued before stream-on as required.
Fixes: 92e007ca5ab6 ("media: iris: Add V4L2 streaming support for encoder video device")
Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com>
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/platform/qcom/iris/iris_vb2.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c
index 139b821f7952f..bf0b8400996ec 100644
--- a/drivers/media/platform/qcom/iris/iris_vb2.c
+++ b/drivers/media/platform/qcom/iris/iris_vb2.c
@@ -193,10 +193,14 @@ int iris_vb2_start_streaming(struct vb2_queue *q, unsigned int count)
buf_type = iris_v4l2_type_to_driver(q->type);
if (inst->domain == DECODER) {
- if (inst->state == IRIS_INST_STREAMING)
+ if (buf_type == BUF_INPUT)
+ ret = iris_queue_deferred_buffers(inst, BUF_INPUT);
+
+ if (!ret && inst->state == IRIS_INST_STREAMING) {
ret = iris_queue_internal_deferred_buffers(inst, BUF_DPB);
- if (!ret)
- ret = iris_queue_deferred_buffers(inst, buf_type);
+ if (!ret)
+ ret = iris_queue_deferred_buffers(inst, BUF_OUTPUT);
+ }
} else {
if (inst->state == IRIS_INST_STREAMING) {
ret = iris_queue_deferred_buffers(inst, BUF_INPUT);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 575/752] drm: of: drm_of_panel_bridge_remove(): fix device_node leak
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (118 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 574/752] media: iris: Prevent output buffer queuing before stream-on completes Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 576/752] docs: kdoc: avoid error_count overflows Sasha Levin
` (164 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Luca Ceresoli, stable, Maxime Ripard, Sasha Levin
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
[ Upstream commit a4b4385d0523e39a7c058cb5a6c8269e513126ca ]
drm_of_panel_bridge_remove() uses of_graph_get_remote_node() to get a
device_node but does not put the node reference.
Fixes: c70087e8f16f ("drm/drm_of: add drm_of_panel_bridge_remove function")
Cc: stable@vger.kernel.org # v4.15
Acked-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260109-drm-bridge-alloc-getput-drm_of_find_bridge-2-v2-1-8bad3ef90b9f@bootlin.com
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/drm/drm_of.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/include/drm/drm_of.h b/include/drm/drm_of.h
index 7f0256dae3f13..f3e55ea2174c0 100644
--- a/include/drm/drm_of.h
+++ b/include/drm/drm_of.h
@@ -5,6 +5,7 @@
#include <linux/err.h>
#include <linux/of_graph.h>
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
+#include <linux/of.h>
#include <drm/drm_bridge.h>
#endif
@@ -173,6 +174,8 @@ static inline int drm_of_panel_bridge_remove(const struct device_node *np,
bridge = of_drm_find_bridge(remote);
drm_panel_bridge_remove(bridge);
+ of_node_put(remote);
+
return 0;
#else
return -EINVAL;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 576/752] docs: kdoc: avoid error_count overflows
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (119 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 575/752] drm: of: drm_of_panel_bridge_remove(): fix device_node leak Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 577/752] mm, page_alloc, thp: prevent reclaim for __GFP_THISNODE THP allocations Sasha Levin
` (163 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Mauro Carvalho Chehab, stable, Jonathan Corbet, Sasha Levin
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
[ Upstream commit 802774d8539fa73487190ec45438777a3c38d424 ]
The glibc library limits the return code to 8 bits. We need to
stick to this limit when using sys.exit(error_count).
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Message-ID: <233d1674db99ed8feb405a2f781de350f0fba0ac.1768823489.git.mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/kernel-doc.py | 26 +++++++++++++++++++-------
1 file changed, 19 insertions(+), 7 deletions(-)
diff --git a/scripts/kernel-doc.py b/scripts/kernel-doc.py
index d9fe2bcbd39cc..a6bb180b13d65 100755
--- a/scripts/kernel-doc.py
+++ b/scripts/kernel-doc.py
@@ -116,6 +116,8 @@ SRC_DIR = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(SRC_DIR, LIB_DIR))
+WERROR_RETURN_CODE = 3
+
DESC = """
Read C language source or header FILEs, extract embedded documentation comments,
and print formatted documentation to standard output.
@@ -176,7 +178,21 @@ class MsgFormatter(logging.Formatter):
return logging.Formatter.format(self, record)
def main():
- """Main program"""
+ """
+ Main program.
+
+ By default, the return value is:
+
+ - 0: success or Python version is not compatible with
+ kernel-doc. If -Werror is not used, it will also
+ return 0 if there are issues at kernel-doc markups;
+
+ - 1: an abnormal condition happened;
+
+ - 2: argparse issued an error;
+
+ - 3: -Werror is used, and one or more unfiltered parse warnings happened.
+ """
parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter,
description=DESC)
@@ -323,16 +339,12 @@ def main():
if args.werror:
print("%s warnings as errors" % error_count) # pylint: disable=C0209
- sys.exit(error_count)
+ sys.exit(WERROR_RETURN_CODE)
if args.verbose:
print("%s errors" % error_count) # pylint: disable=C0209
- if args.none:
- sys.exit(0)
-
- sys.exit(error_count)
-
+ sys.exit(0)
# Call main method
if __name__ == "__main__":
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 577/752] mm, page_alloc, thp: prevent reclaim for __GFP_THISNODE THP allocations
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (120 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 576/752] docs: kdoc: avoid error_count overflows Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 578/752] selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs Sasha Levin
` (162 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Vlastimil Babka, Michal Hocko, Johannes Weiner, Pedro Falcato,
Zi Yan, Brendan Jackman, David Hildenbrand (Red Hat),
David Rientjes, Joshua Hahn, Liam Howlett, Lorenzo Stoakes,
Mike Rapoport, Suren Baghdasaryan, stable, Andrew Morton,
Sasha Levin
From: Vlastimil Babka <vbabka@suse.cz>
[ Upstream commit 9c9828d3ead69416d731b1238802af31760c823e ]
Since commit cc638f329ef6 ("mm, thp: tweak reclaim/compaction effort of
local-only and all-node allocations"), THP page fault allocations have
settled on the following scheme (from the commit log):
1. local node only THP allocation with no reclaim, just compaction.
2. for madvised VMA's or when synchronous compaction is enabled always - THP
allocation from any node with effort determined by global defrag setting
and VMA madvise
3. fallback to base pages on any node
Recent customer reports however revealed we have a gap in step 1 above.
What we have seen is excessive reclaim due to THP page faults on a NUMA
node that's close to its high watermark, while other nodes have plenty of
free memory.
The problem with step 1 is that it promises no reclaim after the
compaction attempt, however reclaim is only avoided for certain compaction
outcomes (deferred, or skipped due to insufficient free base pages), and
not e.g. when compaction is actually performed but fails (we did see
compact_fail vmstat counter increasing).
THP page faults can therefore exhibit a zone_reclaim_mode-like behavior,
which is not the intention.
Thus add a check for __GFP_THISNODE that corresponds to this exact
situation and prevents continuing with reclaim/compaction once the initial
compaction attempt isn't successful in allocating the page.
Note that commit cc638f329ef6 has not introduced this over-reclaim
possibility; it appears to exist in some form since commit 2f0799a0ffc0
("mm, thp: restore node-local hugepage allocations"). Followup commits
b39d0ee2632d ("mm, page_alloc: avoid expensive reclaim when compaction may
not succeed") and cc638f329ef6 have moved in the right direction, but left
the abovementioned gap.
Link: https://lkml.kernel.org/r/20251219-costly-noretry-thisnode-fix-v1-1-e1085a4a0c34@suse.cz
Fixes: 2f0799a0ffc0 ("mm, thp: restore node-local hugepage allocations")
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Michal Hocko <mhocko@suse.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Pedro Falcato <pfalcato@suse.de>
Acked-by: Zi Yan <ziy@nvidia.com>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: "David Hildenbrand (Red Hat)" <david@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 623f6e5b583ab..10708f37575d4 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4789,6 +4789,20 @@ __alloc_pages_slowpath(gfp_t gfp_mask, unsigned int order,
compact_result == COMPACT_DEFERRED)
goto nopage;
+ /*
+ * THP page faults may attempt local node only first,
+ * but are then allowed to only compact, not reclaim,
+ * see alloc_pages_mpol().
+ *
+ * Compaction can fail for other reasons than those
+ * checked above and we don't want such THP allocations
+ * to put reclaim pressure on a single node in a
+ * situation where other nodes might have plenty of
+ * available memory.
+ */
+ if (gfp_mask & __GFP_THISNODE)
+ goto nopage;
+
/*
* Looks like reclaim/compaction is worth trying, but
* sync compaction could be very expensive, so keep
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 578/752] selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (121 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 577/752] mm, page_alloc, thp: prevent reclaim for __GFP_THISNODE THP allocations Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 579/752] drm/buddy: Prevent BUG_ON by validating rounded allocation Sasha Levin
` (161 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Li Wang, David Hildenbrand (Red Hat), Waiman Long, Mark Brown,
Shuah Khan, stable, Andrew Morton, Sasha Levin
From: Li Wang <liwang@redhat.com>
[ Upstream commit 1aa1dd9cc595917882fb6db67725442956f79607 ]
charge_reserved_hugetlb.sh mounts a hugetlbfs instance at /mnt/huge with a
fixed size of 256M. On systems with large base hugepages (e.g. 512MB),
this is smaller than a single hugepage, so the hugetlbfs mount ends up
with zero capacity (often visible as size=0 in mount output).
As a result, write_to_hugetlbfs fails with ENOMEM and the test can hang
waiting for progress.
=== Error log ===
# uname -r
6.12.0-xxx.el10.aarch64+64k
#./charge_reserved_hugetlb.sh -cgroup-v2
# -----------------------------------------
...
# nr hugepages = 10
# writing cgroup limit: 5368709120
# writing reseravation limit: 5368709120
...
# write_to_hugetlbfs: Error mapping the file: Cannot allocate memory
# Waiting for hugetlb memory reservation to reach size 2684354560.
# 0
# Waiting for hugetlb memory reservation to reach size 2684354560.
# 0
...
# mount |grep /mnt/huge
none on /mnt/huge type hugetlbfs (rw,relatime,seclabel,pagesize=512M,size=0)
# grep -i huge /proc/meminfo
...
HugePages_Total: 10
HugePages_Free: 10
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 524288 kB
Hugetlb: 5242880 kB
Drop the mount args with 'size=256M', so the filesystem capacity is sufficient
regardless of HugeTLB page size.
Link: https://lkml.kernel.org/r/20251221122639.3168038-3-liwang@redhat.com
Fixes: 29750f71a9b4 ("hugetlb_cgroup: add hugetlb_cgroup reservation tests")
Signed-off-by: Li Wang <liwang@redhat.com>
Acked-by: David Hildenbrand (Red Hat) <david@kernel.org>
Acked-by: Waiman Long <longman@redhat.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/testing/selftests/mm/charge_reserved_hugetlb.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
index e1fe16bcbbe88..fa6713892d82d 100755
--- a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
+++ b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
@@ -290,7 +290,7 @@ function run_test() {
setup_cgroup "hugetlb_cgroup_test" "$cgroup_limit" "$reservation_limit"
mkdir -p /mnt/huge
- mount -t hugetlbfs -o pagesize=${MB}M,size=256M none /mnt/huge
+ mount -t hugetlbfs -o pagesize=${MB}M none /mnt/huge
write_hugetlbfs_and_get_usage "hugetlb_cgroup_test" "$size" "$populate" \
"$write" "/mnt/huge/test" "$method" "$private" "$expect_failure" \
@@ -344,7 +344,7 @@ function run_multiple_cgroup_test() {
setup_cgroup "hugetlb_cgroup_test2" "$cgroup_limit2" "$reservation_limit2"
mkdir -p /mnt/huge
- mount -t hugetlbfs -o pagesize=${MB}M,size=256M none /mnt/huge
+ mount -t hugetlbfs -o pagesize=${MB}M none /mnt/huge
write_hugetlbfs_and_get_usage "hugetlb_cgroup_test1" "$size1" \
"$populate1" "$write1" "/mnt/huge/test1" "$method" "$private" \
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 579/752] drm/buddy: Prevent BUG_ON by validating rounded allocation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (122 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 578/752] selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 581/752] phy: fsl-imx8mq-usb: set platform driver data Sasha Levin
` (160 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Sanjay Yadav, stable, Christian König,
Arunpravin Paneer Selvam, Matthew Auld, Sasha Levin
From: Sanjay Yadav <sanjay.kumar.yadav@intel.com>
[ Upstream commit 5488a29596cdba93a60a79398dc9b69d5bdadf92 ]
When DRM_BUDDY_CONTIGUOUS_ALLOCATION is set, the requested size is
rounded up to the next power-of-two via roundup_pow_of_two().
Similarly, for non-contiguous allocations with large min_block_size,
the size is aligned up via round_up(). Both operations can produce a
rounded size that exceeds mm->size, which later triggers
BUG_ON(order > mm->max_order).
Example scenarios:
- 9G CONTIGUOUS allocation on 10G VRAM memory:
roundup_pow_of_two(9G) = 16G > 10G
- 9G allocation with 8G min_block_size on 10G VRAM memory:
round_up(9G, 8G) = 16G > 10G
Fix this by checking the rounded size against mm->size. For
non-contiguous or range allocations where size > mm->size is invalid,
return -EINVAL immediately. For contiguous allocations without range
restrictions, allow the request to fall through to the existing
__alloc_contig_try_harder() fallback.
This ensures invalid user input returns an error or uses the fallback
path instead of hitting BUG_ON.
v2: (Matt A)
- Add Fixes, Cc stable, and Closes tags for context
Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/6712
Fixes: 0a1844bf0b53 ("drm/buddy: Improve contiguous memory allocation")
Cc: <stable@vger.kernel.org> # v6.7+
Cc: Christian König <christian.koenig@amd.com>
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Suggested-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Sanjay Yadav <sanjay.kumar.yadav@intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Signed-off-by: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Link: https://patch.msgid.link/20260108113227.2101872-5-sanjay.kumar.yadav@intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/drm_buddy.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/gpu/drm/drm_buddy.c b/drivers/gpu/drm/drm_buddy.c
index 3f1a9892f2a39..640d93070bb7c 100644
--- a/drivers/gpu/drm/drm_buddy.c
+++ b/drivers/gpu/drm/drm_buddy.c
@@ -1155,6 +1155,15 @@ int drm_buddy_alloc_blocks(struct drm_buddy *mm,
order = fls(pages) - 1;
min_order = ilog2(min_block_size) - ilog2(mm->chunk_size);
+ if (order > mm->max_order || size > mm->size) {
+ if ((flags & DRM_BUDDY_CONTIGUOUS_ALLOCATION) &&
+ !(flags & DRM_BUDDY_RANGE_ALLOCATION))
+ return __alloc_contig_try_harder(mm, original_size,
+ original_min_size, blocks);
+
+ return -EINVAL;
+ }
+
do {
order = min(order, (unsigned int)fls(pages) - 1);
BUG_ON(order > mm->max_order);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 581/752] phy: fsl-imx8mq-usb: set platform driver data
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (123 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 579/752] drm/buddy: Prevent BUG_ON by validating rounded allocation Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 582/752] PCI: dwc: Skip waiting for L2/L3 Ready if dw_pcie_rp::skip_l23_wait is true Sasha Levin
` (159 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Xu Yang, stable, Frank Li, Vinod Koul, Sasha Levin
From: Xu Yang <xu.yang_2@nxp.com>
[ Upstream commit debf8326a435ac746f48173e4742a574810f1ff4 ]
Add missing platform_set_drvdata() as the data will be used in remove().
Fixes: b58f0f86fd61 ("phy: fsl-imx8mq-usb: add tca function driver for imx95")
Cc: stable@vger.kernel.org
Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20260120111646.3159766-1-xu.yang_2@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/phy/freescale/phy-fsl-imx8mq-usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
index bd37b6cb69cdc..8e7b6e10e1f0b 100644
--- a/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
+++ b/drivers/phy/freescale/phy-fsl-imx8mq-usb.c
@@ -662,6 +662,8 @@ static int imx8mq_usb_phy_probe(struct platform_device *pdev)
if (!imx_phy)
return -ENOMEM;
+ platform_set_drvdata(pdev, imx_phy);
+
imx_phy->clk = devm_clk_get(dev, "phy");
if (IS_ERR(imx_phy->clk)) {
dev_err(dev, "failed to get imx8mq usb phy clock\n");
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 582/752] PCI: dwc: Skip waiting for L2/L3 Ready if dw_pcie_rp::skip_l23_wait is true
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (124 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 581/752] phy: fsl-imx8mq-usb: set platform driver data Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 583/752] xfs: mark data structures corrupt on EIO and ENODATA Sasha Levin
` (158 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Richard Zhu, Manivannan Sadhasivam, Frank Li, stable, Sasha Levin
From: Richard Zhu <hongxing.zhu@nxp.com>
[ Upstream commit 58a17b2647ba5aac47e3ffafd0a9b92bf4a9bcbe ]
In NXP i.MX6QP and i.MX7D SoCs, LTSSM registers are not accessible once
PME_Turn_Off message is broadcasted to the link. So there is no way to
verify whether the link has entered L2/L3 Ready state or not.
Hence, add a new flag 'dw_pcie_rp::skip_l23_ready' and set it to 'true' for
the above mentioned SoCs. This flag when set, will allow the DWC core to
skip polling for L2/L3 Ready state and just wait for 10ms as recommended in
the PCIe spec r6.0, sec 5.3.3.2.1.
Fixes: a528d1a72597 ("PCI: imx6: Use DWC common suspend resume method")
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
[mani: renamed flag to skip_l23_ready and reworded description]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260114083300.3689672-2-hongxing.zhu@nxp.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pci-imx6.c | 5 +++++
drivers/pci/controller/dwc/pcie-designware-host.c | 10 ++++++++++
drivers/pci/controller/dwc/pcie-designware.h | 1 +
3 files changed, 16 insertions(+)
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 34f8f69ddfae9..a42164c870548 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -116,6 +116,7 @@ enum imx_pcie_variants {
#define IMX_PCIE_FLAG_BROKEN_SUSPEND BIT(9)
#define IMX_PCIE_FLAG_HAS_LUT BIT(10)
#define IMX_PCIE_FLAG_8GT_ECN_ERR051586 BIT(11)
+#define IMX_PCIE_FLAG_SKIP_L23_READY BIT(12)
#define imx_check_flag(pci, val) (pci->drvdata->flags & val)
@@ -1795,6 +1796,8 @@ static int imx_pcie_probe(struct platform_device *pdev)
*/
imx_pcie_add_lut_by_rid(imx_pcie, 0);
} else {
+ if (imx_check_flag(imx_pcie, IMX_PCIE_FLAG_SKIP_L23_READY))
+ pci->pp.skip_l23_ready = true;
pci->pp.use_atu_msg = true;
ret = dw_pcie_host_init(&pci->pp);
if (ret < 0)
@@ -1856,6 +1859,7 @@ static const struct imx_pcie_drvdata drvdata[] = {
.variant = IMX6QP,
.flags = IMX_PCIE_FLAG_IMX_PHY |
IMX_PCIE_FLAG_SPEED_CHANGE_WORKAROUND |
+ IMX_PCIE_FLAG_SKIP_L23_READY |
IMX_PCIE_FLAG_SUPPORTS_SUSPEND,
.dbi_length = 0x200,
.gpr = "fsl,imx6q-iomuxc-gpr",
@@ -1872,6 +1876,7 @@ static const struct imx_pcie_drvdata drvdata[] = {
.variant = IMX7D,
.flags = IMX_PCIE_FLAG_SUPPORTS_SUSPEND |
IMX_PCIE_FLAG_HAS_APP_RESET |
+ IMX_PCIE_FLAG_SKIP_L23_READY |
IMX_PCIE_FLAG_HAS_PHY_RESET,
.gpr = "fsl,imx7d-iomuxc-gpr",
.mode_off[0] = IOMUXC_GPR12,
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 60fadaa1c0bd2..03d01d051e9b0 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -1161,6 +1161,16 @@ int dw_pcie_suspend_noirq(struct dw_pcie *pci)
return ret;
}
+ /*
+ * Some SoCs do not support reading the LTSSM register after
+ * PME_Turn_Off broadcast. For those SoCs, skip waiting for L2/L3 Ready
+ * state and wait 10ms as recommended in PCIe spec r6.0, sec 5.3.3.2.1.
+ */
+ if (pci->pp.skip_l23_ready) {
+ mdelay(PCIE_PME_TO_L2_TIMEOUT_US/1000);
+ goto stop_link;
+ }
+
ret = read_poll_timeout(dw_pcie_get_ltssm, val,
val == DW_PCIE_LTSSM_L2_IDLE ||
val <= DW_PCIE_LTSSM_DETECT_WAIT,
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index 7c56146b95f6b..96e89046614da 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -430,6 +430,7 @@ struct dw_pcie_rp {
struct pci_config_window *cfg;
bool ecam_enabled;
bool native_ecam;
+ bool skip_l23_ready;
};
struct dw_pcie_ep_ops {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 583/752] xfs: mark data structures corrupt on EIO and ENODATA
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (125 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 582/752] PCI: dwc: Skip waiting for L2/L3 Ready if dw_pcie_rp::skip_l23_wait is true Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 584/752] xfs: remove xfs_attr_leaf_hasname Sasha Levin
` (157 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Darrick J. Wong, stable, Christoph Hellwig, Carlos Maiolino,
Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit f39854a3fb2f06dc69b81ada002b641ba5b4696b ]
I learned a few things this year: first, blk_status_to_errno can return
ENODATA for critical media errors; and second, the scrub code doesn't
mark data structures as corrupt on ENODATA or EIO.
Currently, scrub failing to capture these errors isn't all that
impactful -- the checking code will exit to userspace with EIO/ENODATA,
and xfs_scrub will log a complaint and exit with nonzero status. Most
people treat fsck tools failing as a sign that the fs is corrupt, but
online fsck should mark the metadata bad and keep moving.
Cc: stable@vger.kernel.org # v4.15
Fixes: 4700d22980d459 ("xfs: create helpers to record and deal with scrub problems")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/scrub/btree.c | 2 ++
fs/xfs/scrub/common.c | 4 ++++
fs/xfs/scrub/dabtree.c | 2 ++
3 files changed, 8 insertions(+)
diff --git a/fs/xfs/scrub/btree.c b/fs/xfs/scrub/btree.c
index acade92c5fce1..b497f6a474c77 100644
--- a/fs/xfs/scrub/btree.c
+++ b/fs/xfs/scrub/btree.c
@@ -42,6 +42,8 @@ __xchk_btree_process_error(
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
+ case -EIO:
+ case -ENODATA:
/* Note the badness but don't abort. */
sc->sm->sm_flags |= errflag;
*error = 0;
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index 2ef7742be7d3d..e6145c2eda02a 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -103,6 +103,8 @@ __xchk_process_error(
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
+ case -EIO:
+ case -ENODATA:
/* Note the badness but don't abort. */
sc->sm->sm_flags |= errflag;
*error = 0;
@@ -177,6 +179,8 @@ __xchk_fblock_process_error(
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
+ case -EIO:
+ case -ENODATA:
/* Note the badness but don't abort. */
sc->sm->sm_flags |= errflag;
*error = 0;
diff --git a/fs/xfs/scrub/dabtree.c b/fs/xfs/scrub/dabtree.c
index 056de4819f866..a6a5d3a75d994 100644
--- a/fs/xfs/scrub/dabtree.c
+++ b/fs/xfs/scrub/dabtree.c
@@ -45,6 +45,8 @@ xchk_da_process_error(
break;
case -EFSBADCRC:
case -EFSCORRUPTED:
+ case -EIO:
+ case -ENODATA:
/* Note the badness but don't abort. */
sc->sm->sm_flags |= XFS_SCRUB_OFLAG_CORRUPT;
*error = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 584/752] xfs: remove xfs_attr_leaf_hasname
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (126 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 583/752] xfs: mark data structures corrupt on EIO and ENODATA Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 585/752] media: verisilicon: AV1: Fix tile info buffer size Sasha Levin
` (156 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Christoph Hellwig, stable, Mark Tinguely, Darrick J. Wong,
Carlos Maiolino, Sasha Levin
From: Christoph Hellwig <hch@lst.de>
[ Upstream commit 3a65ea768b8094e4699e72f9ab420eb9e0f3f568 ]
The calling convention of xfs_attr_leaf_hasname() is problematic, because
it returns a NULL buffer when xfs_attr3_leaf_read fails, a valid buffer
when xfs_attr3_leaf_lookup_int returns -ENOATTR or -EEXIST, and a
non-NULL buffer pointer for an already released buffer when
xfs_attr3_leaf_lookup_int fails with other error values.
Fix this by simply open coding xfs_attr_leaf_hasname in the callers, so
that the buffer release code is done by each caller of
xfs_attr3_leaf_read.
Cc: stable@vger.kernel.org # v5.19+
Fixes: 07120f1abdff ("xfs: Add xfs_has_attr and subroutines")
Reported-by: Mark Tinguely <mark.tinguely@oracle.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/libxfs/xfs_attr.c | 75 +++++++++++++---------------------------
1 file changed, 24 insertions(+), 51 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_attr.c b/fs/xfs/libxfs/xfs_attr.c
index 8c04acd30d489..b88e65c7e45de 100644
--- a/fs/xfs/libxfs/xfs_attr.c
+++ b/fs/xfs/libxfs/xfs_attr.c
@@ -50,7 +50,6 @@ STATIC int xfs_attr_shortform_addname(xfs_da_args_t *args);
*/
STATIC int xfs_attr_leaf_get(xfs_da_args_t *args);
STATIC int xfs_attr_leaf_removename(xfs_da_args_t *args);
-STATIC int xfs_attr_leaf_hasname(struct xfs_da_args *args, struct xfs_buf **bp);
/*
* Internal routines when attribute list is more than one block.
@@ -979,11 +978,12 @@ xfs_attr_lookup(
return error;
if (xfs_attr_is_leaf(dp)) {
- error = xfs_attr_leaf_hasname(args, &bp);
-
- if (bp)
- xfs_trans_brelse(args->trans, bp);
-
+ error = xfs_attr3_leaf_read(args->trans, args->dp, args->owner,
+ 0, &bp);
+ if (error)
+ return error;
+ error = xfs_attr3_leaf_lookup_int(bp, args);
+ xfs_trans_brelse(args->trans, bp);
return error;
}
@@ -1222,27 +1222,6 @@ xfs_attr_shortform_addname(
* External routines when attribute list is one block
*========================================================================*/
-/*
- * Return EEXIST if attr is found, or ENOATTR if not
- */
-STATIC int
-xfs_attr_leaf_hasname(
- struct xfs_da_args *args,
- struct xfs_buf **bp)
-{
- int error = 0;
-
- error = xfs_attr3_leaf_read(args->trans, args->dp, args->owner, 0, bp);
- if (error)
- return error;
-
- error = xfs_attr3_leaf_lookup_int(*bp, args);
- if (error != -ENOATTR && error != -EEXIST)
- xfs_trans_brelse(args->trans, *bp);
-
- return error;
-}
-
/*
* Remove a name from the leaf attribute list structure
*
@@ -1253,25 +1232,22 @@ STATIC int
xfs_attr_leaf_removename(
struct xfs_da_args *args)
{
- struct xfs_inode *dp;
- struct xfs_buf *bp;
+ struct xfs_inode *dp = args->dp;
int error, forkoff;
+ struct xfs_buf *bp;
trace_xfs_attr_leaf_removename(args);
- /*
- * Remove the attribute.
- */
- dp = args->dp;
-
- error = xfs_attr_leaf_hasname(args, &bp);
- if (error == -ENOATTR) {
+ error = xfs_attr3_leaf_read(args->trans, args->dp, args->owner, 0, &bp);
+ if (error)
+ return error;
+ error = xfs_attr3_leaf_lookup_int(bp, args);
+ if (error != -EEXIST) {
xfs_trans_brelse(args->trans, bp);
- if (args->op_flags & XFS_DA_OP_RECOVERY)
+ if (error == -ENOATTR && (args->op_flags & XFS_DA_OP_RECOVERY))
return 0;
return error;
- } else if (error != -EEXIST)
- return error;
+ }
xfs_attr3_leaf_remove(bp, args);
@@ -1295,23 +1271,20 @@ xfs_attr_leaf_removename(
* Returns 0 on successful retrieval, otherwise an error.
*/
STATIC int
-xfs_attr_leaf_get(xfs_da_args_t *args)
+xfs_attr_leaf_get(
+ struct xfs_da_args *args)
{
- struct xfs_buf *bp;
- int error;
+ struct xfs_buf *bp;
+ int error;
trace_xfs_attr_leaf_get(args);
- error = xfs_attr_leaf_hasname(args, &bp);
-
- if (error == -ENOATTR) {
- xfs_trans_brelse(args->trans, bp);
- return error;
- } else if (error != -EEXIST)
+ error = xfs_attr3_leaf_read(args->trans, args->dp, args->owner, 0, &bp);
+ if (error)
return error;
-
-
- error = xfs_attr3_leaf_getvalue(bp, args);
+ error = xfs_attr3_leaf_lookup_int(bp, args);
+ if (error == -EEXIST)
+ error = xfs_attr3_leaf_getvalue(bp, args);
xfs_trans_brelse(args->trans, bp);
return error;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 585/752] media: verisilicon: AV1: Fix tile info buffer size
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (127 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 584/752] xfs: remove xfs_attr_leaf_hasname Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 586/752] dm: fix excessive blk-crypto operations for invalid keys Sasha Levin
` (155 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Benjamin Gaignard, stable, Nicolas Dufresne, Hans Verkuil,
Sasha Levin
From: Benjamin Gaignard <benjamin.gaignard@collabora.com>
[ Upstream commit a505ca2db89ad92a8d8d27fa68ebafb12e04a679 ]
Each tile info is composed of: row_sb, col_sb, start_pos
and end_pos (4 bytes each). So the total required memory
is AV1_MAX_TILES * 16 bytes.
Use the correct #define to allocate the buffer and avoid
writing tile info in non-allocated memory.
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Fixes: 727a400686a2c ("media: verisilicon: Add Rockchip AV1 decoder")
Cc: stable@vger.kernel.org
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
index 500e94bcb0293..e4e21ad373233 100644
--- a/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
+++ b/drivers/media/platform/verisilicon/rockchip_vpu981_hw_av1_dec.c
@@ -381,12 +381,12 @@ int rockchip_vpu981_av1_dec_init(struct hantro_ctx *ctx)
return -ENOMEM;
av1_dec->global_model.size = GLOBAL_MODEL_SIZE;
- av1_dec->tile_info.cpu = dma_alloc_coherent(vpu->dev, AV1_MAX_TILES,
+ av1_dec->tile_info.cpu = dma_alloc_coherent(vpu->dev, AV1_TILE_INFO_SIZE,
&av1_dec->tile_info.dma,
GFP_KERNEL);
if (!av1_dec->tile_info.cpu)
return -ENOMEM;
- av1_dec->tile_info.size = AV1_MAX_TILES;
+ av1_dec->tile_info.size = AV1_TILE_INFO_SIZE;
av1_dec->film_grain.cpu = dma_alloc_coherent(vpu->dev,
ALIGN(sizeof(struct rockchip_av1_film_grain), 2048),
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 586/752] dm: fix excessive blk-crypto operations for invalid keys
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (128 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 585/752] media: verisilicon: AV1: Fix tile info buffer size Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 587/752] media: uvcvideo: Return queued buffers on start_streaming() failure Sasha Levin
` (154 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Eric Biggers, stable, Mikulas Patocka, Sasha Levin
From: Eric Biggers <ebiggers@kernel.org>
[ Upstream commit d6d0e6b9d54532264761405a1ba8ea5bd293acb1 ]
dm_exec_wrappedkey_op() passes through the derive_sw_secret, import_key,
generate_key, and prepare_key blk-crypto operations to an underlying
device.
Currently, it calls the operation on every underlying device until one
returns success.
This logic is flawed when the operation is expected to fail, such as an
invalid key being passed to derive_sw_secret. That can happen if
userspace passes an invalid key to the FS_IOC_ADD_ENCRYPTION_KEY ioctl.
When that happens on a device-mapper device that consists of many
dm-linear targets, a lot of unnecessary key unwrapping requests get sent
to the underlying key wrapping hardware.
Fix this by considering the first device only. As already documented in
the comment, it was already checked that all underlying devices support
wrapped keys, so this should be fine.
Fixes: e93912786e50 ("dm: pass through operations on wrapped inline crypto keys")
Cc: stable@vger.kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-table.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index ad0a60a07b935..81265ed204b54 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1237,9 +1237,6 @@ static int dm_wrappedkey_op_callback(struct dm_target *ti, struct dm_dev *dev,
bdev_get_queue(bdev)->crypto_profile;
int err = -EOPNOTSUPP;
- if (!args->err)
- return 0;
-
switch (args->op) {
case DERIVE_SW_SECRET:
err = blk_crypto_derive_sw_secret(
@@ -1266,9 +1263,7 @@ static int dm_wrappedkey_op_callback(struct dm_target *ti, struct dm_dev *dev,
break;
}
args->err = err;
-
- /* Try another device in case this fails. */
- return 0;
+ return 1; /* No need to continue the iteration. */
}
static int dm_exec_wrappedkey_op(struct blk_crypto_profile *profile,
@@ -1294,14 +1289,13 @@ static int dm_exec_wrappedkey_op(struct blk_crypto_profile *profile,
* declared on all underlying devices. Thus, all the underlying devices
* should support all wrapped key operations and they should behave
* identically, i.e. work with the same keys. So, just executing the
- * operation on the first device on which it works suffices for now.
+ * operation on the first device suffices for now.
*/
for (i = 0; i < t->num_targets; i++) {
ti = dm_table_get_target(t, i);
if (!ti->type->iterate_devices)
continue;
- ti->type->iterate_devices(ti, dm_wrappedkey_op_callback, args);
- if (!args->err)
+ if (ti->type->iterate_devices(ti, dm_wrappedkey_op_callback, args) != 0)
break;
}
out:
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 587/752] media: uvcvideo: Return queued buffers on start_streaming() failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (129 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 586/752] dm: fix excessive blk-crypto operations for invalid keys Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 588/752] iommu/vt-d: Flush dev-IOTLB only when PCIe device is accessible in scalable mode Sasha Levin
` (153 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches
Cc: Michal Pecio, stable, Ricardo Ribalda, Laurent Pinchart,
Hans Verkuil, Sasha Levin
From: Michal Pecio <michal.pecio@gmail.com>
[ Upstream commit 4cf3b6fd54ebb1ebc977bdc47fb6cfcf9a471a22 ]
Return buffers if streaming fails to start due to uvc_pm_get() error.
This bug may be responsible for a warning I got running
while :; do yavta -c3 /dev/video0; done
on an xHCI controller which failed under this workload.
I had no luck reproducing this warning again to confirm.
xhci_hcd 0000:09:00.0: HC died; cleaning up
usb 13-2: USB disconnect, device number 2
WARNING: CPU: 2 PID: 29386 at drivers/media/common/videobuf2/videobuf2-core.c:1803 vb2_start_streaming+0xac/0x120
Fixes: 7dd56c47784a ("media: uvcvideo: Remove stream->is_streaming field")
Cc: stable@vger.kernel.org
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patch.msgid.link/20251015133642.3dede646.michal.pecio@gmail.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/media/usb/uvc/uvc_queue.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/media/usb/uvc/uvc_queue.c b/drivers/media/usb/uvc/uvc_queue.c
index 790184c9843d2..e838c6c1893a6 100644
--- a/drivers/media/usb/uvc/uvc_queue.c
+++ b/drivers/media/usb/uvc/uvc_queue.c
@@ -177,18 +177,20 @@ static int uvc_start_streaming_video(struct vb2_queue *vq, unsigned int count)
ret = uvc_pm_get(stream->dev);
if (ret)
- return ret;
+ goto err_buffers;
queue->buf_used = 0;
ret = uvc_video_start_streaming(stream);
- if (ret == 0)
- return 0;
+ if (ret)
+ goto err_pm;
- uvc_pm_put(stream->dev);
+ return 0;
+err_pm:
+ uvc_pm_put(stream->dev);
+err_buffers:
uvc_queue_return_buffers(queue, UVC_BUF_STATE_QUEUED);
-
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 588/752] iommu/vt-d: Flush dev-IOTLB only when PCIe device is accessible in scalable mode
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (130 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 587/752] media: uvcvideo: Return queued buffers on start_streaming() failure Sasha Levin
@ 2026-02-28 17:44 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 589/752] iommu/vt-d: Flush piotlb for SVM and Nested domain Sasha Levin
` (152 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:44 UTC (permalink / raw)
To: patches; +Cc: Jinhui Guo, stable, Lu Baolu, Joerg Roedel, Sasha Levin
From: Jinhui Guo <guojinhui.liam@bytedance.com>
[ Upstream commit 10e60d87813989e20eac1f3eda30b3bae461e7f9 ]
Commit 4fc82cd907ac ("iommu/vt-d: Don't issue ATS Invalidation
request when device is disconnected") relies on
pci_dev_is_disconnected() to skip ATS invalidation for
safely-removed devices, but it does not cover link-down caused
by faults, which can still hard-lock the system.
For example, if a VM fails to connect to the PCIe device,
"virsh destroy" is executed to release resources and isolate
the fault, but a hard-lockup occurs while releasing the group fd.
Call Trace:
qi_submit_sync
qi_flush_dev_iotlb
intel_pasid_tear_down_entry
device_block_translation
blocking_domain_attach_dev
__iommu_attach_device
__iommu_device_set_domain
__iommu_group_set_domain_internal
iommu_detach_group
vfio_iommu_type1_detach_group
vfio_group_detach_container
vfio_group_fops_release
__fput
Although pci_device_is_present() is slower than
pci_dev_is_disconnected(), it still takes only ~70 µs on a
ConnectX-5 (8 GT/s, x2) and becomes even faster as PCIe speed
and width increase.
Besides, devtlb_invalidation_with_pasid() is called only in the
paths below, which are far less frequent than memory map/unmap.
1. mm-struct release
2. {attach,release}_dev
3. set/remove PASID
4. dirty-tracking setup
The gain in system stability far outweighs the negligible cost
of using pci_device_is_present() instead of pci_dev_is_disconnected()
to decide when to skip ATS invalidation, especially under GDR
high-load conditions.
Fixes: 4fc82cd907ac ("iommu/vt-d: Don't issue ATS Invalidation request when device is disconnected")
Cc: stable@vger.kernel.org
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
Link: https://lore.kernel.org/r/20251211035946.2071-3-guojinhui.liam@bytedance.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/intel/pasid.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/pasid.c b/drivers/iommu/intel/pasid.c
index d13099a6cb9c3..6782ba5f5e57f 100644
--- a/drivers/iommu/intel/pasid.c
+++ b/drivers/iommu/intel/pasid.c
@@ -219,7 +219,7 @@ devtlb_invalidation_with_pasid(struct intel_iommu *iommu,
if (!info || !info->ats_enabled)
return;
- if (pci_dev_is_disconnected(to_pci_dev(dev)))
+ if (!pci_device_is_present(to_pci_dev(dev)))
return;
sid = PCI_DEVID(info->bus, info->devfn);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 589/752] iommu/vt-d: Flush piotlb for SVM and Nested domain
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (131 preceding siblings ...)
2026-02-28 17:44 ` [PATCH 6.18 588/752] iommu/vt-d: Flush dev-IOTLB only when PCIe device is accessible in scalable mode Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 590/752] KVM: arm64: nv: Return correct RES0 bits for FGT registers Sasha Levin
` (151 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Yi Liu, stable, Kevin Tian, Lu Baolu, Joerg Roedel, Sasha Levin
From: Yi Liu <yi.l.liu@intel.com>
[ Upstream commit 04b1b069f151e793767755f58b51670bff00cbc1 ]
Besides the paging domains that use FS, SVM and Nested domains need to
use piotlb invalidation descriptor as well.
Fixes: b33125296b50 ("iommu/vt-d: Create unique domain ops for each stage")
Cc: stable@vger.kernel.org
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20251223065824.6164-1-yi.l.liu@intel.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/intel/cache.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/intel/cache.c b/drivers/iommu/intel/cache.c
index 265e7290256b5..385ae5cfb30d4 100644
--- a/drivers/iommu/intel/cache.c
+++ b/drivers/iommu/intel/cache.c
@@ -363,6 +363,13 @@ static void qi_batch_add_pasid_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16
qi_batch_increment_index(iommu, batch);
}
+static bool intel_domain_use_piotlb(struct dmar_domain *domain)
+{
+ return domain->domain.type == IOMMU_DOMAIN_SVA ||
+ domain->domain.type == IOMMU_DOMAIN_NESTED ||
+ intel_domain_is_fs_paging(domain);
+}
+
static void cache_tag_flush_iotlb(struct dmar_domain *domain, struct cache_tag *tag,
unsigned long addr, unsigned long pages,
unsigned long mask, int ih)
@@ -370,7 +377,7 @@ static void cache_tag_flush_iotlb(struct dmar_domain *domain, struct cache_tag *
struct intel_iommu *iommu = tag->iommu;
u64 type = DMA_TLB_PSI_FLUSH;
- if (intel_domain_is_fs_paging(domain)) {
+ if (intel_domain_use_piotlb(domain)) {
qi_batch_add_piotlb(iommu, tag->domain_id, tag->pasid, addr,
pages, ih, domain->qi_batch);
return;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 590/752] KVM: arm64: nv: Return correct RES0 bits for FGT registers
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (132 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 589/752] iommu/vt-d: Flush piotlb for SVM and Nested domain Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 591/752] mfd: core: Add locking around 'mfd_of_node_list' Sasha Levin
` (150 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Zenghui Yu (Huawei), Marc Zyngier, stable, Sasha Levin
From: "Zenghui Yu (Huawei)" <zenghui.yu@linux.dev>
[ Upstream commit 2eb80a2eee18762a33aa770d742d64fe47852c7e ]
We had extended the sysreg masking infrastructure to more general
registers, instead of restricting it to VNCR-backed registers, since
commit a0162020095e ("KVM: arm64: Extend masking facility to arbitrary
registers"). Fix kvm_get_sysreg_res0() to reflect this fact.
Note that we're sure that we only deal with FGT registers in
kvm_get_sysreg_res0(), the
if (sr < __VNCR_START__)
is actually a never false, which should probably be removed later.
Fixes: 69c19e047dfe ("KVM: arm64: Add TCR2_EL2 to the sysreg arrays")
Signed-off-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>
Link: https://patch.msgid.link/20260121101631.41037-1-zenghui.yu@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kvm/emulate-nested.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/kvm/emulate-nested.c b/arch/arm64/kvm/emulate-nested.c
index 834f13fb1fb7d..2d04fb56746ea 100644
--- a/arch/arm64/kvm/emulate-nested.c
+++ b/arch/arm64/kvm/emulate-nested.c
@@ -2428,7 +2428,7 @@ static u64 kvm_get_sysreg_res0(struct kvm *kvm, enum vcpu_sysreg sr)
masks = kvm->arch.sysreg_masks;
- return masks->mask[sr - __VNCR_START__].res0;
+ return masks->mask[sr - __SANITISED_REG_START__].res0;
}
static bool check_fgt_bit(struct kvm_vcpu *vcpu, enum vcpu_sysreg sr,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 591/752] mfd: core: Add locking around 'mfd_of_node_list'
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (133 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 590/752] KVM: arm64: nv: Return correct RES0 bits for FGT registers Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 592/752] mfd: tps65219: Implement LOCK register handling for TPS65214 Sasha Levin
` (149 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Douglas Anderson, stable, Lee Jones, Sasha Levin
From: Douglas Anderson <dianders@chromium.org>
[ Upstream commit 20117c92bcf9c11afd64d7481d8f94fdf410726e ]
Manipulating a list in the kernel isn't safe without some sort of
mutual exclusion. Add a mutex any time we access / modify
'mfd_of_node_list' to prevent possible crashes.
Cc: stable@vger.kernel.org
Fixes: 466a62d7642f ("mfd: core: Make a best effort attempt to match devices with the correct of_nodes")
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patch.msgid.link/20251210113002.1.I6ceaca2cfb7eb25737012b166671f516696be4fd@changeid
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/mfd-core.c | 36 ++++++++++++++++++++++--------------
1 file changed, 22 insertions(+), 14 deletions(-)
diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 7d14a1e7631ee..c55223ce4327a 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -22,6 +22,7 @@
#include <linux/regulator/consumer.h>
static LIST_HEAD(mfd_of_node_list);
+static DEFINE_MUTEX(mfd_of_node_mutex);
struct mfd_of_node_entry {
struct list_head list;
@@ -105,9 +106,11 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
u64 of_node_addr;
/* Skip if OF node has previously been allocated to a device */
- list_for_each_entry(of_entry, &mfd_of_node_list, list)
- if (of_entry->np == np)
- return -EAGAIN;
+ scoped_guard(mutex, &mfd_of_node_mutex) {
+ list_for_each_entry(of_entry, &mfd_of_node_list, list)
+ if (of_entry->np == np)
+ return -EAGAIN;
+ }
if (!cell->use_of_reg)
/* No of_reg defined - allocate first free compatible match */
@@ -129,7 +132,8 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
of_entry->dev = &pdev->dev;
of_entry->np = np;
- list_add_tail(&of_entry->list, &mfd_of_node_list);
+ scoped_guard(mutex, &mfd_of_node_mutex)
+ list_add_tail(&of_entry->list, &mfd_of_node_list);
of_node_get(np);
device_set_node(&pdev->dev, of_fwnode_handle(np));
@@ -286,11 +290,13 @@ static int mfd_add_device(struct device *parent, int id,
if (cell->swnode)
device_remove_software_node(&pdev->dev);
fail_of_entry:
- list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list)
- if (of_entry->dev == &pdev->dev) {
- list_del(&of_entry->list);
- kfree(of_entry);
- }
+ scoped_guard(mutex, &mfd_of_node_mutex) {
+ list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list)
+ if (of_entry->dev == &pdev->dev) {
+ list_del(&of_entry->list);
+ kfree(of_entry);
+ }
+ }
fail_alias:
regulator_bulk_unregister_supply_alias(&pdev->dev,
cell->parent_supplies,
@@ -360,11 +366,13 @@ static int mfd_remove_devices_fn(struct device *dev, void *data)
if (cell->swnode)
device_remove_software_node(&pdev->dev);
- list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list)
- if (of_entry->dev == &pdev->dev) {
- list_del(&of_entry->list);
- kfree(of_entry);
- }
+ scoped_guard(mutex, &mfd_of_node_mutex) {
+ list_for_each_entry_safe(of_entry, tmp, &mfd_of_node_list, list)
+ if (of_entry->dev == &pdev->dev) {
+ list_del(&of_entry->list);
+ kfree(of_entry);
+ }
+ }
regulator_bulk_unregister_supply_alias(dev, cell->parent_supplies,
cell->num_parent_supplies);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 592/752] mfd: tps65219: Implement LOCK register handling for TPS65214
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (134 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 591/752] mfd: core: Add locking around 'mfd_of_node_list' Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 593/752] mfd: macsmc: Initialize mutex Sasha Levin
` (148 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Kory Maincent (TI.com), stable, Andrew Davis, Lee Jones,
Sasha Levin
From: "Kory Maincent (TI.com)" <kory.maincent@bootlin.com>
[ Upstream commit d3fcf276b501a82d4504fd5b1ed40249546530d1 ]
The TPS65214 PMIC variant has a LOCK_REG register that prevents writes to
nearly all registers when locked. Unlock the registers at probe time and
leave them unlocked permanently.
This approach is justified because:
- Register locking is very uncommon in typical system operation
- No code path is expected to lock the registers during runtime
- Adding a custom regmap write function would add overhead to every
register write, including voltage changes triggered by CPU OPP
transitions from the cpufreq governor which could happen quite
frequently
Cc: stable@vger.kernel.org
Fixes: 7947219ab1a2d ("mfd: tps65219: Add support for TI TPS65214 PMIC")
Reviewed-by: Andrew Davis <afd@ti.com>
Signed-off-by: Kory Maincent (TI.com) <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20251218-fix_tps65219-v5-1-8bb511417f3a@bootlin.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/tps65219.c | 9 +++++++++
include/linux/mfd/tps65219.h | 2 ++
2 files changed, 11 insertions(+)
diff --git a/drivers/mfd/tps65219.c b/drivers/mfd/tps65219.c
index 65a952555218d..7275dcdb7c44f 100644
--- a/drivers/mfd/tps65219.c
+++ b/drivers/mfd/tps65219.c
@@ -498,6 +498,15 @@ static int tps65219_probe(struct i2c_client *client)
return ret;
}
+ if (chip_id == TPS65214) {
+ ret = i2c_smbus_write_byte_data(client, TPS65214_REG_LOCK,
+ TPS65214_LOCK_ACCESS_CMD);
+ if (ret) {
+ dev_err(tps->dev, "Failed to unlock registers %d\n", ret);
+ return ret;
+ }
+ }
+
ret = devm_regmap_add_irq_chip(tps->dev, tps->regmap, client->irq,
IRQF_ONESHOT, 0, pmic->irq_chip,
&tps->irq_data);
diff --git a/include/linux/mfd/tps65219.h b/include/linux/mfd/tps65219.h
index 55234e771ba73..3abf937191d0c 100644
--- a/include/linux/mfd/tps65219.h
+++ b/include/linux/mfd/tps65219.h
@@ -149,6 +149,8 @@ enum pmic_id {
#define TPS65215_ENABLE_LDO2_EN_MASK BIT(5)
#define TPS65214_ENABLE_LDO1_EN_MASK BIT(5)
#define TPS65219_ENABLE_LDO4_EN_MASK BIT(6)
+/* Register Unlock */
+#define TPS65214_LOCK_ACCESS_CMD 0x5a
/* power ON-OFF sequence slot */
#define TPS65219_BUCKS_LDOS_SEQUENCE_OFF_SLOT_MASK GENMASK(3, 0)
#define TPS65219_BUCKS_LDOS_SEQUENCE_ON_SLOT_MASK GENMASK(7, 4)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 593/752] mfd: macsmc: Initialize mutex
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (135 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 592/752] mfd: tps65219: Implement LOCK register handling for TPS65214 Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 594/752] mfd: qcom-pm8xxx: Fix OF populate on driver rebind Sasha Levin
` (147 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Janne Grunau, stable, Sven Peter, Neal Gompa, Lee Jones,
Sasha Levin
From: Janne Grunau <j@jannau.net>
[ Upstream commit 414f65d6736342c77d4ec5e7373039f4a09250dd ]
Initialize struct apple_smc's mutex in apple_smc_probe(). Using the
mutex uninitialized surprisingly resulted only in occasional NULL
pointer dereferences in apple_smc_read() calls from the probe()
functions of sub devices.
Cc: stable@vger.kernel.org
Fixes: e038d985c9823 ("mfd: Add Apple Silicon System Management Controller")
Signed-off-by: Janne Grunau <j@jannau.net>
Reviewed-by: Sven Peter <sven@kernel.org>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Link: https://patch.msgid.link/20251231-macsmc-mutex_init-v2-1-5818c9dc9b29@jannau.net
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/macsmc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/mfd/macsmc.c b/drivers/mfd/macsmc.c
index e6cdae221f1d4..3228e79c86eb5 100644
--- a/drivers/mfd/macsmc.c
+++ b/drivers/mfd/macsmc.c
@@ -413,6 +413,7 @@ static int apple_smc_probe(struct platform_device *pdev)
if (!smc)
return -ENOMEM;
+ mutex_init(&smc->mutex);
smc->dev = &pdev->dev;
smc->sram_base = devm_platform_get_and_ioremap_resource(pdev, 1, &smc->sram);
if (IS_ERR(smc->sram_base))
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 594/752] mfd: qcom-pm8xxx: Fix OF populate on driver rebind
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (136 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 593/752] mfd: macsmc: Initialize mutex Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 595/752] mfd: omap-usb-host: " Sasha Levin
` (146 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Johan Hovold, stable, Dmitry Baryshkov, Konrad Dybcio, Lee Jones,
Sasha Levin
From: Johan Hovold <johan@kernel.org>
[ Upstream commit 27a8acea47a93fea6ad0e2df4c20a9b51490e4d9 ]
Since commit c6e126de43e7 ("of: Keep track of populated platform
devices") child devices will not be created by of_platform_populate()
if the devices had previously been deregistered individually so that the
OF_POPULATED flag is still set in the corresponding OF nodes.
Switch to using of_platform_depopulate() instead of open coding so that
the child devices are created if the driver is rebound.
Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://patch.msgid.link/20251219110947.24101-1-johan@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/qcom-pm8xxx.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/mfd/qcom-pm8xxx.c b/drivers/mfd/qcom-pm8xxx.c
index 1149f7102a365..0cf374c015ce7 100644
--- a/drivers/mfd/qcom-pm8xxx.c
+++ b/drivers/mfd/qcom-pm8xxx.c
@@ -577,17 +577,11 @@ static int pm8xxx_probe(struct platform_device *pdev)
return rc;
}
-static int pm8xxx_remove_child(struct device *dev, void *unused)
-{
- platform_device_unregister(to_platform_device(dev));
- return 0;
-}
-
static void pm8xxx_remove(struct platform_device *pdev)
{
struct pm_irq_chip *chip = platform_get_drvdata(pdev);
- device_for_each_child(&pdev->dev, NULL, pm8xxx_remove_child);
+ of_platform_depopulate(&pdev->dev);
irq_domain_remove(chip->irqdomain);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 595/752] mfd: omap-usb-host: Fix OF populate on driver rebind
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (137 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 594/752] mfd: qcom-pm8xxx: Fix OF populate on driver rebind Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 598/752] arm64: dts: rockchip: Explicitly request UFS reset pin on RK3576 Sasha Levin
` (145 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Johan Hovold, stable, Andreas Kemnade, Lee Jones, Sasha Levin
From: Johan Hovold <johan@kernel.org>
[ Upstream commit 24804ba508a3e240501c521685a1c4eb9f574f8e ]
Since commit c6e126de43e7 ("of: Keep track of populated platform
devices") child devices will not be created by of_platform_populate()
if the devices had previously been deregistered individually so that the
OF_POPULATED flag is still set in the corresponding OF nodes.
Switch to using of_platform_depopulate() instead of open coding so that
the child devices are created if the driver is rebound.
Fixes: c6e126de43e7 ("of: Keep track of populated platform devices")
Cc: stable@vger.kernel.org # 3.16
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://patch.msgid.link/20251219110714.23919-1-johan@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mfd/omap-usb-host.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index a77b6fc790f2e..4d29a6e2ed87a 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -819,8 +819,10 @@ static void usbhs_omap_remove(struct platform_device *pdev)
{
pm_runtime_disable(&pdev->dev);
- /* remove children */
- device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
+ if (pdev->dev.of_node)
+ of_platform_depopulate(&pdev->dev);
+ else
+ device_for_each_child(&pdev->dev, NULL, usbhs_omap_remove_child);
}
static const struct dev_pm_ops usbhsomap_dev_pm_ops = {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 598/752] arm64: dts: rockchip: Explicitly request UFS reset pin on RK3576
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (138 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 595/752] mfd: omap-usb-host: " Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 599/752] PCI/PM: Prevent runtime suspend until devices are fully initialized Sasha Levin
` (144 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Alexey Charkov, stable, Quentin Schulz, Heiko Stuebner,
Sasha Levin
From: Alexey Charkov <alchark@gmail.com>
[ Upstream commit 79a3286e61829fc43abdd6e3beb31b24930c7af6 ]
Rockchip RK3576 UFS controller uses a dedicated pin to reset the connected
UFS device, which can operate either in a hardware controlled mode or as a
GPIO pin.
Power-on default is GPIO mode, but the boot ROM reconfigures it to a
hardware controlled mode if it uses UFS to load the next boot stage.
Given that existing bindings (and rk3576.dtsi) expect a GPIO-controlled
device reset, request the required pin config explicitly.
The pin is requested with pull-down enabled, which is in line with the
SoC power-on default and helps ensure that the attached UFS chip stays
in reset until the driver takes over the control of the respective
GPIO line.
This doesn't appear to affect Linux, but it does affect U-boot:
Before:
=> md.l 0x2604b398
2604b398: 00000011 00000000 00000000 00000000 ................
< ... snip ... >
=> ufs init
ufshcd-rockchip ufshc@2a2d0000: [RX, TX]: gear=[3, 3], lane[2, 2], pwr[FASTAUTO_MODE, FASTAUTO_MODE], rate = 2
=> md.l 0x2604b398
2604b398: 00000011 00000000 00000000 00000000 ................
After:
=> md.l 0x2604b398
2604b398: 00000011 00000000 00000000 00000000 ................
< ... snip ...>
=> ufs init
ufshcd-rockchip ufshc@2a2d0000: [RX, TX]: gear=[3, 3], lane[2, 2], pwr[FASTAUTO_MODE, FASTAUTO_MODE], rate = 2
=> md.l 0x2604b398
2604b398: 00000010 00000000 00000000 00000000 ................
(0x2604b398 is the respective pin mux register, with its BIT0 driving the
mode of UFS_RST: unset = GPIO, set = hardware controlled UFS_RST)
This helps ensure that GPIO-driven device reset actually fires when the
system requests it, not when whatever black box magic inside the UFSHC
decides to reset the flash chip.
Cc: stable@vger.kernel.org
Fixes: c75e5e010fef ("scsi: arm64: dts: rockchip: Add UFS support for RK3576 SoC")
Reported-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Signed-off-by: Alexey Charkov <alchark@gmail.com>
Link: https://patch.msgid.link/20260121-ufs-rst-v3-1-35839bcb4ca7@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/boot/dts/rockchip/rk3576-pinctrl.dtsi | 7 +++++++
arch/arm64/boot/dts/rockchip/rk3576.dtsi | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-pinctrl.dtsi b/arch/arm64/boot/dts/rockchip/rk3576-pinctrl.dtsi
index 0b0851a7e4ea9..98c9f8013158c 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576-pinctrl.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3576-pinctrl.dtsi
@@ -5228,6 +5228,13 @@ ufs_rst: ufs-rst {
/* ufs_rstn */
<4 RK_PD0 1 &pcfg_pull_none>;
};
+
+ /omit-if-no-ref/
+ ufs_rstgpio: ufs-rstgpio {
+ rockchip,pins =
+ /* ufs_rstn */
+ <4 RK_PD0 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
};
ufs_testdata0 {
diff --git a/arch/arm64/boot/dts/rockchip/rk3576.dtsi b/arch/arm64/boot/dts/rockchip/rk3576.dtsi
index c72343e7a0456..70e67d4dccb8a 100644
--- a/arch/arm64/boot/dts/rockchip/rk3576.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3576.dtsi
@@ -1826,7 +1826,7 @@ ufshc: ufshc@2a2d0000 {
assigned-clock-parents = <&cru CLK_REF_MPHY_26M>;
interrupts = <GIC_SPI 361 IRQ_TYPE_LEVEL_HIGH>;
power-domains = <&power RK3576_PD_USB>;
- pinctrl-0 = <&ufs_refclk>;
+ pinctrl-0 = <&ufs_refclk &ufs_rstgpio>;
pinctrl-names = "default";
resets = <&cru SRST_A_UFS_BIU>, <&cru SRST_A_UFS_SYS>,
<&cru SRST_A_UFS>, <&cru SRST_P_UFS_GRF>;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 599/752] PCI/PM: Prevent runtime suspend until devices are fully initialized
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (139 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 598/752] arm64: dts: rockchip: Explicitly request UFS reset pin on RK3576 Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 600/752] iio: accel: adxl380: Avoid reading more entries than present in FIFO Sasha Levin
` (143 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Brian Norris, Bjorn Helgaas, Marek Szyprowski, stable,
Sasha Levin
From: Brian Norris <briannorris@chromium.org>
[ Upstream commit 51c0996dadaea20d73eb0495aeda9cb0422243e8 ]
Previously, it was possible for a PCI device to be runtime-suspended before
it was fully initialized. When that happened, the suspend process could
save invalid device state, for example, before BAR assignment. Restoring
the invalid state during resume may leave the device non-functional.
Prevent runtime suspend for PCI devices until they are fully initialized by
deferring pm_runtime_enable().
More details on how exactly this may occur:
1. PCI device is created by pci_scan_slot() or similar
2. As part of pci_scan_slot(), pci_pm_init() puts the device in D0 and
prevents runtime suspend prevented via pm_runtime_forbid()
3. pci_device_add() adds the underlying 'struct device' via device_add(),
which means user space can allow runtime suspend, e.g.,
echo auto > /sys/bus/pci/devices/.../power/control
4. PCI device receives BAR configuration
(pci_assign_unassigned_bus_resources(), etc.)
5. pci_bus_add_device() applies final fixups, saves device state, and
tries to attach a driver
The device may potentially be suspended between #3 and #5, so this is racy
with user space (udev or similar).
Many PCI devices are enumerated at subsys_initcall time and so will not
race with user space, but devices created later by hotplug or modular
pwrctrl or host controller drivers are susceptible to this race.
More runtime PM details at the first Link: below.
Link: https://lore.kernel.org/all/0e35a4e1-894a-47c1-9528-fc5ffbafd9e2@samsung.com/
Signed-off-by: Brian Norris <briannorris@chromium.org>
[bhelgaas: update comments per https://lore.kernel.org/r/CAJZ5v0iBNOmMtqfqEbrYyuK2u+2J2+zZ-iQd1FvyCPjdvU2TJg@mail.gmail.com]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260122094815.v5.1.I60a53c170a8596661883bd2b4ef475155c7aa72b@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/bus.c | 8 ++++++++
drivers/pci/pci.c | 8 +++++++-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c
index 9daf13ed3714e..81a6d356729ef 100644
--- a/drivers/pci/bus.c
+++ b/drivers/pci/bus.c
@@ -14,6 +14,7 @@
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include <linux/proc_fs.h>
#include <linux/slab.h>
@@ -378,6 +379,13 @@ void pci_bus_add_device(struct pci_dev *dev)
put_device(&pdev->dev);
}
+ /*
+ * Enable runtime PM, which potentially allows the device to
+ * suspend immediately, only after the PCI state has been
+ * configured completely.
+ */
+ pm_runtime_enable(&dev->dev);
+
if (!dn || of_device_is_available(dn))
pci_dev_allow_binding(dev);
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index d147e412668bf..7858121344655 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3225,8 +3225,14 @@ void pci_pm_init(struct pci_dev *dev)
poweron:
pci_pm_power_up_and_verify_state(dev);
pm_runtime_forbid(&dev->dev);
+
+ /*
+ * Runtime PM will be enabled for the device when it has been fully
+ * configured, but since its parent and suppliers may suspend in
+ * the meantime, prevent them from doing so by changing the
+ * device's runtime PM status to "active".
+ */
pm_runtime_set_active(&dev->dev);
- pm_runtime_enable(&dev->dev);
}
static unsigned long pci_ea_flags(struct pci_dev *dev, u8 prop)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 600/752] iio: accel: adxl380: Avoid reading more entries than present in FIFO
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (140 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 599/752] PCI/PM: Prevent runtime suspend until devices are fully initialized Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 601/752] iommu/arm-smmu-v3: Add update_safe bits to fix STE update sequence Sasha Levin
` (142 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Francesco Lavra, Stable, Jonathan Cameron, Sasha Levin
From: Francesco Lavra <flavra@baylibre.com>
[ Upstream commit c1b14015224cfcccd5356333763f2f4f401bd810 ]
The interrupt handler reads FIFO entries in batches of N samples, where N
is the number of scan elements that have been enabled. However, the sensor
fills the FIFO one sample at a time, even when more than one channel is
enabled. Therefore,the number of entries reported by the FIFO status
registers may not be a multiple of N; if this number is not a multiple, the
number of entries read from the FIFO may exceed the number of entries
actually present.
To fix the above issue, round down the number of FIFO entries read from the
status registers so that it is always a multiple of N.
Fixes: df36de13677a ("iio: accel: add ADXL380 driver")
Signed-off-by: Francesco Lavra <flavra@baylibre.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/accel/adxl380.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/accel/adxl380.c b/drivers/iio/accel/adxl380.c
index 6d82873357cb8..217c5ae56d23a 100644
--- a/drivers/iio/accel/adxl380.c
+++ b/drivers/iio/accel/adxl380.c
@@ -977,6 +977,7 @@ static irqreturn_t adxl380_irq_handler(int irq, void *p)
if (ret)
return IRQ_HANDLED;
+ fifo_entries = rounddown(fifo_entries, st->fifo_set_size);
for (i = 0; i < fifo_entries; i += st->fifo_set_size) {
ret = regmap_noinc_read(st->regmap, ADXL380_FIFO_DATA,
&st->fifo_buf[i],
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 601/752] iommu/arm-smmu-v3: Add update_safe bits to fix STE update sequence
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (141 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 600/752] iio: accel: adxl380: Avoid reading more entries than present in FIFO Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 602/752] iommu/arm-smmu-v3: Mark STE MEV safe when computing the " Sasha Levin
` (141 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Jason Gunthorpe, stable, Shuai Xue, Mostafa Saleh,
Pranjal Shrivastava, Nicolin Chen, Will Deacon, Sasha Levin
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit 2781f2a930abb5d27f80b8afbabfa19684833b65 ]
C_BAD_STE was observed when updating nested STE from an S1-bypass mode to
an S1DSS-bypass mode. As both modes enabled S2, the used bit is slightly
different than the normal S1-bypass and S1DSS-bypass modes. As a result,
fields like MEV and EATS in S2's used list marked the word1 as a critical
word that requested a STE.V=0. This breaks a hitless update.
However, both MEV and EATS aren't critical in terms of STE update. One
controls the merge of the events and the other controls the ATS that is
managed by the driver at the same time via pci_enable_ats().
Add an arm_smmu_get_ste_update_safe() to allow STE update algorithm to
relax those fields, avoiding the STE update breakages.
After this change, entry_set has no caller checking its return value, so
change it to void.
Note that this change is required by both MEV and EATS fields, which were
introduced in different kernel versions. So add get_update_safe() first.
MEV and EATS will be added to arm_smmu_get_ste_update_safe() separately.
Fixes: 1e8be08d1c91 ("iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c | 31 +++++++++++++++++--
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 28 ++++++++++++-----
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 4 +++
3 files changed, 53 insertions(+), 10 deletions(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c
index d2671bfd37981..b254a94b2003d 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-test.c
@@ -38,13 +38,16 @@ enum arm_smmu_test_master_feat {
static bool arm_smmu_entry_differs_in_used_bits(const __le64 *entry,
const __le64 *used_bits,
const __le64 *target,
+ const __le64 *safe,
unsigned int length)
{
bool differs = false;
unsigned int i;
for (i = 0; i < length; i++) {
- if ((entry[i] & used_bits[i]) != target[i])
+ __le64 used = used_bits[i] & ~safe[i];
+
+ if ((entry[i] & used) != (target[i] & used))
differs = true;
}
return differs;
@@ -56,12 +59,24 @@ arm_smmu_test_writer_record_syncs(struct arm_smmu_entry_writer *writer)
struct arm_smmu_test_writer *test_writer =
container_of(writer, struct arm_smmu_test_writer, writer);
__le64 *entry_used_bits;
+ __le64 *safe_target;
+ __le64 *safe_init;
entry_used_bits = kunit_kzalloc(
test_writer->test, sizeof(*entry_used_bits) * NUM_ENTRY_QWORDS,
GFP_KERNEL);
KUNIT_ASSERT_NOT_NULL(test_writer->test, entry_used_bits);
+ safe_target = kunit_kzalloc(test_writer->test,
+ sizeof(*safe_target) * NUM_ENTRY_QWORDS,
+ GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test_writer->test, safe_target);
+
+ safe_init = kunit_kzalloc(test_writer->test,
+ sizeof(*safe_init) * NUM_ENTRY_QWORDS,
+ GFP_KERNEL);
+ KUNIT_ASSERT_NOT_NULL(test_writer->test, safe_init);
+
pr_debug("STE value is now set to: ");
print_hex_dump_debug(" ", DUMP_PREFIX_NONE, 16, 8,
test_writer->entry,
@@ -79,14 +94,23 @@ arm_smmu_test_writer_record_syncs(struct arm_smmu_entry_writer *writer)
* configuration.
*/
writer->ops->get_used(test_writer->entry, entry_used_bits);
+ if (writer->ops->get_update_safe)
+ writer->ops->get_update_safe(test_writer->entry,
+ test_writer->init_entry,
+ safe_init);
+ if (writer->ops->get_update_safe)
+ writer->ops->get_update_safe(test_writer->entry,
+ test_writer->target_entry,
+ safe_target);
KUNIT_EXPECT_FALSE(
test_writer->test,
arm_smmu_entry_differs_in_used_bits(
test_writer->entry, entry_used_bits,
- test_writer->init_entry, NUM_ENTRY_QWORDS) &&
+ test_writer->init_entry, safe_init,
+ NUM_ENTRY_QWORDS) &&
arm_smmu_entry_differs_in_used_bits(
test_writer->entry, entry_used_bits,
- test_writer->target_entry,
+ test_writer->target_entry, safe_target,
NUM_ENTRY_QWORDS));
}
}
@@ -106,6 +130,7 @@ arm_smmu_v3_test_debug_print_used_bits(struct arm_smmu_entry_writer *writer,
static const struct arm_smmu_entry_writer_ops test_ste_ops = {
.sync = arm_smmu_test_writer_record_syncs,
.get_used = arm_smmu_get_ste_used,
+ .get_update_safe = arm_smmu_get_ste_update_safe,
};
static const struct arm_smmu_entry_writer_ops test_cd_ops = {
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index b4f757e1f105f..e7d62acb4b779 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -1093,6 +1093,13 @@ void arm_smmu_get_ste_used(const __le64 *ent, __le64 *used_bits)
}
EXPORT_SYMBOL_IF_KUNIT(arm_smmu_get_ste_used);
+VISIBLE_IF_KUNIT
+void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target,
+ __le64 *safe_bits)
+{
+}
+EXPORT_SYMBOL_IF_KUNIT(arm_smmu_get_ste_update_safe);
+
/*
* Figure out if we can do a hitless update of entry to become target. Returns a
* bit mask where 1 indicates that qword needs to be set disruptively.
@@ -1105,13 +1112,22 @@ static u8 arm_smmu_entry_qword_diff(struct arm_smmu_entry_writer *writer,
{
__le64 target_used[NUM_ENTRY_QWORDS] = {};
__le64 cur_used[NUM_ENTRY_QWORDS] = {};
+ __le64 safe[NUM_ENTRY_QWORDS] = {};
u8 used_qword_diff = 0;
unsigned int i;
writer->ops->get_used(entry, cur_used);
writer->ops->get_used(target, target_used);
+ if (writer->ops->get_update_safe)
+ writer->ops->get_update_safe(entry, target, safe);
for (i = 0; i != NUM_ENTRY_QWORDS; i++) {
+ /*
+ * Safe is only used for bits that are used by both entries,
+ * otherwise it is sequenced according to the unused entry.
+ */
+ safe[i] &= target_used[i] & cur_used[i];
+
/*
* Check that masks are up to date, the make functions are not
* allowed to set a bit to 1 if the used function doesn't say it
@@ -1120,6 +1136,7 @@ static u8 arm_smmu_entry_qword_diff(struct arm_smmu_entry_writer *writer,
WARN_ON_ONCE(target[i] & ~target_used[i]);
/* Bits can change because they are not currently being used */
+ cur_used[i] &= ~safe[i];
unused_update[i] = (entry[i] & cur_used[i]) |
(target[i] & ~cur_used[i]);
/*
@@ -1132,7 +1149,7 @@ static u8 arm_smmu_entry_qword_diff(struct arm_smmu_entry_writer *writer,
return used_qword_diff;
}
-static bool entry_set(struct arm_smmu_entry_writer *writer, __le64 *entry,
+static void entry_set(struct arm_smmu_entry_writer *writer, __le64 *entry,
const __le64 *target, unsigned int start,
unsigned int len)
{
@@ -1148,7 +1165,6 @@ static bool entry_set(struct arm_smmu_entry_writer *writer, __le64 *entry,
if (changed)
writer->ops->sync(writer);
- return changed;
}
/*
@@ -1218,12 +1234,9 @@ void arm_smmu_write_entry(struct arm_smmu_entry_writer *writer, __le64 *entry,
entry_set(writer, entry, target, 0, 1);
} else {
/*
- * No inuse bit changed. Sanity check that all unused bits are 0
- * in the entry. The target was already sanity checked by
- * compute_qword_diff().
+ * No inuse bit changed, though safe bits may have changed.
*/
- WARN_ON_ONCE(
- entry_set(writer, entry, target, 0, NUM_ENTRY_QWORDS));
+ entry_set(writer, entry, target, 0, NUM_ENTRY_QWORDS);
}
}
EXPORT_SYMBOL_IF_KUNIT(arm_smmu_write_entry);
@@ -1554,6 +1567,7 @@ static void arm_smmu_ste_writer_sync_entry(struct arm_smmu_entry_writer *writer)
static const struct arm_smmu_entry_writer_ops arm_smmu_ste_writer_ops = {
.sync = arm_smmu_ste_writer_sync_entry,
.get_used = arm_smmu_get_ste_used,
+ .get_update_safe = arm_smmu_get_ste_update_safe,
};
static void arm_smmu_write_ste(struct arm_smmu_master *master, u32 sid,
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
index ae23aacc38402..287e223c054d1 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
@@ -900,6 +900,8 @@ struct arm_smmu_entry_writer {
struct arm_smmu_entry_writer_ops {
void (*get_used)(const __le64 *entry, __le64 *used);
+ void (*get_update_safe)(const __le64 *cur, const __le64 *target,
+ __le64 *safe_bits);
void (*sync)(struct arm_smmu_entry_writer *writer);
};
@@ -911,6 +913,8 @@ void arm_smmu_make_s2_domain_ste(struct arm_smmu_ste *target,
#if IS_ENABLED(CONFIG_KUNIT)
void arm_smmu_get_ste_used(const __le64 *ent, __le64 *used_bits);
+void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target,
+ __le64 *safe_bits);
void arm_smmu_write_entry(struct arm_smmu_entry_writer *writer, __le64 *cur,
const __le64 *target);
void arm_smmu_get_cd_used(const __le64 *ent, __le64 *used_bits);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 602/752] iommu/arm-smmu-v3: Mark STE MEV safe when computing the update sequence
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (142 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 601/752] iommu/arm-smmu-v3: Add update_safe bits to fix STE update sequence Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 603/752] iommu/arm-smmu-v3: Mark EATS_TRANS " Sasha Levin
` (140 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Jason Gunthorpe, stable, Shuai Xue, Mostafa Saleh,
Pranjal Shrivastava, Nicolin Chen, Will Deacon, Sasha Levin
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit f3c1d372dbb8e5a86923f20db66deabef42bfc9d ]
Nested CD tables set the MEV bit to try to reduce multi-fault spamming on
the hypervisor. Since MEV is in STE word 1 this causes a breaking update
sequence that is not required and impacts real workloads.
For the purposes of STE updates the value of MEV doesn't matter, if it is
set/cleared early or late it just results in a change to the fault reports
that must be supported by the kernel anyhow. The spec says:
Note: Software must expect, and be able to deal with, coalesced fault
records even when MEV == 0.
So mark STE MEV safe when computing the update sequence, to avoid creating
a breaking update.
Fixes: da0c56520e88 ("iommu/arm-smmu-v3: Set MEV bit in nested STE for DoS mitigations")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index e7d62acb4b779..bb755c7ef9a79 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -1097,6 +1097,16 @@ VISIBLE_IF_KUNIT
void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target,
__le64 *safe_bits)
{
+ /*
+ * MEV does not meaningfully impact the operation of the HW, it only
+ * changes how many fault events are generated, thus we can relax it
+ * when computing the ordering. The spec notes the device can act like
+ * MEV=1 anyhow:
+ *
+ * Note: Software must expect, and be able to deal with, coalesced
+ * fault records even when MEV == 0.
+ */
+ safe_bits[1] |= cpu_to_le64(STRTAB_STE_1_MEV);
}
EXPORT_SYMBOL_IF_KUNIT(arm_smmu_get_ste_update_safe);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 603/752] iommu/arm-smmu-v3: Mark EATS_TRANS safe when computing the update sequence
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (143 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 602/752] iommu/arm-smmu-v3: Mark STE MEV safe when computing the " Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 604/752] iommu/arm-smmu-v3: Do not set disable_ats unless vSTE is Translate Sasha Levin
` (139 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Jason Gunthorpe, stable, Shuai Xue, Nicolin Chen, Will Deacon,
Sasha Levin
From: Jason Gunthorpe <jgg@nvidia.com>
[ Upstream commit 7cad800485956a263318930613f8f4a084af8c70 ]
If VM wants to toggle EATS_TRANS off at the same time as changing the CFG,
hypervisor will see EATS change to 0 and insert a V=0 breaking update into
the STE even though the VM did not ask for that.
In bare metal, EATS_TRANS is ignored by CFG=ABORT/BYPASS, which is why this
does not cause a problem until we have the nested case where CFG is always
a variation of S2 trans that does use EATS_TRANS.
Relax the rules for EATS_TRANS sequencing, we don't need it to be exact as
the enclosing code will always disable ATS at the PCI device when changing
EATS_TRANS. This ensures there are no ATS transactions that can race with
an EATS_TRANS change so we don't need to carefully sequence these bits.
Fixes: 1e8be08d1c91 ("iommu/arm-smmu-v3: Support IOMMU_DOMAIN_NESTED")
Cc: stable@vger.kernel.org
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Shuai Xue <xueshuai@linux.alibaba.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 26 +++++++++++++++++++++
1 file changed, 26 insertions(+)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index bb755c7ef9a79..1e47da0ce6b9b 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -1097,6 +1097,32 @@ VISIBLE_IF_KUNIT
void arm_smmu_get_ste_update_safe(const __le64 *cur, const __le64 *target,
__le64 *safe_bits)
{
+ const __le64 eats_s1chk =
+ FIELD_PREP(STRTAB_STE_1_EATS, STRTAB_STE_1_EATS_S1CHK);
+ const __le64 eats_trans =
+ FIELD_PREP(STRTAB_STE_1_EATS, STRTAB_STE_1_EATS_TRANS);
+
+ /*
+ * When an STE changes EATS_TRANS, the sequencing code in the attach
+ * logic already will have the PCI cap for ATS disabled. Thus at this
+ * moment we can expect that the device will not generate ATS queries
+ * and so we don't care about the sequencing of EATS. The purpose of
+ * EATS_TRANS is to protect the system from hostile untrusted devices
+ * that issue ATS when the PCI config space is disabled. However, if
+ * EATS_TRANS is being changed, then we must have already trusted the
+ * device as the EATS_TRANS security block is being disabled.
+ *
+ * Note: now the EATS_TRANS update is moved to the first entry_set().
+ * Changing S2S and EATS might transiently result in S2S=1 and EATS=1
+ * which is a bad STE (see "5.2 Stream Table Entry"). In such a case,
+ * we can't do a hitless update. Also, it should not be added to the
+ * safe bits with STRTAB_STE_1_EATS_S1CHK, because EATS=0b11 would be
+ * effectively an errant 0b00 configuration.
+ */
+ if (!((cur[1] | target[1]) & cpu_to_le64(eats_s1chk)) &&
+ !((cur[2] | target[2]) & cpu_to_le64(STRTAB_STE_2_S2S)))
+ safe_bits[1] |= cpu_to_le64(eats_trans);
+
/*
* MEV does not meaningfully impact the operation of the HW, it only
* changes how many fault events are generated, thus we can relax it
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 604/752] iommu/arm-smmu-v3: Do not set disable_ats unless vSTE is Translate
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (144 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 603/752] iommu/arm-smmu-v3: Mark EATS_TRANS " Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 605/752] usb: host: tegra: Remove manual wake IRQ disposal Sasha Levin
` (138 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Nicolin Chen, stable, Jason Gunthorpe, Pranjal Shrivastava,
Will Deacon, Sasha Levin
From: Nicolin Chen <nicolinc@nvidia.com>
[ Upstream commit a45dd34663025c75652b27e384e91c9c05ba1d80 ]
A vSTE may have three configuration types: Abort, Bypass, and Translate.
An Abort vSTE wouldn't enable ATS, but the other two might.
It makes sense for a Transalte vSTE to rely on the guest vSTE.EATS field.
For a Bypass vSTE, it would end up with an S2-only physical STE, similar
to an attachment to a regular S2 domain. However, the nested case always
disables ATS following the Bypass vSTE, while the regular S2 case always
enables ATS so long as arm_smmu_ats_supported(master) == true.
Note that ATS is needed for certain VM centric workloads and historically
non-vSMMU cases have relied on this automatic enablement. So, having the
nested case behave differently causes problems.
To fix that, add a condition to disable_ats, so that it might enable ATS
for a Bypass vSTE, aligning with the regular S2 case.
Fixes: f27298a82ba0 ("iommu/arm-smmu-v3: Allow ATS for IOMMU_DOMAIN_NESTED")
Cc: stable@vger.kernel.org
Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Nicolin Chen <nicolinc@nvidia.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
index 8cd8929bbfdf8..9ec5591565083 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-iommufd.c
@@ -165,7 +165,9 @@ static int arm_smmu_attach_dev_nested(struct iommu_domain *domain,
* config bit here base this off the EATS value in the STE. If the EATS
* is set then the VM must generate ATC flushes.
*/
- state.disable_ats = !nested_domain->enable_ats;
+ if (FIELD_GET(STRTAB_STE_0_CFG, le64_to_cpu(nested_domain->ste[0])) ==
+ STRTAB_STE_0_CFG_S1_TRANS)
+ state.disable_ats = !nested_domain->enable_ats;
ret = arm_smmu_attach_prepare(&state, domain);
if (ret) {
mutex_unlock(&arm_smmu_asid_lock);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 605/752] usb: host: tegra: Remove manual wake IRQ disposal
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (145 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 604/752] iommu/arm-smmu-v3: Do not set disable_ats unless vSTE is Translate Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 606/752] xfs: delete attr leaf freemap entries when empty Sasha Levin
` (137 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Wayne Chang, stable, Wei-Cheng Chen, Greg Kroah-Hartman,
Sasha Levin
From: Wayne Chang <waynec@nvidia.com>
[ Upstream commit ef548189fd3f44786fb813af0018cc8b3bbed2b9 ]
We found that calling irq_dispose_mapping() caused a kernel warning
when removing the driver. The IRQs are obtained using
platform_get_irq(), which returns a Linux virtual IRQ number directly
managed by the device core, not by the OF subsystem. Therefore, the
driver should not call irq_dispose_mapping() for these IRQs.
Fixes: 5df186e2ef11 ("usb: xhci: tegra: Support USB wakeup function for Tegra234")
Cc: stable@vger.kernel.org
Signed-off-by: Wayne Chang <waynec@nvidia.com>
Signed-off-by: Wei-Cheng Chen <weichengc@nvidia.com>
Link: https://patch.msgid.link/20260115103621.587366-1-weichengc@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/usb/host/xhci-tegra.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c
index c78bed0aa844e..83b1766ff1521 100644
--- a/drivers/usb/host/xhci-tegra.c
+++ b/drivers/usb/host/xhci-tegra.c
@@ -1571,7 +1571,6 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu
data = irq_get_irq_data(tegra->wake_irqs[i]);
if (!data) {
dev_warn(tegra->dev, "get wake event %d irq data fail\n", i);
- irq_dispose_mapping(tegra->wake_irqs[i]);
break;
}
@@ -1584,16 +1583,6 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu
return 0;
}
-static void tegra_xusb_dispose_wake(struct tegra_xusb *tegra)
-{
- unsigned int i;
-
- for (i = 0; i < tegra->num_wakes; i++)
- irq_dispose_mapping(tegra->wake_irqs[i]);
-
- tegra->num_wakes = 0;
-}
-
static int tegra_xusb_probe(struct platform_device *pdev)
{
struct tegra_xusb *tegra;
@@ -1649,10 +1638,8 @@ static int tegra_xusb_probe(struct platform_device *pdev)
return err;
tegra->padctl = tegra_xusb_padctl_get(&pdev->dev);
- if (IS_ERR(tegra->padctl)) {
- err = PTR_ERR(tegra->padctl);
- goto dispose_wake;
- }
+ if (IS_ERR(tegra->padctl))
+ return PTR_ERR(tegra->padctl);
np = of_parse_phandle(pdev->dev.of_node, "nvidia,xusb-padctl", 0);
if (!np) {
@@ -1976,8 +1963,6 @@ static int tegra_xusb_probe(struct platform_device *pdev)
put_padctl:
of_node_put(np);
tegra_xusb_padctl_put(tegra->padctl);
-dispose_wake:
- tegra_xusb_dispose_wake(tegra);
return err;
}
@@ -2010,8 +1995,6 @@ static void tegra_xusb_remove(struct platform_device *pdev)
if (tegra->padctl_irq)
pm_runtime_disable(&pdev->dev);
- tegra_xusb_dispose_wake(tegra);
-
pm_runtime_put(&pdev->dev);
tegra_xusb_disable(tegra);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 606/752] xfs: delete attr leaf freemap entries when empty
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (146 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 605/752] usb: host: tegra: Remove manual wake IRQ disposal Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 607/752] xfs: fix freemap adjustments when adding xattrs to leaf blocks Sasha Levin
` (136 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, stable, Christoph Hellwig, Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit 6f13c1d2a6271c2e73226864a0e83de2770b6f34 ]
Back in commit 2a2b5932db6758 ("xfs: fix attr leaf header freemap.size
underflow"), Brian Foster observed that it's possible for a small
freemap at the end of the end of the xattr entries array to experience
a size underflow when subtracting the space consumed by an expansion of
the entries array. There are only three freemap entries, which means
that it is not a complete index of all free space in the leaf block.
This code can leave behind a zero-length freemap entry with a nonzero
base. Subsequent setxattr operations can increase the base up to the
point that it overlaps with another freemap entry. This isn't in and of
itself a problem because the code in _leaf_add that finds free space
ignores any freemap entry with zero size.
However, there's another bug in the freemap update code in _leaf_add,
which is that it fails to update a freemap entry that begins midway
through the xattr entry that was just appended to the array. That can
result in the freemap containing two entries with the same base but
different sizes (0 for the "pushed-up" entry, nonzero for the entry
that's actually tracking free space). A subsequent _leaf_add can then
allocate xattr namevalue entries on top of the entries array, leading to
data loss. But fixing that is for later.
For now, eliminate the possibility of confusion by zeroing out the base
of any freemap entry that has zero size. Because the freemap is not
intended to be a complete index of free space, a subsequent failure to
find any free space for a new xattr will trigger block compaction, which
regenerates the freemap.
It looks like this bug has been in the codebase for quite a long time.
Cc: <stable@vger.kernel.org> # v2.6.12
Fixes: 1da177e4c3f415 ("Linux-2.6.12-rc2")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/libxfs/xfs_attr_leaf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index 91c1b30ebaab3..33c6c468ad8d5 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -1580,6 +1580,19 @@ xfs_attr3_leaf_add_work(
min_t(uint16_t, ichdr->freemap[i].size,
sizeof(xfs_attr_leaf_entry_t));
}
+
+ /*
+ * Don't leave zero-length freemaps with nonzero base lying
+ * around, because we don't want the code in _remove that
+ * matches on base address to get confused and create
+ * overlapping freemaps. If we end up with no freemap entries
+ * then the next _add will compact the leaf block and
+ * regenerate the freemaps.
+ */
+ if (ichdr->freemap[i].size == 0 && ichdr->freemap[i].base > 0) {
+ ichdr->freemap[i].base = 0;
+ ichdr->holes = 1;
+ }
}
ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 607/752] xfs: fix freemap adjustments when adding xattrs to leaf blocks
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (147 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 606/752] xfs: delete attr leaf freemap entries when empty Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 608/752] xfs: fix the xattr scrub to detect freemap/entries array collisions Sasha Levin
` (135 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, stable, Christoph Hellwig, Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit 3eefc0c2b78444b64feeb3783c017d6adc3cd3ce ]
xfs/592 and xfs/794 both trip this assertion in the leaf block freemap
adjustment code after ~20 minutes of running on my test VMs:
ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t)
+ xfs_attr3_leaf_hdr_size(leaf));
Upon enabling quite a lot more debugging code, I narrowed this down to
fsstress trying to set a local extended attribute with namelen=3 and
valuelen=71. This results in an entry size of 80 bytes.
At the start of xfs_attr3_leaf_add_work, the freemap looks like this:
i 0 base 448 size 0 rhs 448 count 46
i 1 base 388 size 132 rhs 448 count 46
i 2 base 2120 size 4 rhs 448 count 46
firstused = 520
where "rhs" is the first byte past the end of the leaf entry array.
This is inconsistent -- the entries array ends at byte 448, but
freemap[1] says there's free space starting at byte 388!
By the end of the function, the freemap is in worse shape:
i 0 base 456 size 0 rhs 456 count 47
i 1 base 388 size 52 rhs 456 count 47
i 2 base 2120 size 4 rhs 456 count 47
firstused = 440
Important note: 388 is not aligned with the entries array element size
of 8 bytes.
Based on the incorrect freemap, the name area starts at byte 440, which
is below the end of the entries array! That's why the assertion
triggers and the filesystem shuts down.
How did we end up here? First, recall from the previous patch that the
freemap array in an xattr leaf block is not intended to be a
comprehensive map of all free space in the leaf block. In other words,
it's perfectly legal to have a leaf block with:
* 376 bytes in use by the entries array
* freemap[0] has [base = 376, size = 8]
* freemap[1] has [base = 388, size = 1500]
* the space between 376 and 388 is free, but the freemap stopped
tracking that some time ago
If we add one xattr, the entries array grows to 384 bytes, and
freemap[0] becomes [base = 384, size = 0]. So far, so good. But if we
add a second xattr, the entries array grows to 392 bytes, and freemap[0]
gets pushed up to [base = 392, size = 0]. This is bad, because
freemap[1] hasn't been updated, and now the entries array and the free
space claim the same space.
The fix here is to adjust all freemap entries so that none of them
collide with the entries array. Note that this fix relies on commit
2a2b5932db6758 ("xfs: fix attr leaf header freemap.size underflow") and
the previous patch that resets zero length freemap entries to have
base = 0.
Cc: <stable@vger.kernel.org> # v2.6.12
Fixes: 1da177e4c3f415 ("Linux-2.6.12-rc2")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/libxfs/xfs_attr_leaf.c | 36 +++++++++++++++++++++++++++--------
1 file changed, 28 insertions(+), 8 deletions(-)
diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
index 33c6c468ad8d5..b858e3c2ad50a 100644
--- a/fs/xfs/libxfs/xfs_attr_leaf.c
+++ b/fs/xfs/libxfs/xfs_attr_leaf.c
@@ -1476,6 +1476,7 @@ xfs_attr3_leaf_add_work(
struct xfs_attr_leaf_name_local *name_loc;
struct xfs_attr_leaf_name_remote *name_rmt;
struct xfs_mount *mp;
+ int old_end, new_end;
int tmp;
int i;
@@ -1568,17 +1569,36 @@ xfs_attr3_leaf_add_work(
if (be16_to_cpu(entry->nameidx) < ichdr->firstused)
ichdr->firstused = be16_to_cpu(entry->nameidx);
- ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t)
- + xfs_attr3_leaf_hdr_size(leaf));
- tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t)
- + xfs_attr3_leaf_hdr_size(leaf);
+ new_end = ichdr->count * sizeof(struct xfs_attr_leaf_entry) +
+ xfs_attr3_leaf_hdr_size(leaf);
+ old_end = new_end - sizeof(struct xfs_attr_leaf_entry);
+
+ ASSERT(ichdr->firstused >= new_end);
for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
- if (ichdr->freemap[i].base == tmp) {
- ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t);
+ int diff = 0;
+
+ if (ichdr->freemap[i].base == old_end) {
+ /*
+ * This freemap entry starts at the old end of the
+ * leaf entry array, so we need to adjust its base
+ * upward to accomodate the larger array.
+ */
+ diff = sizeof(struct xfs_attr_leaf_entry);
+ } else if (ichdr->freemap[i].size > 0 &&
+ ichdr->freemap[i].base < new_end) {
+ /*
+ * This freemap entry starts in the space claimed by
+ * the new leaf entry. Adjust its base upward to
+ * reflect that.
+ */
+ diff = new_end - ichdr->freemap[i].base;
+ }
+
+ if (diff) {
+ ichdr->freemap[i].base += diff;
ichdr->freemap[i].size -=
- min_t(uint16_t, ichdr->freemap[i].size,
- sizeof(xfs_attr_leaf_entry_t));
+ min_t(uint16_t, ichdr->freemap[i].size, diff);
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 608/752] xfs: fix the xattr scrub to detect freemap/entries array collisions
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (148 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 607/752] xfs: fix freemap adjustments when adding xattrs to leaf blocks Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 609/752] xfs: fix remote xattr valuelblk check Sasha Levin
` (134 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, stable, Christoph Hellwig, Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit 6fed8270448c246e706921c177e9633013dd3fcf ]
In the previous patches, we observed that it's possible for there to be
freemap entries with zero size but a nonzero base. This isn't an
inconsistency per se, but older kernels can get confused by this and
corrupt the block, leading to corruption.
If we see this, flag the xattr structure for optimization so that it
gets rebuilt.
Cc: <stable@vger.kernel.org> # v4.15
Fixes: 13791d3b833428 ("xfs: scrub extended attribute leaf space")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/scrub/attr.c | 54 ++++++++++++++++++++++-----------------------
1 file changed, 27 insertions(+), 27 deletions(-)
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index 708334f9b2bd1..ef299be01de5e 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -287,32 +287,6 @@ xchk_xattr_set_map(
return ret;
}
-/*
- * Check the leaf freemap from the usage bitmap. Returns false if the
- * attr freemap has problems or points to used space.
- */
-STATIC bool
-xchk_xattr_check_freemap(
- struct xfs_scrub *sc,
- struct xfs_attr3_icleaf_hdr *leafhdr)
-{
- struct xchk_xattr_buf *ab = sc->buf;
- unsigned int mapsize = sc->mp->m_attr_geo->blksize;
- int i;
-
- /* Construct bitmap of freemap contents. */
- bitmap_zero(ab->freemap, mapsize);
- for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
- if (!xchk_xattr_set_map(sc, ab->freemap,
- leafhdr->freemap[i].base,
- leafhdr->freemap[i].size))
- return false;
- }
-
- /* Look for bits that are set in freemap and are marked in use. */
- return !bitmap_intersects(ab->freemap, ab->usedmap, mapsize);
-}
-
/*
* Check this leaf entry's relations to everything else.
* Returns the number of bytes used for the name/value data.
@@ -403,6 +377,7 @@ xchk_xattr_block(
*last_checked = blk->blkno;
bitmap_zero(ab->usedmap, mp->m_attr_geo->blksize);
+ bitmap_zero(ab->freemap, mp->m_attr_geo->blksize);
/* Check all the padding. */
if (xfs_has_crc(ds->sc->mp)) {
@@ -449,6 +424,9 @@ xchk_xattr_block(
if ((char *)&entries[leafhdr.count] > (char *)leaf + leafhdr.firstused)
xchk_da_set_corrupt(ds, level);
+ if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
+ goto out;
+
buf_end = (char *)bp->b_addr + mp->m_attr_geo->blksize;
for (i = 0, ent = entries; i < leafhdr.count; ent++, i++) {
/* Mark the leaf entry itself. */
@@ -467,7 +445,29 @@ xchk_xattr_block(
goto out;
}
- if (!xchk_xattr_check_freemap(ds->sc, &leafhdr))
+ /* Construct bitmap of freemap contents. */
+ for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) {
+ if (!xchk_xattr_set_map(ds->sc, ab->freemap,
+ leafhdr.freemap[i].base,
+ leafhdr.freemap[i].size))
+ xchk_da_set_corrupt(ds, level);
+
+ /*
+ * freemap entries with zero length and nonzero base can cause
+ * problems with older kernels, so we mark these for preening
+ * even though there's no inconsistency.
+ */
+ if (leafhdr.freemap[i].size == 0 &&
+ leafhdr.freemap[i].base > 0)
+ xchk_da_set_preen(ds, level);
+
+ if (ds->sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
+ goto out;
+ }
+
+ /* Look for bits that are set in freemap and are marked in use. */
+ if (bitmap_intersects(ab->freemap, ab->usedmap,
+ mp->m_attr_geo->blksize))
xchk_da_set_corrupt(ds, level);
if (leafhdr.usedbytes != usedbytes)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 609/752] xfs: fix remote xattr valuelblk check
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (149 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 608/752] xfs: fix the xattr scrub to detect freemap/entries array collisions Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 610/752] xfs: get rid of the xchk_xfile_*_descr calls Sasha Levin
` (133 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, stable, Christoph Hellwig, Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit bd3138e8912c9db182eac5fed1337645a98b7a4f ]
In debugging other problems with generic/753, it turns out that it's
possible for the system go to down in the middle of a remote xattr set
operation such that the leaf block entry is marked incomplete and
valueblk is set to zero. Make this no longer a failure.
Cc: <stable@vger.kernel.org> # v4.15
Fixes: 13791d3b833428 ("xfs: scrub extended attribute leaf space")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/scrub/attr.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/scrub/attr.c b/fs/xfs/scrub/attr.c
index ef299be01de5e..a0878fdbcf386 100644
--- a/fs/xfs/scrub/attr.c
+++ b/fs/xfs/scrub/attr.c
@@ -338,7 +338,10 @@ xchk_xattr_entry(
rentry = xfs_attr3_leaf_name_remote(leaf, idx);
namesize = xfs_attr_leaf_entsize_remote(rentry->namelen);
name_end = (char *)rentry + namesize;
- if (rentry->namelen == 0 || rentry->valueblk == 0)
+ if (rentry->namelen == 0)
+ xchk_da_set_corrupt(ds, level);
+ if (rentry->valueblk == 0 &&
+ !(ent->flags & XFS_ATTR_INCOMPLETE))
xchk_da_set_corrupt(ds, level);
}
if (name_end > buf_end)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 610/752] xfs: get rid of the xchk_xfile_*_descr calls
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (150 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 609/752] xfs: fix remote xattr valuelblk check Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 611/752] spmi: apple: Add "apple,t8103-spmi" compatible Sasha Levin
` (132 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, r772577952, stable, Christoph Hellwig,
Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit 60382993a2e18041f88c7969f567f168cd3b4de3 ]
The xchk_xfile_*_descr macros call kasprintf, which can fail to allocate
memory if the formatted string is larger than 16 bytes (or whatever the
nofail guarantees are nowadays). Some of them could easily exceed that,
and Jiaming Zhang found a few places where that can happen with syzbot.
The descriptions are debugging aids and aren't required to be unique, so
let's just pass in static strings and eliminate this path to failure.
Note this patch touches a number of commits, most of which were merged
between 6.6 and 6.14.
Cc: r772577952@gmail.com
Cc: <stable@vger.kernel.org> # v6.12
Fixes: ab97f4b1c03075 ("xfs: repair AGI unlinked inode bucket lists")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jiaming Zhang <r772577952@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 13 ++++---------
fs/xfs/scrub/alloc_repair.c | 5 +----
fs/xfs/scrub/attr_repair.c | 20 +++++---------------
fs/xfs/scrub/bmap_repair.c | 6 +-----
fs/xfs/scrub/common.h | 25 -------------------------
fs/xfs/scrub/dir.c | 13 ++++---------
fs/xfs/scrub/dir_repair.c | 11 +++--------
fs/xfs/scrub/dirtree.c | 11 +++--------
fs/xfs/scrub/ialloc_repair.c | 5 +----
fs/xfs/scrub/nlinks.c | 6 ++----
fs/xfs/scrub/parent.c | 11 +++--------
fs/xfs/scrub/parent_repair.c | 23 ++++++-----------------
fs/xfs/scrub/quotacheck.c | 13 +++----------
fs/xfs/scrub/refcount_repair.c | 13 ++-----------
fs/xfs/scrub/rmap_repair.c | 5 +----
fs/xfs/scrub/rtbitmap_repair.c | 6 ++----
fs/xfs/scrub/rtrefcount_repair.c | 15 +++------------
fs/xfs/scrub/rtrmap_repair.c | 5 +----
fs/xfs/scrub/rtsummary.c | 7 ++-----
19 files changed, 47 insertions(+), 166 deletions(-)
--git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index cd6f0223879f4..a2f6a7f71d839 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -1708,7 +1708,6 @@ xrep_agi(
{
struct xrep_agi *ragi;
struct xfs_mount *mp = sc->mp;
- char *descr;
unsigned int i;
int error;
@@ -1742,17 +1741,13 @@ xrep_agi(
xagino_bitmap_init(&ragi->iunlink_bmp);
sc->buf_cleanup = xrep_agi_buf_cleanup;
- descr = xchk_xfile_ag_descr(sc, "iunlinked next pointers");
- error = xfarray_create(descr, 0, sizeof(xfs_agino_t),
- &ragi->iunlink_next);
- kfree(descr);
+ error = xfarray_create("iunlinked next pointers", 0,
+ sizeof(xfs_agino_t), &ragi->iunlink_next);
if (error)
return error;
- descr = xchk_xfile_ag_descr(sc, "iunlinked prev pointers");
- error = xfarray_create(descr, 0, sizeof(xfs_agino_t),
- &ragi->iunlink_prev);
- kfree(descr);
+ error = xfarray_create("iunlinked prev pointers", 0,
+ sizeof(xfs_agino_t), &ragi->iunlink_prev);
if (error)
return error;
diff --git a/fs/xfs/scrub/alloc_repair.c b/fs/xfs/scrub/alloc_repair.c
index bed6a09aa7911..b6fe1f23819eb 100644
--- a/fs/xfs/scrub/alloc_repair.c
+++ b/fs/xfs/scrub/alloc_repair.c
@@ -850,7 +850,6 @@ xrep_allocbt(
struct xrep_abt *ra;
struct xfs_mount *mp = sc->mp;
unsigned int busy_gen;
- char *descr;
int error;
/* We require the rmapbt to rebuild anything. */
@@ -876,11 +875,9 @@ xrep_allocbt(
}
/* Set up enough storage to handle maximally fragmented free space. */
- descr = xchk_xfile_ag_descr(sc, "free space records");
- error = xfarray_create(descr, mp->m_sb.sb_agblocks / 2,
+ error = xfarray_create("free space records", mp->m_sb.sb_agblocks / 2,
sizeof(struct xfs_alloc_rec_incore),
&ra->free_records);
- kfree(descr);
if (error)
goto out_ra;
diff --git a/fs/xfs/scrub/attr_repair.c b/fs/xfs/scrub/attr_repair.c
index 09d63aa10314b..eded354dec11e 100644
--- a/fs/xfs/scrub/attr_repair.c
+++ b/fs/xfs/scrub/attr_repair.c
@@ -1529,7 +1529,6 @@ xrep_xattr_setup_scan(
struct xrep_xattr **rxp)
{
struct xrep_xattr *rx;
- char *descr;
int max_len;
int error;
@@ -1555,35 +1554,26 @@ xrep_xattr_setup_scan(
goto out_rx;
/* Set up some staging for salvaged attribute keys and values */
- descr = xchk_xfile_ino_descr(sc, "xattr keys");
- error = xfarray_create(descr, 0, sizeof(struct xrep_xattr_key),
+ error = xfarray_create("xattr keys", 0, sizeof(struct xrep_xattr_key),
&rx->xattr_records);
- kfree(descr);
if (error)
goto out_rx;
- descr = xchk_xfile_ino_descr(sc, "xattr names");
- error = xfblob_create(descr, &rx->xattr_blobs);
- kfree(descr);
+ error = xfblob_create("xattr names", &rx->xattr_blobs);
if (error)
goto out_keys;
if (xfs_has_parent(sc->mp)) {
ASSERT(sc->flags & XCHK_FSGATES_DIRENTS);
- descr = xchk_xfile_ino_descr(sc,
- "xattr retained parent pointer entries");
- error = xfarray_create(descr, 0,
+ error = xfarray_create("xattr parent pointer entries", 0,
sizeof(struct xrep_xattr_pptr),
&rx->pptr_recs);
- kfree(descr);
if (error)
goto out_values;
- descr = xchk_xfile_ino_descr(sc,
- "xattr retained parent pointer names");
- error = xfblob_create(descr, &rx->pptr_names);
- kfree(descr);
+ error = xfblob_create("xattr parent pointer names",
+ &rx->pptr_names);
if (error)
goto out_pprecs;
diff --git a/fs/xfs/scrub/bmap_repair.c b/fs/xfs/scrub/bmap_repair.c
index 1084213b8e9b8..747cd9389b491 100644
--- a/fs/xfs/scrub/bmap_repair.c
+++ b/fs/xfs/scrub/bmap_repair.c
@@ -923,7 +923,6 @@ xrep_bmap(
bool allow_unwritten)
{
struct xrep_bmap *rb;
- char *descr;
xfs_extnum_t max_bmbt_recs;
bool large_extcount;
int error = 0;
@@ -945,11 +944,8 @@ xrep_bmap(
/* Set up enough storage to handle the max records for this fork. */
large_extcount = xfs_has_large_extent_counts(sc->mp);
max_bmbt_recs = xfs_iext_max_nextents(large_extcount, whichfork);
- descr = xchk_xfile_ino_descr(sc, "%s fork mapping records",
- whichfork == XFS_DATA_FORK ? "data" : "attr");
- error = xfarray_create(descr, max_bmbt_recs,
+ error = xfarray_create("fork mapping records", max_bmbt_recs,
sizeof(struct xfs_bmbt_rec), &rb->bmap_records);
- kfree(descr);
if (error)
goto out_rb;
diff --git a/fs/xfs/scrub/common.h b/fs/xfs/scrub/common.h
index ddbc065c798cd..f2ecc68538f0c 100644
--- a/fs/xfs/scrub/common.h
+++ b/fs/xfs/scrub/common.h
@@ -246,31 +246,6 @@ static inline bool xchk_could_repair(const struct xfs_scrub *sc)
int xchk_metadata_inode_forks(struct xfs_scrub *sc);
-/*
- * Helper macros to allocate and format xfile description strings.
- * Callers must kfree the pointer returned.
- */
-#define xchk_xfile_descr(sc, fmt, ...) \
- kasprintf(XCHK_GFP_FLAGS, "XFS (%s): " fmt, \
- (sc)->mp->m_super->s_id, ##__VA_ARGS__)
-#define xchk_xfile_ag_descr(sc, fmt, ...) \
- kasprintf(XCHK_GFP_FLAGS, "XFS (%s): AG 0x%x " fmt, \
- (sc)->mp->m_super->s_id, \
- (sc)->sa.pag ? \
- pag_agno((sc)->sa.pag) : (sc)->sm->sm_agno, \
- ##__VA_ARGS__)
-#define xchk_xfile_ino_descr(sc, fmt, ...) \
- kasprintf(XCHK_GFP_FLAGS, "XFS (%s): inode 0x%llx " fmt, \
- (sc)->mp->m_super->s_id, \
- (sc)->ip ? (sc)->ip->i_ino : (sc)->sm->sm_ino, \
- ##__VA_ARGS__)
-#define xchk_xfile_rtgroup_descr(sc, fmt, ...) \
- kasprintf(XCHK_GFP_FLAGS, "XFS (%s): rtgroup 0x%x " fmt, \
- (sc)->mp->m_super->s_id, \
- (sc)->sa.pag ? \
- rtg_rgno((sc)->sr.rtg) : (sc)->sm->sm_agno, \
- ##__VA_ARGS__)
-
/*
* Setting up a hook to wait for intents to drain is costly -- we have to take
* the CPU hotplug lock and force an i-cache flush on all CPUs once to set it
diff --git a/fs/xfs/scrub/dir.c b/fs/xfs/scrub/dir.c
index c877bde71e628..4f849d98cbdd2 100644
--- a/fs/xfs/scrub/dir.c
+++ b/fs/xfs/scrub/dir.c
@@ -1102,22 +1102,17 @@ xchk_directory(
sd->xname.name = sd->namebuf;
if (xfs_has_parent(sc->mp)) {
- char *descr;
-
/*
* Set up some staging memory for dirents that we can't check
* due to locking contention.
*/
- descr = xchk_xfile_ino_descr(sc, "slow directory entries");
- error = xfarray_create(descr, 0, sizeof(struct xchk_dirent),
- &sd->dir_entries);
- kfree(descr);
+ error = xfarray_create("slow directory entries", 0,
+ sizeof(struct xchk_dirent), &sd->dir_entries);
if (error)
goto out_sd;
- descr = xchk_xfile_ino_descr(sc, "slow directory entry names");
- error = xfblob_create(descr, &sd->dir_names);
- kfree(descr);
+ error = xfblob_create("slow directory entry names",
+ &sd->dir_names);
if (error)
goto out_entries;
}
diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c
index 8d3b550990b58..7a21b688a4715 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -1784,20 +1784,15 @@ xrep_dir_setup_scan(
struct xrep_dir *rd)
{
struct xfs_scrub *sc = rd->sc;
- char *descr;
int error;
/* Set up some staging memory for salvaging dirents. */
- descr = xchk_xfile_ino_descr(sc, "directory entries");
- error = xfarray_create(descr, 0, sizeof(struct xrep_dirent),
- &rd->dir_entries);
- kfree(descr);
+ error = xfarray_create("directory entries", 0,
+ sizeof(struct xrep_dirent), &rd->dir_entries);
if (error)
return error;
- descr = xchk_xfile_ino_descr(sc, "directory entry names");
- error = xfblob_create(descr, &rd->dir_names);
- kfree(descr);
+ error = xfblob_create("directory entry names", &rd->dir_names);
if (error)
goto out_xfarray;
diff --git a/fs/xfs/scrub/dirtree.c b/fs/xfs/scrub/dirtree.c
index 3a9cdf8738b6d..f9c85b8b194fa 100644
--- a/fs/xfs/scrub/dirtree.c
+++ b/fs/xfs/scrub/dirtree.c
@@ -92,7 +92,6 @@ xchk_setup_dirtree(
struct xfs_scrub *sc)
{
struct xchk_dirtree *dl;
- char *descr;
int error;
xchk_fsgates_enable(sc, XCHK_FSGATES_DIRENTS);
@@ -116,16 +115,12 @@ xchk_setup_dirtree(
mutex_init(&dl->lock);
- descr = xchk_xfile_ino_descr(sc, "dirtree path steps");
- error = xfarray_create(descr, 0, sizeof(struct xchk_dirpath_step),
- &dl->path_steps);
- kfree(descr);
+ error = xfarray_create("dirtree path steps", 0,
+ sizeof(struct xchk_dirpath_step), &dl->path_steps);
if (error)
goto out_dl;
- descr = xchk_xfile_ino_descr(sc, "dirtree path names");
- error = xfblob_create(descr, &dl->path_names);
- kfree(descr);
+ error = xfblob_create("dirtree path names", &dl->path_names);
if (error)
goto out_steps;
diff --git a/fs/xfs/scrub/ialloc_repair.c b/fs/xfs/scrub/ialloc_repair.c
index 14e48d3f1912b..b1d00167d263f 100644
--- a/fs/xfs/scrub/ialloc_repair.c
+++ b/fs/xfs/scrub/ialloc_repair.c
@@ -797,7 +797,6 @@ xrep_iallocbt(
{
struct xrep_ibt *ri;
struct xfs_mount *mp = sc->mp;
- char *descr;
xfs_agino_t first_agino, last_agino;
int error = 0;
@@ -816,11 +815,9 @@ xrep_iallocbt(
/* Set up enough storage to handle an AG with nothing but inodes. */
xfs_agino_range(mp, pag_agno(sc->sa.pag), &first_agino, &last_agino);
last_agino /= XFS_INODES_PER_CHUNK;
- descr = xchk_xfile_ag_descr(sc, "inode index records");
- error = xfarray_create(descr, last_agino,
+ error = xfarray_create("inode index records", last_agino,
sizeof(struct xfs_inobt_rec_incore),
&ri->inode_records);
- kfree(descr);
if (error)
goto out_ri;
diff --git a/fs/xfs/scrub/nlinks.c b/fs/xfs/scrub/nlinks.c
index 091c79e432e59..2ba686e4de8bc 100644
--- a/fs/xfs/scrub/nlinks.c
+++ b/fs/xfs/scrub/nlinks.c
@@ -990,7 +990,6 @@ xchk_nlinks_setup_scan(
struct xchk_nlink_ctrs *xnc)
{
struct xfs_mount *mp = sc->mp;
- char *descr;
unsigned long long max_inos;
xfs_agnumber_t last_agno = mp->m_sb.sb_agcount - 1;
xfs_agino_t first_agino, last_agino;
@@ -1007,10 +1006,9 @@ xchk_nlinks_setup_scan(
*/
xfs_agino_range(mp, last_agno, &first_agino, &last_agino);
max_inos = XFS_AGINO_TO_INO(mp, last_agno, last_agino) + 1;
- descr = xchk_xfile_descr(sc, "file link counts");
- error = xfarray_create(descr, min(XFS_MAXINUMBER + 1, max_inos),
+ error = xfarray_create("file link counts",
+ min(XFS_MAXINUMBER + 1, max_inos),
sizeof(struct xchk_nlink), &xnc->nlinks);
- kfree(descr);
if (error)
goto out_teardown;
diff --git a/fs/xfs/scrub/parent.c b/fs/xfs/scrub/parent.c
index 3b692c4acc1e6..f2ee520cc9429 100644
--- a/fs/xfs/scrub/parent.c
+++ b/fs/xfs/scrub/parent.c
@@ -755,7 +755,6 @@ xchk_parent_pptr(
struct xfs_scrub *sc)
{
struct xchk_pptrs *pp;
- char *descr;
int error;
pp = kvzalloc(sizeof(struct xchk_pptrs), XCHK_GFP_FLAGS);
@@ -768,16 +767,12 @@ xchk_parent_pptr(
* Set up some staging memory for parent pointers that we can't check
* due to locking contention.
*/
- descr = xchk_xfile_ino_descr(sc, "slow parent pointer entries");
- error = xfarray_create(descr, 0, sizeof(struct xchk_pptr),
- &pp->pptr_entries);
- kfree(descr);
+ error = xfarray_create("slow parent pointer entries", 0,
+ sizeof(struct xchk_pptr), &pp->pptr_entries);
if (error)
goto out_pp;
- descr = xchk_xfile_ino_descr(sc, "slow parent pointer names");
- error = xfblob_create(descr, &pp->pptr_names);
- kfree(descr);
+ error = xfblob_create("slow parent pointer names", &pp->pptr_names);
if (error)
goto out_entries;
diff --git a/fs/xfs/scrub/parent_repair.c b/fs/xfs/scrub/parent_repair.c
index 2949feda62717..897902c54178d 100644
--- a/fs/xfs/scrub/parent_repair.c
+++ b/fs/xfs/scrub/parent_repair.c
@@ -1497,7 +1497,6 @@ xrep_parent_setup_scan(
struct xrep_parent *rp)
{
struct xfs_scrub *sc = rp->sc;
- char *descr;
struct xfs_da_geometry *geo = sc->mp->m_attr_geo;
int max_len;
int error;
@@ -1525,32 +1524,22 @@ xrep_parent_setup_scan(
goto out_xattr_name;
/* Set up some staging memory for logging parent pointer updates. */
- descr = xchk_xfile_ino_descr(sc, "parent pointer entries");
- error = xfarray_create(descr, 0, sizeof(struct xrep_pptr),
- &rp->pptr_recs);
- kfree(descr);
+ error = xfarray_create("parent pointer entries", 0,
+ sizeof(struct xrep_pptr), &rp->pptr_recs);
if (error)
goto out_xattr_value;
- descr = xchk_xfile_ino_descr(sc, "parent pointer names");
- error = xfblob_create(descr, &rp->pptr_names);
- kfree(descr);
+ error = xfblob_create("parent pointer names", &rp->pptr_names);
if (error)
goto out_recs;
/* Set up some storage for copying attrs before the mapping exchange */
- descr = xchk_xfile_ino_descr(sc,
- "parent pointer retained xattr entries");
- error = xfarray_create(descr, 0, sizeof(struct xrep_parent_xattr),
- &rp->xattr_records);
- kfree(descr);
+ error = xfarray_create("parent pointer xattr entries", 0,
+ sizeof(struct xrep_parent_xattr), &rp->xattr_records);
if (error)
goto out_names;
- descr = xchk_xfile_ino_descr(sc,
- "parent pointer retained xattr values");
- error = xfblob_create(descr, &rp->xattr_blobs);
- kfree(descr);
+ error = xfblob_create("parent pointer xattr values", &rp->xattr_blobs);
if (error)
goto out_attr_keys;
diff --git a/fs/xfs/scrub/quotacheck.c b/fs/xfs/scrub/quotacheck.c
index e4105aaafe845..38e855fe0feeb 100644
--- a/fs/xfs/scrub/quotacheck.c
+++ b/fs/xfs/scrub/quotacheck.c
@@ -742,7 +742,6 @@ xqcheck_setup_scan(
struct xfs_scrub *sc,
struct xqcheck *xqc)
{
- char *descr;
struct xfs_quotainfo *qi = sc->mp->m_quotainfo;
unsigned long long max_dquots = XFS_DQ_ID_MAX + 1ULL;
int error;
@@ -757,28 +756,22 @@ xqcheck_setup_scan(
error = -ENOMEM;
if (xfs_this_quota_on(sc->mp, XFS_DQTYPE_USER)) {
- descr = xchk_xfile_descr(sc, "user dquot records");
- error = xfarray_create(descr, max_dquots,
+ error = xfarray_create("user dquot records", max_dquots,
sizeof(struct xqcheck_dquot), &xqc->ucounts);
- kfree(descr);
if (error)
goto out_teardown;
}
if (xfs_this_quota_on(sc->mp, XFS_DQTYPE_GROUP)) {
- descr = xchk_xfile_descr(sc, "group dquot records");
- error = xfarray_create(descr, max_dquots,
+ error = xfarray_create("group dquot records", max_dquots,
sizeof(struct xqcheck_dquot), &xqc->gcounts);
- kfree(descr);
if (error)
goto out_teardown;
}
if (xfs_this_quota_on(sc->mp, XFS_DQTYPE_PROJ)) {
- descr = xchk_xfile_descr(sc, "project dquot records");
- error = xfarray_create(descr, max_dquots,
+ error = xfarray_create("project dquot records", max_dquots,
sizeof(struct xqcheck_dquot), &xqc->pcounts);
- kfree(descr);
if (error)
goto out_teardown;
}
diff --git a/fs/xfs/scrub/refcount_repair.c b/fs/xfs/scrub/refcount_repair.c
index 9c8cb5332da04..360fd7354880a 100644
--- a/fs/xfs/scrub/refcount_repair.c
+++ b/fs/xfs/scrub/refcount_repair.c
@@ -123,13 +123,7 @@ int
xrep_setup_ag_refcountbt(
struct xfs_scrub *sc)
{
- char *descr;
- int error;
-
- descr = xchk_xfile_ag_descr(sc, "rmap record bag");
- error = xrep_setup_xfbtree(sc, descr);
- kfree(descr);
- return error;
+ return xrep_setup_xfbtree(sc, "rmap record bag");
}
/* Check for any obvious conflicts with this shared/CoW staging extent. */
@@ -704,7 +698,6 @@ xrep_refcountbt(
{
struct xrep_refc *rr;
struct xfs_mount *mp = sc->mp;
- char *descr;
int error;
/* We require the rmapbt to rebuild anything. */
@@ -717,11 +710,9 @@ xrep_refcountbt(
rr->sc = sc;
/* Set up enough storage to handle one refcount record per block. */
- descr = xchk_xfile_ag_descr(sc, "reference count records");
- error = xfarray_create(descr, mp->m_sb.sb_agblocks,
+ error = xfarray_create("reference count records", mp->m_sb.sb_agblocks,
sizeof(struct xfs_refcount_irec),
&rr->refcount_records);
- kfree(descr);
if (error)
goto out_rr;
diff --git a/fs/xfs/scrub/rmap_repair.c b/fs/xfs/scrub/rmap_repair.c
index 17d4a38d735cb..cfd1cf403b37e 100644
--- a/fs/xfs/scrub/rmap_repair.c
+++ b/fs/xfs/scrub/rmap_repair.c
@@ -164,14 +164,11 @@ xrep_setup_ag_rmapbt(
struct xfs_scrub *sc)
{
struct xrep_rmap *rr;
- char *descr;
int error;
xchk_fsgates_enable(sc, XCHK_FSGATES_RMAP);
- descr = xchk_xfile_ag_descr(sc, "reverse mapping records");
- error = xrep_setup_xfbtree(sc, descr);
- kfree(descr);
+ error = xrep_setup_xfbtree(sc, "reverse mapping records");
if (error)
return error;
diff --git a/fs/xfs/scrub/rtbitmap_repair.c b/fs/xfs/scrub/rtbitmap_repair.c
index 203a1a97c5026..41d6736a529d0 100644
--- a/fs/xfs/scrub/rtbitmap_repair.c
+++ b/fs/xfs/scrub/rtbitmap_repair.c
@@ -43,7 +43,6 @@ xrep_setup_rtbitmap(
struct xchk_rtbitmap *rtb)
{
struct xfs_mount *mp = sc->mp;
- char *descr;
unsigned long long blocks = mp->m_sb.sb_rbmblocks;
int error;
@@ -52,9 +51,8 @@ xrep_setup_rtbitmap(
return error;
/* Create an xfile to hold our reconstructed bitmap. */
- descr = xchk_xfile_rtgroup_descr(sc, "bitmap file");
- error = xfile_create(descr, blocks * mp->m_sb.sb_blocksize, &sc->xfile);
- kfree(descr);
+ error = xfile_create("realtime bitmap file",
+ blocks * mp->m_sb.sb_blocksize, &sc->xfile);
if (error)
return error;
diff --git a/fs/xfs/scrub/rtrefcount_repair.c b/fs/xfs/scrub/rtrefcount_repair.c
index 983362447826d..b35e39cce7ad5 100644
--- a/fs/xfs/scrub/rtrefcount_repair.c
+++ b/fs/xfs/scrub/rtrefcount_repair.c
@@ -128,13 +128,7 @@ int
xrep_setup_rtrefcountbt(
struct xfs_scrub *sc)
{
- char *descr;
- int error;
-
- descr = xchk_xfile_ag_descr(sc, "rmap record bag");
- error = xrep_setup_xfbtree(sc, descr);
- kfree(descr);
- return error;
+ return xrep_setup_xfbtree(sc, "realtime rmap record bag");
}
/* Check for any obvious conflicts with this shared/CoW staging extent. */
@@ -704,7 +698,6 @@ xrep_rtrefcountbt(
{
struct xrep_rtrefc *rr;
struct xfs_mount *mp = sc->mp;
- char *descr;
int error;
/* We require the rmapbt to rebuild anything. */
@@ -722,11 +715,9 @@ xrep_rtrefcountbt(
rr->sc = sc;
/* Set up enough storage to handle one refcount record per rt extent. */
- descr = xchk_xfile_ag_descr(sc, "reference count records");
- error = xfarray_create(descr, mp->m_sb.sb_rextents,
- sizeof(struct xfs_refcount_irec),
+ error = xfarray_create("realtime reference count records",
+ mp->m_sb.sb_rextents, sizeof(struct xfs_refcount_irec),
&rr->refcount_records);
- kfree(descr);
if (error)
goto out_rr;
diff --git a/fs/xfs/scrub/rtrmap_repair.c b/fs/xfs/scrub/rtrmap_repair.c
index 7561941a337a1..749977a66e40f 100644
--- a/fs/xfs/scrub/rtrmap_repair.c
+++ b/fs/xfs/scrub/rtrmap_repair.c
@@ -103,14 +103,11 @@ xrep_setup_rtrmapbt(
struct xfs_scrub *sc)
{
struct xrep_rtrmap *rr;
- char *descr;
int error;
xchk_fsgates_enable(sc, XCHK_FSGATES_RMAP);
- descr = xchk_xfile_rtgroup_descr(sc, "reverse mapping records");
- error = xrep_setup_xfbtree(sc, descr);
- kfree(descr);
+ error = xrep_setup_xfbtree(sc, "realtime reverse mapping records");
if (error)
return error;
diff --git a/fs/xfs/scrub/rtsummary.c b/fs/xfs/scrub/rtsummary.c
index 4ac679c1bd29c..fb78cff2ac3a1 100644
--- a/fs/xfs/scrub/rtsummary.c
+++ b/fs/xfs/scrub/rtsummary.c
@@ -43,7 +43,6 @@ xchk_setup_rtsummary(
struct xfs_scrub *sc)
{
struct xfs_mount *mp = sc->mp;
- char *descr;
struct xchk_rtsummary *rts;
int error;
@@ -70,10 +69,8 @@ xchk_setup_rtsummary(
* Create an xfile to construct a new rtsummary file. The xfile allows
* us to avoid pinning kernel memory for this purpose.
*/
- descr = xchk_xfile_descr(sc, "realtime summary file");
- error = xfile_create(descr, XFS_FSB_TO_B(mp, mp->m_rsumblocks),
- &sc->xfile);
- kfree(descr);
+ error = xfile_create("realtime summary file",
+ XFS_FSB_TO_B(mp, mp->m_rsumblocks), &sc->xfile);
if (error)
return error;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 611/752] spmi: apple: Add "apple,t8103-spmi" compatible
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (151 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 610/752] xfs: get rid of the xchk_xfile_*_descr calls Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 612/752] rust/drm: Fix Registration::{new,new_foreign_owned}() docs Sasha Levin
` (131 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Janne Grunau, stable, Neal Gompa, Stephen Boyd,
Greg Kroah-Hartman, Sasha Levin
From: Janne Grunau <j@jannau.net>
[ Upstream commit 6c54b0a801dd8227237ba0bf0728bb42681cf027 ]
After discussion with the devicetree maintainers we agreed to not extend
lists with the generic compatible "apple,spmi" anymore [1]. Use
"apple,t8103-spmi" as base compatible as it is the SoC the driver and
bindings were written for.
[1]: https://lore.kernel.org/asahi/12ab93b7-1fc2-4ce0-926e-c8141cfe81bf@kernel.org/
Fixes: 77ca75e80c71 ("spmi: add a spmi driver for Apple SoC")
Cc: stable@vger.kernel.org
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Link: https://patch.msgid.link/20260123182039.224314-7-sboyd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/spmi/spmi-apple-controller.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/spmi/spmi-apple-controller.c b/drivers/spmi/spmi-apple-controller.c
index 697b3e8bb0235..87e3ee9d4f2aa 100644
--- a/drivers/spmi/spmi-apple-controller.c
+++ b/drivers/spmi/spmi-apple-controller.c
@@ -149,6 +149,7 @@ static int apple_spmi_probe(struct platform_device *pdev)
}
static const struct of_device_id apple_spmi_match_table[] = {
+ { .compatible = "apple,t8103-spmi", },
{ .compatible = "apple,spmi", },
{}
};
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 612/752] rust/drm: Fix Registration::{new,new_foreign_owned}() docs
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (152 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 611/752] spmi: apple: Add "apple,t8103-spmi" compatible Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 613/752] KVM: x86: Add SRCU protection for reading PDPTRs in __get_sregs2() Sasha Levin
` (130 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Lyude Paul, Danilo Krummrich, stable, Sasha Levin
From: Lyude Paul <lyude@redhat.com>
[ Upstream commit 638eeda8abaa3e6afe6bd5758ef8045a7f33b9a0 ]
Looks like we've actually had a malformed rustdoc reference in the rustdocs
for Registration::new_foreign_owned() for a while that, when fixed, still
couldn't resolve properly because it refers to a private item.
This is probably leftover from when Registration::new() was public, so drop
the documentation from that function and fixup the documentation for
Registration::new_foreign_owned().
Signed-off-by: Lyude Paul <lyude@redhat.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Fixes: 0600032c54b7 ("rust: drm: add DRM driver registration")
Cc: <stable@vger.kernel.org> # v6.16+
Link: https://patch.msgid.link/20260122221037.3462081-1-lyude@redhat.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
rust/kernel/drm/driver.rs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/rust/kernel/drm/driver.rs b/rust/kernel/drm/driver.rs
index f30ee4c6245cd..e09f977b5b519 100644
--- a/rust/kernel/drm/driver.rs
+++ b/rust/kernel/drm/driver.rs
@@ -121,7 +121,6 @@ pub trait Driver {
pub struct Registration<T: Driver>(ARef<drm::Device<T>>);
impl<T: Driver> Registration<T> {
- /// Creates a new [`Registration`] and registers it.
fn new(drm: &drm::Device<T>, flags: usize) -> Result<Self> {
// SAFETY: `drm.as_raw()` is valid by the invariants of `drm::Device`.
to_result(unsafe { bindings::drm_dev_register(drm.as_raw(), flags) })?;
@@ -129,8 +128,9 @@ impl<T: Driver> Registration<T> {
Ok(Self(drm.into()))
}
- /// Same as [`Registration::new`}, but transfers ownership of the [`Registration`] to
- /// [`devres::register`].
+ /// Registers a new [`Device`](drm::Device) with userspace.
+ ///
+ /// Ownership of the [`Registration`] object is passed to [`devres::register`].
pub fn new_foreign_owned(
drm: &drm::Device<T>,
dev: &device::Device<device::Bound>,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 613/752] KVM: x86: Add SRCU protection for reading PDPTRs in __get_sregs2()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (153 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 612/752] rust/drm: Fix Registration::{new,new_foreign_owned}() docs Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 614/752] PCI: endpoint: Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink() functions Sasha Levin
` (129 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Vasiliy Kovalev, Sean Christopherson, stable, Sasha Levin
From: Vasiliy Kovalev <kovalev@altlinux.org>
[ Upstream commit 95d848dc7e639988dbb385a8cba9b484607cf98c ]
Add SRCU read-side protection when reading PDPTR registers in
__get_sregs2().
Reading PDPTRs may trigger access to guest memory:
kvm_pdptr_read() -> svm_cache_reg() -> load_pdptrs() ->
kvm_vcpu_read_guest_page() -> kvm_vcpu_gfn_to_memslot()
kvm_vcpu_gfn_to_memslot() dereferences memslots via __kvm_memslots(),
which uses srcu_dereference_check() and requires either kvm->srcu or
kvm->slots_lock to be held. Currently only vcpu->mutex is held,
triggering lockdep warning:
=============================
WARNING: suspicious RCU usage in kvm_vcpu_gfn_to_memslot
6.12.59+ #3 Not tainted
include/linux/kvm_host.h:1062 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by syz.5.1717/15100:
#0: ff1100002f4b00b0 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x1d5/0x1590
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:94 [inline]
dump_stack_lvl+0xf0/0x120 lib/dump_stack.c:120
lockdep_rcu_suspicious+0x1e3/0x270 kernel/locking/lockdep.c:6824
__kvm_memslots include/linux/kvm_host.h:1062 [inline]
__kvm_memslots include/linux/kvm_host.h:1059 [inline]
kvm_vcpu_memslots include/linux/kvm_host.h:1076 [inline]
kvm_vcpu_gfn_to_memslot+0x518/0x5e0 virt/kvm/kvm_main.c:2617
kvm_vcpu_read_guest_page+0x27/0x50 virt/kvm/kvm_main.c:3302
load_pdptrs+0xff/0x4b0 arch/x86/kvm/x86.c:1065
svm_cache_reg+0x1c9/0x230 arch/x86/kvm/svm/svm.c:1688
kvm_pdptr_read arch/x86/kvm/kvm_cache_regs.h:141 [inline]
__get_sregs2 arch/x86/kvm/x86.c:11784 [inline]
kvm_arch_vcpu_ioctl+0x3e20/0x4aa0 arch/x86/kvm/x86.c:6279
kvm_vcpu_ioctl+0x856/0x1590 virt/kvm/kvm_main.c:4663
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl fs/ioctl.c:893 [inline]
__x64_sys_ioctl+0x18b/0x210 fs/ioctl.c:893
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xbd/0x1d0 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.
Suggested-by: Sean Christopherson <seanjc@google.com>
Cc: stable@vger.kernel.org
Fixes: 6dba94035203 ("KVM: x86: Introduce KVM_GET_SREGS2 / KVM_SET_SREGS2")
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
Link: https://patch.msgid.link/20260123222801.646123-1-kovalev@altlinux.org
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kvm/x86.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 79d0abaf71dde..aeb7f902b3c7f 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -12147,9 +12147,11 @@ static void __get_sregs2(struct kvm_vcpu *vcpu, struct kvm_sregs2 *sregs2)
return;
if (is_pae_paging(vcpu)) {
+ kvm_vcpu_srcu_read_lock(vcpu);
for (i = 0 ; i < 4 ; i++)
sregs2->pdptrs[i] = kvm_pdptr_read(vcpu, i);
sregs2->flags |= KVM_SREGS2_FLAGS_PDPTRS_VALID;
+ kvm_vcpu_srcu_read_unlock(vcpu);
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 614/752] PCI: endpoint: Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink() functions
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (154 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 613/752] KVM: x86: Add SRCU protection for reading PDPTRs in __get_sregs2() Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 615/752] pinctrl: intel: Add code name documentation Sasha Levin
` (128 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Manikanta Maddireddy, Manivannan Sadhasivam, Bjorn Helgaas,
Niklas Cassel, Frank Li, stable, Sasha Levin
From: Manikanta Maddireddy <mmaddireddy@nvidia.com>
[ Upstream commit 8754dd7639ab0fd68c3ab9d91c7bdecc3e5740a8 ]
struct configfs_item_operations callbacks are defined like the following:
int (*allow_link)(struct config_item *src, struct config_item *target);
void (*drop_link)(struct config_item *src, struct config_item *target);
While pci_primary_epc_epf_link() and pci_secondary_epc_epf_link() specify
the parameters in the correct order, pci_primary_epc_epf_unlink() and
pci_secondary_epc_epf_unlink() specify the parameters in the wrong order,
leading to the below kernel crash when using the unlink command in
configfs:
Unable to handle kernel paging request at virtual address 0000000300000857
Mem abort info:
...
pc : string+0x54/0x14c
lr : vsnprintf+0x280/0x6e8
...
string+0x54/0x14c
vsnprintf+0x280/0x6e8
vprintk_default+0x38/0x4c
vprintk+0xc4/0xe0
pci_epf_unbind+0xdc/0x108
configfs_unlink+0xe0/0x208+0x44/0x74
vfs_unlink+0x120/0x29c
__arm64_sys_unlinkat+0x3c/0x90
invoke_syscall+0x48/0x134
do_el0_svc+0x1c/0x30prop.0+0xd0/0xf0
Fixes: e85a2d783762 ("PCI: endpoint: Add support in configfs to associate two EPCs with EPF")
Signed-off-by: Manikanta Maddireddy <mmaddireddy@nvidia.com>
[mani: cced stable, changed commit message as per https://lore.kernel.org/linux-pci/aV9joi3jF1R6ca02@ryzen]
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260108062747.1870669-1-mmaddireddy@nvidia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/endpoint/pci-ep-cfs.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/endpoint/pci-ep-cfs.c b/drivers/pci/endpoint/pci-ep-cfs.c
index 43feb6139fa36..8b392a8363bb1 100644
--- a/drivers/pci/endpoint/pci-ep-cfs.c
+++ b/drivers/pci/endpoint/pci-ep-cfs.c
@@ -68,8 +68,8 @@ static int pci_secondary_epc_epf_link(struct config_item *epf_item,
return 0;
}
-static void pci_secondary_epc_epf_unlink(struct config_item *epc_item,
- struct config_item *epf_item)
+static void pci_secondary_epc_epf_unlink(struct config_item *epf_item,
+ struct config_item *epc_item)
{
struct pci_epf_group *epf_group = to_pci_epf_group(epf_item->ci_parent);
struct pci_epc_group *epc_group = to_pci_epc_group(epc_item);
@@ -132,8 +132,8 @@ static int pci_primary_epc_epf_link(struct config_item *epf_item,
return 0;
}
-static void pci_primary_epc_epf_unlink(struct config_item *epc_item,
- struct config_item *epf_item)
+static void pci_primary_epc_epf_unlink(struct config_item *epf_item,
+ struct config_item *epc_item)
{
struct pci_epf_group *epf_group = to_pci_epf_group(epf_item->ci_parent);
struct pci_epc_group *epc_group = to_pci_epc_group(epc_item);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 615/752] pinctrl: intel: Add code name documentation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (155 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 614/752] PCI: endpoint: Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink() functions Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 616/752] xfs: only call xf{array,blob}_destroy if we have a valid pointer Sasha Levin
` (127 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Raag Jadav, stable, Guido Trentalancia, Mika Westerberg,
Andy Shevchenko, Sasha Levin
From: Raag Jadav <raag.jadav@intel.com>
[ Upstream commit fc32c5725fbe1164d353400389d3e29d19960a3a ]
Intel pinctrl drivers support large set of platforms and the IPs are
often reused by their different variants, but it's currently not possible
to figure out the exact driver that supports specific variant. Add user
friendly documentation for them.
Cc: stable@vger.kernel.org
Reported-by: Guido Trentalancia <guido@trentalancia.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220056
Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Acked-by: Guido Trentalancia <guido@trentalancia.com>
[andy: added Oxford comma]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pinctrl/intel/Kconfig | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/drivers/pinctrl/intel/Kconfig b/drivers/pinctrl/intel/Kconfig
index 248c2e558ff32..3ebf072371457 100644
--- a/drivers/pinctrl/intel/Kconfig
+++ b/drivers/pinctrl/intel/Kconfig
@@ -52,7 +52,10 @@ config PINCTRL_ALDERLAKE
select PINCTRL_INTEL
help
This pinctrl driver provides an interface that allows configuring
- of Intel Alder Lake PCH pins and using them as GPIOs.
+ PCH pins of the following platforms and using them as GPIOs:
+ - Alder Lake HX, N, and S
+ - Raptor Lake HX, E, and S
+ - Twin Lake
config PINCTRL_BROXTON
tristate "Intel Broxton pinctrl and GPIO driver"
@@ -136,15 +139,17 @@ config PINCTRL_METEORLAKE
select PINCTRL_INTEL
help
This pinctrl driver provides an interface that allows configuring
- of Intel Meteor Lake pins and using them as GPIOs.
+ SoC pins of the following platforms and using them as GPIOs:
+ - Arrow Lake (all variants)
+ - Meteor Lake (all variants)
config PINCTRL_METEORPOINT
tristate "Intel Meteor Point pinctrl and GPIO driver"
select PINCTRL_INTEL
help
- Meteor Point is the PCH of Intel Meteor Lake. This pinctrl driver
- provides an interface that allows configuring of PCH pins and
- using them as GPIOs.
+ This pinctrl driver provides an interface that allows configuring
+ PCH pins of the following platforms and using them as GPIOs:
+ - Arrow Lake HX and S
config PINCTRL_SUNRISEPOINT
tristate "Intel Sunrisepoint pinctrl and GPIO driver"
@@ -159,7 +164,11 @@ config PINCTRL_TIGERLAKE
select PINCTRL_INTEL
help
This pinctrl driver provides an interface that allows configuring
- of Intel Tiger Lake PCH pins and using them as GPIOs.
+ PCH pins of the following platforms and using them as GPIOs:
+ - Alder Lake H, P, PS, and U
+ - Raptor Lake H, P, PS, PX, and U
+ - Rocket Lake S
+ - Tiger Lake (all variants)
source "drivers/pinctrl/intel/Kconfig.tng"
endmenu
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 616/752] xfs: only call xf{array,blob}_destroy if we have a valid pointer
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (156 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 615/752] pinctrl: intel: Add code name documentation Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 617/752] xfs: check return value of xchk_scrub_create_subord Sasha Levin
` (126 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, r772577952, stable, Christoph Hellwig,
Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit ba408d299a3bb3c5309f40c5326e4fb83ead4247 ]
Only call the xfarray and xfblob destructor if we have a valid pointer,
and be sure to null out that pointer afterwards. Note that this patch
fixes a large number of commits, most of which were merged between 6.9
and 6.10.
Cc: r772577952@gmail.com
Cc: <stable@vger.kernel.org> # v6.12
Fixes: ab97f4b1c03075 ("xfs: repair AGI unlinked inode bucket lists")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jiaming Zhang <r772577952@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
| 8 ++++++--
fs/xfs/scrub/attr_repair.c | 6 ++++--
fs/xfs/scrub/dir_repair.c | 8 ++++++--
fs/xfs/scrub/dirtree.c | 8 ++++++--
fs/xfs/scrub/nlinks.c | 3 ++-
5 files changed, 24 insertions(+), 9 deletions(-)
--git a/fs/xfs/scrub/agheader_repair.c b/fs/xfs/scrub/agheader_repair.c
index a2f6a7f71d839..6e3fef36d6614 100644
--- a/fs/xfs/scrub/agheader_repair.c
+++ b/fs/xfs/scrub/agheader_repair.c
@@ -837,8 +837,12 @@ xrep_agi_buf_cleanup(
{
struct xrep_agi *ragi = buf;
- xfarray_destroy(ragi->iunlink_prev);
- xfarray_destroy(ragi->iunlink_next);
+ if (ragi->iunlink_prev)
+ xfarray_destroy(ragi->iunlink_prev);
+ ragi->iunlink_prev = NULL;
+ if (ragi->iunlink_next)
+ xfarray_destroy(ragi->iunlink_next);
+ ragi->iunlink_next = NULL;
xagino_bitmap_destroy(&ragi->iunlink_bmp);
}
diff --git a/fs/xfs/scrub/attr_repair.c b/fs/xfs/scrub/attr_repair.c
index eded354dec11e..dd24044c44efd 100644
--- a/fs/xfs/scrub/attr_repair.c
+++ b/fs/xfs/scrub/attr_repair.c
@@ -1516,8 +1516,10 @@ xrep_xattr_teardown(
xfblob_destroy(rx->pptr_names);
if (rx->pptr_recs)
xfarray_destroy(rx->pptr_recs);
- xfblob_destroy(rx->xattr_blobs);
- xfarray_destroy(rx->xattr_records);
+ if (rx->xattr_blobs)
+ xfblob_destroy(rx->xattr_blobs);
+ if (rx->xattr_records)
+ xfarray_destroy(rx->xattr_records);
mutex_destroy(&rx->lock);
kfree(rx);
}
diff --git a/fs/xfs/scrub/dir_repair.c b/fs/xfs/scrub/dir_repair.c
index 7a21b688a4715..d5a55eabf6801 100644
--- a/fs/xfs/scrub/dir_repair.c
+++ b/fs/xfs/scrub/dir_repair.c
@@ -172,8 +172,12 @@ xrep_dir_teardown(
struct xrep_dir *rd = sc->buf;
xrep_findparent_scan_teardown(&rd->pscan);
- xfblob_destroy(rd->dir_names);
- xfarray_destroy(rd->dir_entries);
+ if (rd->dir_names)
+ xfblob_destroy(rd->dir_names);
+ rd->dir_names = NULL;
+ if (rd->dir_entries)
+ xfarray_destroy(rd->dir_entries);
+ rd->dir_names = NULL;
}
/* Set up for a directory repair. */
diff --git a/fs/xfs/scrub/dirtree.c b/fs/xfs/scrub/dirtree.c
index f9c85b8b194fa..3e0bbe75c44cf 100644
--- a/fs/xfs/scrub/dirtree.c
+++ b/fs/xfs/scrub/dirtree.c
@@ -81,8 +81,12 @@ xchk_dirtree_buf_cleanup(
kfree(path);
}
- xfblob_destroy(dl->path_names);
- xfarray_destroy(dl->path_steps);
+ if (dl->path_names)
+ xfblob_destroy(dl->path_names);
+ dl->path_names = NULL;
+ if (dl->path_steps)
+ xfarray_destroy(dl->path_steps);
+ dl->path_steps = NULL;
mutex_destroy(&dl->lock);
}
diff --git a/fs/xfs/scrub/nlinks.c b/fs/xfs/scrub/nlinks.c
index 2ba686e4de8bc..dec3b9b47453e 100644
--- a/fs/xfs/scrub/nlinks.c
+++ b/fs/xfs/scrub/nlinks.c
@@ -971,7 +971,8 @@ xchk_nlinks_teardown_scan(
xfs_dir_hook_del(xnc->sc->mp, &xnc->dhook);
- xfarray_destroy(xnc->nlinks);
+ if (xnc->nlinks)
+ xfarray_destroy(xnc->nlinks);
xnc->nlinks = NULL;
xchk_iscan_teardown(&xnc->collect_iscan);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 617/752] xfs: check return value of xchk_scrub_create_subord
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (157 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 616/752] xfs: only call xf{array,blob}_destroy if we have a valid pointer Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 618/752] xfs: check for deleted cursors when revalidating two btrees Sasha Levin
` (125 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, r772577952, stable, Christoph Hellwig,
Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit ca27313fb3f23e4ac18532ede4ec1c7cc5814c4a ]
Fix this function to return NULL instead of a mangled ENOMEM, then fix
the callers to actually check for a null pointer and return ENOMEM.
Most of the corrections here are for code merged between 6.2 and 6.10.
Cc: r772577952@gmail.com
Cc: <stable@vger.kernel.org> # v6.12
Fixes: 1a5f6e08d4e379 ("xfs: create subordinate scrub contexts for xchk_metadata_inode_subtype")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jiaming Zhang <r772577952@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/scrub/common.c | 3 +++
fs/xfs/scrub/repair.c | 3 +++
fs/xfs/scrub/scrub.c | 2 +-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/fs/xfs/scrub/common.c b/fs/xfs/scrub/common.c
index e6145c2eda02a..975c879c8d7f5 100644
--- a/fs/xfs/scrub/common.c
+++ b/fs/xfs/scrub/common.c
@@ -1399,6 +1399,9 @@ xchk_metadata_inode_subtype(
int error;
sub = xchk_scrub_create_subord(sc, scrub_type);
+ if (!sub)
+ return -ENOMEM;
+
error = sub->sc.ops->scrub(&sub->sc);
xchk_scrub_free_subord(sub);
return error;
diff --git a/fs/xfs/scrub/repair.c b/fs/xfs/scrub/repair.c
index efd5a7ccdf624..4d45d39e67f11 100644
--- a/fs/xfs/scrub/repair.c
+++ b/fs/xfs/scrub/repair.c
@@ -1136,6 +1136,9 @@ xrep_metadata_inode_subtype(
* setup/teardown routines.
*/
sub = xchk_scrub_create_subord(sc, scrub_type);
+ if (!sub)
+ return -ENOMEM;
+
error = sub->sc.ops->scrub(&sub->sc);
if (error)
goto out;
diff --git a/fs/xfs/scrub/scrub.c b/fs/xfs/scrub/scrub.c
index 3c3b0d25006ff..c312f0a672e65 100644
--- a/fs/xfs/scrub/scrub.c
+++ b/fs/xfs/scrub/scrub.c
@@ -634,7 +634,7 @@ xchk_scrub_create_subord(
sub = kzalloc(sizeof(*sub), XCHK_GFP_FLAGS);
if (!sub)
- return ERR_PTR(-ENOMEM);
+ return NULL;
sub->old_smtype = sc->sm->sm_type;
sub->old_smflags = sc->sm->sm_flags;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 618/752] xfs: check for deleted cursors when revalidating two btrees
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (158 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 617/752] xfs: check return value of xchk_scrub_create_subord Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 619/752] md/bitmap: fix GPF in write_page caused by resize race Sasha Levin
` (124 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Darrick J. Wong, r772577952, stable, Christoph Hellwig,
Sasha Levin
From: "Darrick J. Wong" <djwong@kernel.org>
[ Upstream commit 55e03b8cbe2783ec9acfb88e8adb946ed504e117 ]
The free space and inode btree repair functions will rebuild both btrees
at the same time, after which it needs to evaluate both btrees to
confirm that the corruptions are gone.
However, Jiaming Zhang ran syzbot and produced a crash in the second
xchk_allocbt call. His root-cause analysis is as follows (with minor
corrections):
In xrep_revalidate_allocbt(), xchk_allocbt() is called twice (first
for BNOBT, second for CNTBT). The cause of this issue is that the
first call nullified the cursor required by the second call.
Let's first enter xrep_revalidate_allocbt() via following call chain:
xfs_file_ioctl() ->
xfs_ioc_scrubv_metadata() ->
xfs_scrub_metadata() ->
`sc->ops->repair_eval(sc)` ->
xrep_revalidate_allocbt()
xchk_allocbt() is called twice in this function. In the first call:
/* Note that sc->sm->sm_type is XFS_SCRUB_TYPE_BNOPT now */
xchk_allocbt() ->
xchk_btree() ->
`bs->scrub_rec(bs, recp)` ->
xchk_allocbt_rec() ->
xchk_allocbt_xref() ->
xchk_allocbt_xref_other()
since sm_type is XFS_SCRUB_TYPE_BNOBT, pur is set to &sc->sa.cnt_cur.
Kernel called xfs_alloc_get_rec() and returned -EFSCORRUPTED. Call
chain:
xfs_alloc_get_rec() ->
xfs_btree_get_rec() ->
xfs_btree_check_block() ->
(XFS_IS_CORRUPT || XFS_TEST_ERROR), the former is false and the latter
is true, return -EFSCORRUPTED. This should be caused by
ioctl$XFS_IOC_ERROR_INJECTION I guess.
Back to xchk_allocbt_xref_other(), after receiving -EFSCORRUPTED from
xfs_alloc_get_rec(), kernel called xchk_should_check_xref(). In this
function, *curpp (points to sc->sa.cnt_cur) is nullified.
Back to xrep_revalidate_allocbt(), since sc->sa.cnt_cur has been
nullified, it then triggered null-ptr-deref via xchk_allocbt() (second
call) -> xchk_btree().
So. The bnobt revalidation failed on a cross-reference attempt, so we
deleted the cntbt cursor, and then crashed when we tried to revalidate
the cntbt. Therefore, check for a null cntbt cursor before that
revalidation, and mark the repair incomplete. Also we can ignore the
second tree entirely if the first tree was rebuilt but is already
corrupt.
Apply the same fix to xrep_revalidate_iallocbt because it has the same
problem.
Cc: r772577952@gmail.com
Link: https://lore.kernel.org/linux-xfs/CANypQFYU5rRPkTy=iG5m1Lp4RWasSgrHXAh3p8YJojxV0X15dQ@mail.gmail.com/T/#m520c7835fad637eccf843c7936c200589427cc7e
Cc: <stable@vger.kernel.org> # v6.8
Fixes: dbfbf3bdf639a2 ("xfs: repair inode btrees")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Tested-by: Jiaming Zhang <r772577952@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/xfs/scrub/alloc_repair.c | 15 +++++++++++++++
fs/xfs/scrub/ialloc_repair.c | 20 +++++++++++++++++---
2 files changed, 32 insertions(+), 3 deletions(-)
diff --git a/fs/xfs/scrub/alloc_repair.c b/fs/xfs/scrub/alloc_repair.c
index b6fe1f23819eb..35035d02a2316 100644
--- a/fs/xfs/scrub/alloc_repair.c
+++ b/fs/xfs/scrub/alloc_repair.c
@@ -923,7 +923,22 @@ xrep_revalidate_allocbt(
if (error)
goto out;
+ /*
+ * If the bnobt is still corrupt, we've failed to repair the filesystem
+ * and should just bail out.
+ *
+ * If the bnobt fails cross-examination with the cntbt, the scan will
+ * free the cntbt cursor, so we need to mark the repair incomplete
+ * and avoid walking off the end of the NULL cntbt cursor.
+ */
+ if (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT)
+ goto out;
+
sc->sm->sm_type = XFS_SCRUB_TYPE_CNTBT;
+ if (!sc->sa.cnt_cur) {
+ xchk_set_incomplete(sc);
+ goto out;
+ }
error = xchk_allocbt(sc);
out:
sc->sm->sm_type = old_type;
diff --git a/fs/xfs/scrub/ialloc_repair.c b/fs/xfs/scrub/ialloc_repair.c
index b1d00167d263f..f28459f58832f 100644
--- a/fs/xfs/scrub/ialloc_repair.c
+++ b/fs/xfs/scrub/ialloc_repair.c
@@ -863,10 +863,24 @@ xrep_revalidate_iallocbt(
if (error)
goto out;
- if (xfs_has_finobt(sc->mp)) {
- sc->sm->sm_type = XFS_SCRUB_TYPE_FINOBT;
- error = xchk_iallocbt(sc);
+ /*
+ * If the inobt is still corrupt, we've failed to repair the filesystem
+ * and should just bail out.
+ *
+ * If the inobt fails cross-examination with the finobt, the scan will
+ * free the finobt cursor, so we need to mark the repair incomplete
+ * and avoid walking off the end of the NULL finobt cursor.
+ */
+ if (!xfs_has_finobt(sc->mp) ||
+ (sc->sm->sm_flags & XFS_SCRUB_OFLAG_CORRUPT))
+ goto out;
+
+ sc->sm->sm_type = XFS_SCRUB_TYPE_FINOBT;
+ if (!sc->sa.fino_cur) {
+ xchk_set_incomplete(sc);
+ goto out;
}
+ error = xchk_iallocbt(sc);
out:
sc->sm->sm_type = old_type;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 619/752] md/bitmap: fix GPF in write_page caused by resize race
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (159 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 618/752] xfs: check for deleted cursors when revalidating two btrees Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 620/752] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation Sasha Levin
` (123 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Jack Wang, stable, Yu Kuai, Sasha Levin
From: Jack Wang <jinpu.wang@ionos.com>
[ Upstream commit 46ef85f854dfa9d5226b3c1c46493d79556c9589 ]
A General Protection Fault occurs in write_page() during array resize:
RIP: 0010:write_page+0x22b/0x3c0 [md_mod]
This is a use-after-free race between bitmap_daemon_work() and
__bitmap_resize(). The daemon iterates over `bitmap->storage.filemap`
without locking, while the resize path frees that storage via
md_bitmap_file_unmap(). `quiesce()` does not stop the md thread,
allowing concurrent access to freed pages.
Fix by holding `mddev->bitmap_info.mutex` during the bitmap update.
Link: https://lore.kernel.org/linux-raid/20260120102456.25169-1-jinpu.wang@ionos.com
Closes: https://lore.kernel.org/linux-raid/CAMGffE=Mbfp=7xD_hYxXk1PAaCZNSEAVeQGKGy7YF9f2S4=NEA@mail.gmail.com/T/#u
Cc: stable@vger.kernel.org
Fixes: d60b479d177a ("md/bitmap: add bitmap_resize function to allow bitmap resizing.")
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Yu Kuai <yukuai@fnnas.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/md-bitmap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
index 84b7e2af6dbaa..7bb56d0491a2f 100644
--- a/drivers/md/md-bitmap.c
+++ b/drivers/md/md-bitmap.c
@@ -2453,6 +2453,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks,
memcpy(page_address(store.sb_page),
page_address(bitmap->storage.sb_page),
sizeof(bitmap_super_t));
+ mutex_lock(&bitmap->mddev->bitmap_info.mutex);
spin_lock_irq(&bitmap->counts.lock);
md_bitmap_file_unmap(&bitmap->storage);
bitmap->storage = store;
@@ -2560,7 +2561,7 @@ static int __bitmap_resize(struct bitmap *bitmap, sector_t blocks,
set_page_attr(bitmap, i, BITMAP_PAGE_DIRTY);
}
spin_unlock_irq(&bitmap->counts.lock);
-
+ mutex_unlock(&bitmap->mddev->bitmap_info.mutex);
if (!init) {
__bitmap_unplug(bitmap);
bitmap->mddev->pers->quiesce(bitmap->mddev, 0);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 620/752] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (160 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 619/752] md/bitmap: fix GPF in write_page caused by resize race Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 621/752] nfsd: fix return error code for nfsd_map_name_to_[ug]id Sasha Levin
` (122 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Olga Kornievskaia, stable, Jeff Layton, Chuck Lever, Sasha Levin
From: Olga Kornievskaia <okorniev@redhat.com>
[ Upstream commit 41b0a87bc60d5ccfa8575481ddb4d4d8758507fa ]
fstests generic/215 and generic/407 were failing because the server
wasn't updating mtime properly. When deleg attribute support is not
compiled in and thus no attribute delegation was given, the server
was skipping updating mtime and ctime because FMODE_NOCMTIME was
uncoditionally set for the write delegation.
Fixes: e5e9b24ab8fa ("nfsd: freeze c/mtime updates with outstanding WRITE_ATTRS delegation")
Cc: stable@vger.kernel.org
Signed-off-by: Olga Kornievskaia <okorniev@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfsd/nfs4state.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 740c40eb5b366..c5dba49c90356 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -6356,7 +6356,8 @@ nfs4_open_delegation(struct svc_rqst *rqstp, struct nfsd4_open *open,
dp->dl_ctime = stat.ctime;
dp->dl_mtime = stat.mtime;
spin_lock(&f->f_lock);
- f->f_mode |= FMODE_NOCMTIME;
+ if (deleg_ts)
+ f->f_mode |= FMODE_NOCMTIME;
spin_unlock(&f->f_lock);
trace_nfsd_deleg_write(&dp->dl_stid.sc_stateid);
} else {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 621/752] nfsd: fix return error code for nfsd_map_name_to_[ug]id
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (161 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 620/752] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 622/752] nvmem: Drop OF node reference on nvmem_add_one_cell() failure Sasha Levin
` (121 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Anthony Iliopoulos, stable, NeilBrown, Chuck Lever, Sasha Levin
From: Anthony Iliopoulos <ailiop@suse.com>
[ Upstream commit 404d779466646bf1461f2090ff137e99acaecf42 ]
idmap lookups can time out while the cache is waiting for a userspace
upcall reply. In that case cache_check() returns -ETIMEDOUT to callers.
The nfsd_map_name_to_[ug]id functions currently proceed with attempting
to map the id to a kuid despite a potentially temporary failure to
perform the idmap lookup. This results in the code returning the error
NFSERR_BADOWNER which can cause client operations to return to userspace
with failure.
Fix this by returning the failure status before attempting kuid mapping.
This will return NFSERR_JUKEBOX on idmap lookup timeout so that clients
can retry the operation instead of aborting it.
Fixes: 65e10f6d0ab0 ("nfsd: Convert idmap to use kuids and kgids")
Cc: stable@vger.kernel.org
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/nfsd/nfs4idmap.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c
index b5b3d45979c9b..c319c31b0f647 100644
--- a/fs/nfsd/nfs4idmap.c
+++ b/fs/nfsd/nfs4idmap.c
@@ -672,6 +672,8 @@ __be32 nfsd_map_name_to_uid(struct svc_rqst *rqstp, const char *name,
return nfserr_inval;
status = do_name_to_id(rqstp, IDMAP_TYPE_USER, name, namelen, &id);
+ if (status)
+ return status;
*uid = make_kuid(nfsd_user_namespace(rqstp), id);
if (!uid_valid(*uid))
status = nfserr_badowner;
@@ -707,6 +709,8 @@ __be32 nfsd_map_name_to_gid(struct svc_rqst *rqstp, const char *name,
return nfserr_inval;
status = do_name_to_id(rqstp, IDMAP_TYPE_GROUP, name, namelen, &id);
+ if (status)
+ return status;
*gid = make_kgid(nfsd_user_namespace(rqstp), id);
if (!gid_valid(*gid))
status = nfserr_badowner;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 622/752] nvmem: Drop OF node reference on nvmem_add_one_cell() failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (162 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 621/752] nfsd: fix return error code for nfsd_map_name_to_[ug]id Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 623/752] PCI: Fix bridge window alignment with optional resources Sasha Levin
` (120 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Krzysztof Kozlowski, stable, Srinivas Kandagatla,
Greg Kroah-Hartman, Sasha Levin
From: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
[ Upstream commit f397bc0781553d01b4cdba506c09334a31cb0ec5 ]
If nvmem_add_one_cell() failed, the ownership of "child" (or "info.np"),
thus its OF reference, is not passed further and function should clean
up by putting the reference it got via earlier of_node_get(). Note that
this is independent of references obtained via for_each_child_of_node()
loop.
Fixes: 50014d659617 ("nvmem: core: use nvmem_add_one_cell() in nvmem_add_cells_from_of()")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Srinivas Kandagatla <srini@kernel.org>
Link: https://patch.msgid.link/20260116170846.733558-2-srini@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/nvmem/core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c
index 387c88c552595..ff68fd5ad3d6f 100644
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -831,6 +831,7 @@ static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_nod
kfree(info.name);
if (ret) {
of_node_put(child);
+ of_node_put(info.np);
return ret;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 623/752] PCI: Fix bridge window alignment with optional resources
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (163 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 622/752] nvmem: Drop OF node reference on nvmem_add_one_cell() failure Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 624/752] ima: verify the previous kernel's IMA buffer lies in addressable RAM Sasha Levin
` (119 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Ilpo Järvinen, Malte Schröder, Bjorn Helgaas, stable,
Sasha Levin
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit 7e90360e6d4599795b6f4e094e20d0bdf3b2615f ]
pbus_size_mem() has two alignments, one for required resources in min_align
and another in add_align that takes account optional resources.
The add_align is applied to the bridge window through the realloc_head
list. It can happen, however, that add_align is larger than min_align but
calculated size1 and size0 are equal due to extra tailroom (e.g., hotplug
reservation, tail alignment), and therefore no entry is created to the
realloc_head list. Without the bridge appearing in the realloc head,
add_align is lost when pbus_size_mem() returns.
The problem is visible in this log for 0000:05:00.0 which lacks
add_size ... add_align ... line that would indicate it was added into
the realloc_head list:
pci 0000:05:00.0: PCI bridge to [bus 06-16]
...
pci 0000:06:00.0: bridge window [mem 0x00100000-0x001fffff] to [bus 07] requires relaxed alignment rules
pci 0000:06:06.0: bridge window [mem 0x00100000-0x001fffff] to [bus 0a] requires relaxed alignment rules
pci 0000:06:07.0: bridge window [mem 0x00100000-0x003fffff] to [bus 0b] requires relaxed alignment rules
pci 0000:06:08.0: bridge window [mem 0x00800000-0x00ffffff 64bit pref] to [bus 0c-14] requires relaxed alignment rules
pci 0000:06:08.0: bridge window [mem 0x01000000-0x057fffff] to [bus 0c-14] requires relaxed alignment rules
pci 0000:06:08.0: bridge window [mem 0x01000000-0x057fffff] to [bus 0c-14] requires relaxed alignment rules
pci 0000:06:08.0: bridge window [mem 0x01000000-0x057fffff] to [bus 0c-14] add_size 100000 add_align 1000000
pci 0000:06:0c.0: bridge window [mem 0x00100000-0x001fffff] to [bus 15] requires relaxed alignment rules
pci 0000:06:0d.0: bridge window [mem 0x00100000-0x001fffff] to [bus 16] requires relaxed alignment rules
pci 0000:06:0d.0: bridge window [mem 0x00100000-0x001fffff] to [bus 16] requires relaxed alignment rules
pci 0000:05:00.0: bridge window [mem 0xd4800000-0xd97fffff]: assigned
pci 0000:05:00.0: bridge window [mem 0x1060000000-0x10607fffff 64bit pref]: assigned
pci 0000:06:08.0: bridge window [mem size 0x04900000]: can't assign; no space
pci 0000:06:08.0: bridge window [mem size 0x04900000]: failed to assign
While this bug itself seems old, it has likely become more visible after
the relaxed tail alignment that does not grossly overestimate the size
needed for the bridge window.
Make sure add_align > min_align too results in adding an entry into the
realloc head list. In addition, add handling to the cases where add_size is
zero while only alignment differs.
Fixes: d74b9027a4da ("PCI: Consider additional PF's IOV BAR alignment in sizing and assigning")
Reported-by: Malte Schröder <malte+lkml@tnxip.de>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Malte Schröder <malte+lkml@tnxip.de>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251219174036.16738-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/setup-bus.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index cc592ccff5424..5d15298469cbc 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -14,6 +14,7 @@
* tighter packing. Prefetchable range support.
*/
+#include <linux/align.h>
#include <linux/bitops.h>
#include <linux/init.h>
#include <linux/kernel.h>
@@ -459,7 +460,7 @@ static void reassign_resources_sorted(struct list_head *realloc_head,
"%s %pR: ignoring failure in optional allocation\n",
res_name, res);
}
- } else if (add_size > 0) {
+ } else if (add_size > 0 || !IS_ALIGNED(res->start, align)) {
res->flags |= add_res->flags &
(IORESOURCE_STARTALIGN|IORESOURCE_SIZEALIGN);
if (pci_reassign_resource(dev, idx, add_size, align))
@@ -1388,12 +1389,13 @@ static void pbus_size_mem(struct pci_bus *bus, unsigned long type,
resource_set_range(b_res, min_align, size0);
b_res->flags |= IORESOURCE_STARTALIGN;
- if (bus->self && size1 > size0 && realloc_head) {
+ if (bus->self && realloc_head && (size1 > size0 || add_align > min_align)) {
b_res->flags &= ~IORESOURCE_DISABLED;
- add_to_list(realloc_head, bus->self, b_res, size1-size0, add_align);
+ add_size = size1 > size0 ? size1 - size0 : 0;
+ add_to_list(realloc_head, bus->self, b_res, add_size, add_align);
pci_info(bus->self, "bridge window %pR to %pR add_size %llx add_align %llx\n",
b_res, &bus->busn_res,
- (unsigned long long) (size1 - size0),
+ (unsigned long long) add_size,
(unsigned long long) add_align);
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 624/752] ima: verify the previous kernel's IMA buffer lies in addressable RAM
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (164 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 623/752] PCI: Fix bridge window alignment with optional resources Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 625/752] of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range() Sasha Levin
` (118 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Harshit Mogalapalli, Mimi Zohar, Alexander Graf, Ard Biesheuvel,
Borislav Betkov, guoweikang, Henry Willard, H. Peter Anvin,
Ingo Molnar, Jiri Bohac, Joel Granados, Jonathan McDowell,
Mike Rapoport, Paul Webb, Sohil Mehta, Sourabh Jain,
Thomas Gleinxer, Yifei Liu, Baoquan He, stable, Andrew Morton,
Sasha Levin
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
[ Upstream commit 10d1c75ed4382a8e79874379caa2ead8952734f9 ]
Patch series "Address page fault in ima_restore_measurement_list()", v3.
When the second-stage kernel is booted via kexec with a limiting command
line such as "mem=<size>" we observe a pafe fault that happens.
BUG: unable to handle page fault for address: ffff97793ff47000
RIP: ima_restore_measurement_list+0xdc/0x45a
#PF: error_code(0x0000) not-present page
This happens on x86_64 only, as this is already fixed in aarch64 in
commit: cbf9c4b9617b ("of: check previous kernel's ima-kexec-buffer
against memory bounds")
This patch (of 3):
When the second-stage kernel is booted with a limiting command line (e.g.
"mem=<size>"), the IMA measurement buffer handed over from the previous
kernel may fall outside the addressable RAM of the new kernel. Accessing
such a buffer can fault during early restore.
Introduce a small generic helper, ima_validate_range(), which verifies
that a physical [start, end] range for the previous-kernel IMA buffer lies
within addressable memory:
- On x86, use pfn_range_is_mapped().
- On OF based architectures, use page_is_ram().
Link: https://lkml.kernel.org/r/20251231061609.907170-1-harshit.m.mogalapalli@oracle.com
Link: https://lkml.kernel.org/r/20251231061609.907170-2-harshit.m.mogalapalli@oracle.com
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Borislav Betkov <bp@alien8.de>
Cc: guoweikang <guoweikang.kernel@gmail.com>
Cc: Henry Willard <henry.willard@oracle.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Joel Granados <joel.granados@kernel.org>
Cc: Jonathan McDowell <noodles@fb.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Paul Webb <paul.x.webb@oracle.com>
Cc: Sohil Mehta <sohil.mehta@intel.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Yifei Liu <yifei.l.liu@oracle.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/ima.h | 1 +
security/integrity/ima/ima_kexec.c | 35 ++++++++++++++++++++++++++++++
2 files changed, 36 insertions(+)
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 8e29cb4e6a01d..abf8923f8fc51 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -69,6 +69,7 @@ static inline int ima_measure_critical_data(const char *event_label,
#ifdef CONFIG_HAVE_IMA_KEXEC
int __init ima_free_kexec_buffer(void);
int __init ima_get_kexec_buffer(void **addr, size_t *size);
+int ima_validate_range(phys_addr_t phys, size_t size);
#endif
#ifdef CONFIG_IMA_SECURE_AND_OR_TRUSTED_BOOT
diff --git a/security/integrity/ima/ima_kexec.c b/security/integrity/ima/ima_kexec.c
index 5beb69edd12fd..36a34c54de58b 100644
--- a/security/integrity/ima/ima_kexec.c
+++ b/security/integrity/ima/ima_kexec.c
@@ -12,6 +12,8 @@
#include <linux/kexec.h>
#include <linux/of.h>
#include <linux/ima.h>
+#include <linux/mm.h>
+#include <linux/overflow.h>
#include <linux/reboot.h>
#include <asm/page.h>
#include "ima.h"
@@ -294,3 +296,36 @@ void __init ima_load_kexec_buffer(void)
pr_debug("Error restoring the measurement list: %d\n", rc);
}
}
+
+/*
+ * ima_validate_range - verify a physical buffer lies in addressable RAM
+ * @phys: physical start address of the buffer from previous kernel
+ * @size: size of the buffer
+ *
+ * On success return 0. On failure returns -EINVAL so callers can skip
+ * restoring.
+ */
+int ima_validate_range(phys_addr_t phys, size_t size)
+{
+ unsigned long start_pfn, end_pfn;
+ phys_addr_t end_phys;
+
+ if (check_add_overflow(phys, (phys_addr_t)size - 1, &end_phys))
+ return -EINVAL;
+
+ start_pfn = PHYS_PFN(phys);
+ end_pfn = PHYS_PFN(end_phys);
+
+#ifdef CONFIG_X86
+ if (!pfn_range_is_mapped(start_pfn, end_pfn))
+#else
+ if (!page_is_ram(start_pfn) || !page_is_ram(end_pfn))
+#endif
+ {
+ pr_warn("IMA: previous kernel measurement buffer %pa (size 0x%zx) lies outside available memory\n",
+ &phys, size);
+ return -EINVAL;
+ }
+
+ return 0;
+}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 625/752] of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (165 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 624/752] ima: verify the previous kernel's IMA buffer lies in addressable RAM Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 626/752] x86/kexec: add a sanity check on previous kernel's ima kexec buffer Sasha Levin
` (117 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Harshit Mogalapalli, Mimi Zohar, Alexander Graf, Ard Biesheuvel,
Baoquan He, Borislav Betkov, guoweikang, Henry Willard,
H. Peter Anvin, Ingo Molnar, Jiri Bohac, Joel Granados,
Jonathan McDowell, Mike Rapoport, Paul Webb, Sohil Mehta,
Sourabh Jain, Thomas Gleinxer, Yifei Liu, stable, Andrew Morton,
Sasha Levin
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
[ Upstream commit 4d02233235ed0450de9c10fcdcf3484e3c9401ce ]
Refactor the OF/DT ima_get_kexec_buffer() to use a generic helper to
validate the address range. No functional change intended.
Link: https://lkml.kernel.org/r/20251231061609.907170-3-harshit.m.mogalapalli@oracle.com
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Betkov <bp@alien8.de>
Cc: guoweikang <guoweikang.kernel@gmail.com>
Cc: Henry Willard <henry.willard@oracle.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Joel Granados <joel.granados@kernel.org>
Cc: Jonathan McDowell <noodles@fb.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Paul Webb <paul.x.webb@oracle.com>
Cc: Sohil Mehta <sohil.mehta@intel.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Yifei Liu <yifei.l.liu@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/of/kexec.c | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/drivers/of/kexec.c b/drivers/of/kexec.c
index 1ee2d31816aeb..c4cf3552c0183 100644
--- a/drivers/of/kexec.c
+++ b/drivers/of/kexec.c
@@ -128,7 +128,6 @@ int __init ima_get_kexec_buffer(void **addr, size_t *size)
{
int ret, len;
unsigned long tmp_addr;
- unsigned long start_pfn, end_pfn;
size_t tmp_size;
const void *prop;
@@ -144,17 +143,9 @@ int __init ima_get_kexec_buffer(void **addr, size_t *size)
if (!tmp_size)
return -ENOENT;
- /*
- * Calculate the PFNs for the buffer and ensure
- * they are with in addressable memory.
- */
- start_pfn = PHYS_PFN(tmp_addr);
- end_pfn = PHYS_PFN(tmp_addr + tmp_size - 1);
- if (!page_is_ram(start_pfn) || !page_is_ram(end_pfn)) {
- pr_warn("IMA buffer at 0x%lx, size = 0x%zx beyond memory\n",
- tmp_addr, tmp_size);
- return -EINVAL;
- }
+ ret = ima_validate_range(tmp_addr, tmp_size);
+ if (ret)
+ return ret;
*addr = __va(tmp_addr);
*size = tmp_size;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 626/752] x86/kexec: add a sanity check on previous kernel's ima kexec buffer
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (166 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 625/752] of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range() Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 627/752] mm/vmalloc: prevent RCU stalls in kasan_release_vmalloc_node Sasha Levin
` (116 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Harshit Mogalapalli, Paul Webb, Mimi Zohar, Alexander Graf,
Ard Biesheuvel, Baoquan He, Borislav Betkov, guoweikang,
Henry Willard, H. Peter Anvin, Ingo Molnar, Jiri Bohac,
Joel Granados, Jonathan McDowell, Mike Rapoport, Sohil Mehta,
Sourabh Jain, Thomas Gleinxer, Yifei Liu, stable, Andrew Morton,
Sasha Levin
From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
[ Upstream commit c5489d04337b47e93c0623e8145fcba3f5739efd ]
When the second-stage kernel is booted via kexec with a limiting command
line such as "mem=<size>", the physical range that contains the carried
over IMA measurement list may fall outside the truncated RAM leading to a
kernel panic.
BUG: unable to handle page fault for address: ffff97793ff47000
RIP: ima_restore_measurement_list+0xdc/0x45a
#PF: error_code(0x0000) – not-present page
Other architectures already validate the range with page_is_ram(), as done
in commit cbf9c4b9617b ("of: check previous kernel's ima-kexec-buffer
against memory bounds") do a similar check on x86.
Without carrying the measurement list across kexec, the attestation
would fail.
Link: https://lkml.kernel.org/r/20251231061609.907170-4-harshit.m.mogalapalli@oracle.com
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Fixes: b69a2afd5afc ("x86/kexec: Carry forward IMA measurement log on kexec")
Reported-by: Paul Webb <paul.x.webb@oracle.com>
Reviewed-by: Mimi Zohar <zohar@linux.ibm.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Baoquan He <bhe@redhat.com>
Cc: Borislav Betkov <bp@alien8.de>
Cc: guoweikang <guoweikang.kernel@gmail.com>
Cc: Henry Willard <henry.willard@oracle.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Bohac <jbohac@suse.cz>
Cc: Joel Granados <joel.granados@kernel.org>
Cc: Jonathan McDowell <noodles@fb.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Sohil Mehta <sohil.mehta@intel.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Thomas Gleinxer <tglx@linutronix.de>
Cc: Yifei Liu <yifei.l.liu@oracle.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/setup.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 1b2edd07a3e17..383d4a4784f5b 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -439,9 +439,15 @@ int __init ima_free_kexec_buffer(void)
int __init ima_get_kexec_buffer(void **addr, size_t *size)
{
+ int ret;
+
if (!ima_kexec_buffer_size)
return -ENOENT;
+ ret = ima_validate_range(ima_kexec_buffer_phys, ima_kexec_buffer_size);
+ if (ret)
+ return ret;
+
*addr = __va(ima_kexec_buffer_phys);
*size = ima_kexec_buffer_size;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 627/752] mm/vmalloc: prevent RCU stalls in kasan_release_vmalloc_node
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (167 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 626/752] x86/kexec: add a sanity check on previous kernel's ima kexec buffer Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 629/752] mm/slab: add rcu_barrier() to kvfree_rcu_barrier_on_cache() Sasha Levin
` (115 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Deepanshu Kartikey, syzbot+d8d4c31d40f868eaea30, Uladzislau Rezki,
Hillf Danton, stable, Andrew Morton, Sasha Levin
From: Deepanshu Kartikey <kartikey406@gmail.com>
[ Upstream commit 5747435e0fd474c24530ef1a6822f47e7d264b27 ]
When CONFIG_PAGE_OWNER is enabled, freeing KASAN shadow pages during
vmalloc cleanup triggers expensive stack unwinding that acquires RCU read
locks. Processing a large purge_list without rescheduling can cause the
task to hold CPU for extended periods (10+ seconds), leading to RCU stalls
and potential OOM conditions.
The issue manifests in purge_vmap_node() -> kasan_release_vmalloc_node()
where iterating through hundreds or thousands of vmap_area entries and
freeing their associated shadow pages causes:
rcu: INFO: rcu_preempt detected stalls on CPUs/tasks:
rcu: Tasks blocked on level-0 rcu_node (CPUs 0-1): P6229/1:b..l
...
task:kworker/0:17 state:R running task stack:28840 pid:6229
...
kasan_release_vmalloc_node+0x1ba/0xad0 mm/vmalloc.c:2299
purge_vmap_node+0x1ba/0xad0 mm/vmalloc.c:2299
Each call to kasan_release_vmalloc() can free many pages, and with
page_owner tracking, each free triggers save_stack() which performs stack
unwinding under RCU read lock. Without yielding, this creates an
unbounded RCU critical section.
Add periodic cond_resched() calls within the loop to allow:
- RCU grace periods to complete
- Other tasks to run
- Scheduler to preempt when needed
The fix uses need_resched() for immediate response under load, with a
batch count of 32 as a guaranteed upper bound to prevent worst-case stalls
even under light load.
Link: https://lkml.kernel.org/r/20260112103612.627247-1-kartikey406@gmail.com
Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com>
Reported-by: syzbot+d8d4c31d40f868eaea30@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=d8d4c31d40f868eaea30
Link: https://lore.kernel.org/all/20260112084723.622910-1-kartikey406@gmail.com/T/ [v1]
Suggested-by: Uladzislau Rezki <urezki@gmail.com>
Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/vmalloc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 4fbd6e7dc479a..e2f526ad7abba 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -2241,11 +2241,14 @@ decay_va_pool_node(struct vmap_node *vn, bool full_decay)
reclaim_list_global(&decay_list);
}
+#define KASAN_RELEASE_BATCH_SIZE 32
+
static void
kasan_release_vmalloc_node(struct vmap_node *vn)
{
struct vmap_area *va;
unsigned long start, end;
+ unsigned int batch_count = 0;
start = list_first_entry(&vn->purge_list, struct vmap_area, list)->va_start;
end = list_last_entry(&vn->purge_list, struct vmap_area, list)->va_end;
@@ -2255,6 +2258,11 @@ kasan_release_vmalloc_node(struct vmap_node *vn)
kasan_release_vmalloc(va->va_start, va->va_end,
va->va_start, va->va_end,
KASAN_VMALLOC_PAGE_RANGE);
+
+ if (need_resched() || (++batch_count >= KASAN_RELEASE_BATCH_SIZE)) {
+ cond_resched();
+ batch_count = 0;
+ }
}
kasan_release_vmalloc(start, end, start, end, KASAN_VMALLOC_TLB_FLUSH);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 629/752] mm/slab: add rcu_barrier() to kvfree_rcu_barrier_on_cache()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (168 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 627/752] mm/vmalloc: prevent RCU stalls in kasan_release_vmalloc_node Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 630/752] io_uring/net: don't continue send bundle if poll was required for retry Sasha Levin
` (114 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Vlastimil Babka, kernel test robot, stable, Harry Yoo,
Suren Baghdasaryan, Liam R. Howlett, Sasha Levin
From: Vlastimil Babka <vbabka@suse.cz>
[ Upstream commit b55b423e8518361124ff0a9e15df431b3682ee4f ]
After we submit the rcu_free sheaves to call_rcu() we need to make sure
the rcu callbacks complete. kvfree_rcu_barrier() does that via
flush_all_rcu_sheaves() but kvfree_rcu_barrier_on_cache() doesn't. Fix
that.
This currently causes no issues because the caches with sheaves we have
are never destroyed. The problem flagged by kernel test robot was
reported for a patch that enables sheaves for (almost) all caches, and
occurred only with CONFIG_KASAN. Harry Yoo found the root cause [1]:
It turns out the object freed by sheaf_flush_unused() was in KASAN
percpu quarantine list (confirmed by dumping the list) by the time
__kmem_cache_shutdown() returns an error.
Quarantined objects are supposed to be flushed by kasan_cache_shutdown(),
but things go wrong if the rcu callback (rcu_free_sheaf_nobarn()) is
processed after kasan_cache_shutdown() finishes.
That's why rcu_barrier() in __kmem_cache_shutdown() didn't help,
because it's called after kasan_cache_shutdown().
Calling rcu_barrier() in kvfree_rcu_barrier_on_cache() guarantees
that it'll be added to the quarantine list before kasan_cache_shutdown()
is called. So it's a valid fix!
[1] https://lore.kernel.org/all/aWd6f3jERlrB5yeF@hyeyoo/
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202601121442.c530bed3-lkp@intel.com
Fixes: 0f35040de593 ("mm/slab: introduce kvfree_rcu_barrier_on_cache() for cache destruction")
Cc: stable@vger.kernel.org
Reviewed-by: Harry Yoo <harry.yoo@oracle.com>
Tested-by: Harry Yoo <harry.yoo@oracle.com>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/slab_common.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/mm/slab_common.c b/mm/slab_common.c
index 87bde1d8916be..0f58265ca200e 100644
--- a/mm/slab_common.c
+++ b/mm/slab_common.c
@@ -2134,8 +2134,11 @@ EXPORT_SYMBOL_GPL(kvfree_rcu_barrier);
*/
void kvfree_rcu_barrier_on_cache(struct kmem_cache *s)
{
- if (s->cpu_sheaves)
+ if (s->cpu_sheaves) {
flush_rcu_sheaves_on_cache(s);
+ rcu_barrier();
+ }
+
/*
* TODO: Introduce a version of __kvfree_rcu_barrier() that works
* on a specific slab cache.
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 630/752] io_uring/net: don't continue send bundle if poll was required for retry
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (169 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 629/752] mm/slab: add rcu_barrier() to kvfree_rcu_barrier_on_cache() Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 631/752] bus: fsl-mc: fix an error handling in fsl_mc_device_add() Sasha Levin
` (113 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Jens Axboe, stable, Sasha Levin
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit 806ae939c41e5da1d94a1e2b31f5702e96b6c3e3 ]
If a send bundle has picked a bunch of buffers, then it needs to send
all of those to be complete. This may require poll arming, if the send
buffer ends up being full. Once a send bundle has been poll armed, no
further bundles should be attempted.
This allows a current bundle to complete even though it needs to go
through polling to do so, but it will not allow another bundle to be
started once that has happened. Ideally we would abort a bundle if it
was only partially sent, but as some parts of it already went out on the
wire, this obviously isn't feasible. Not continuing more bundle attempts
post encountering a full socket buffer is the second best thing.
Cc: stable@vger.kernel.org
Fixes: a05d1f625c7a ("io_uring/net: support bundles for send")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/net.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/io_uring/net.c b/io_uring/net.c
index 43d77f95db51d..2e21a4294407b 100644
--- a/io_uring/net.c
+++ b/io_uring/net.c
@@ -516,7 +516,11 @@ static inline bool io_send_finish(struct io_kiocb *req,
cflags = io_put_kbufs(req, sel->val, sel->buf_list, io_bundle_nbufs(kmsg, sel->val));
- if (bundle_finished || req->flags & REQ_F_BL_EMPTY)
+ /*
+ * Don't start new bundles if the buffer list is empty, or if the
+ * current operation needed to go through polling to complete.
+ */
+ if (bundle_finished || req->flags & (REQ_F_BL_EMPTY | REQ_F_POLLED))
goto finish;
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 631/752] bus: fsl-mc: fix an error handling in fsl_mc_device_add()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (170 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 630/752] io_uring/net: don't continue send bundle if poll was required for retry Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 632/752] dm mpath: make pg_init_delay_msecs settable Sasha Levin
` (112 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Haoxiang Li, stable, Dan Carpenter, Su Hui,
Christophe Leroy (CS GROUP), Ioana Ciornei, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit 52f527d0916bcdd7621a0c9e7e599b133294d495 ]
In fsl_mc_device_add(), device_initialize() is called first.
put_device() should be called to drop the reference if error
occurs. And other resources would be released via put_device
-> fsl_mc_device_release. So remove redundant kfree() in
error handling path.
Fixes: bbf9d17d9875 ("staging: fsl-mc: Freescale Management Complex (fsl-mc) bus driver")
Cc: stable@vger.kernel.org
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/b767348e-d89c-416e-acea-1ebbff3bea20@stanley.mountain/
Signed-off-by: Su Hui <suhui@nfschina.com>
Suggested-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Link: https://lore.kernel.org/r/20260124102054.1613093-1-lihaoxiang@isrc.iscas.ac.cn
Signed-off-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/bus/fsl-mc/fsl-mc-bus.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c b/drivers/bus/fsl-mc/fsl-mc-bus.c
index a97baf2cbcdd5..eb7b6c0ba9e7c 100644
--- a/drivers/bus/fsl-mc/fsl-mc-bus.c
+++ b/drivers/bus/fsl-mc/fsl-mc-bus.c
@@ -909,11 +909,7 @@ int fsl_mc_device_add(struct fsl_mc_obj_desc *obj_desc,
return 0;
error_cleanup_dev:
- kfree(mc_dev->regions);
- if (mc_bus)
- kfree(mc_bus);
- else
- kfree(mc_dev);
+ put_device(&mc_dev->dev);
return error;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 632/752] dm mpath: make pg_init_delay_msecs settable
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (171 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 631/752] bus: fsl-mc: fix an error handling in fsl_mc_device_add() Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 633/752] arm64: poe: fix stale POR_EL0 values for ptrace Sasha Levin
` (111 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches; +Cc: Benjamin Marzinski, stable, Sasha Levin
From: Benjamin Marzinski <bmarzins@redhat.com>
[ Upstream commit 218b16992a37ea97b9e09b7659a25a864fb9976f ]
"pg_init_delay_msecs X" can be passed as a feature in the multipath
table and is used to set m->pg_init_delay_msecs in parse_features().
However, alloc_multipath_stage2(), which is called after
parse_features(), resets m->pg_init_delay_msecs to its default value.
Instead, set m->pg_init_delay_msecs in alloc_multipath(), which is
called before parse_features(), to avoid overwriting a value passed in
by the table.
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/md/dm-mpath.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index aaf4a0a4b0ebb..7d3fdd96f4edf 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -225,6 +225,7 @@ static struct multipath *alloc_multipath(struct dm_target *ti)
mutex_init(&m->work_mutex);
m->queue_mode = DM_TYPE_NONE;
+ m->pg_init_delay_msecs = DM_PG_INIT_DELAY_DEFAULT;
m->ti = ti;
ti->private = m;
@@ -257,7 +258,6 @@ static int alloc_multipath_stage2(struct dm_target *ti, struct multipath *m)
set_bit(MPATHF_QUEUE_IO, &m->flags);
atomic_set(&m->pg_init_in_progress, 0);
atomic_set(&m->pg_init_count, 0);
- m->pg_init_delay_msecs = DM_PG_INIT_DELAY_DEFAULT;
init_waitqueue_head(&m->pg_init_wait);
init_waitqueue_head(&m->probe_wait);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 633/752] arm64: poe: fix stale POR_EL0 values for ptrace
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (172 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 632/752] dm mpath: make pg_init_delay_msecs settable Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 634/752] tools: Fix bitfield dependency failure Sasha Levin
` (110 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Joey Gouly, David Spickett, stable, Kevin Brodsky, Mark Rutland,
Will Deacon, Sasha Levin
From: Joey Gouly <joey.gouly@arm.com>
[ Upstream commit 1f3b950492db411e6c30ee0076b61ef2694c100a ]
If a process wrote to POR_EL0 and then crashed before a context switch
happened, the coredump would contain an incorrect value for POR_EL0.
The value read in poe_get() would be a stale value left in thread.por_el0. Fix
this by reading the value from the system register, if the target thread is the
current thread.
This matches what gcs/fpsimd do.
Fixes: 175198199262 ("arm64/ptrace: add support for FEAT_POE")
Reported-by: David Spickett <david.spickett@arm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Joey Gouly <joey.gouly@arm.com>
Cc: Kevin Brodsky <kevin.brodsky@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Kevin Brodsky <kevin.brodsky@arm.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/kernel/ptrace.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c
index fd1ba43f2005a..2e9ce5a45ed2d 100644
--- a/arch/arm64/kernel/ptrace.c
+++ b/arch/arm64/kernel/ptrace.c
@@ -1458,6 +1458,9 @@ static int poe_get(struct task_struct *target,
if (!system_supports_poe())
return -EINVAL;
+ if (target == current)
+ current->thread.por_el0 = read_sysreg_s(SYS_POR_EL0);
+
return membuf_write(&to, &target->thread.por_el0,
sizeof(target->thread.por_el0));
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 634/752] tools: Fix bitfield dependency failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (173 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 633/752] arm64: poe: fix stale POR_EL0 values for ptrace Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 635/752] vhost: move vdpa group bound check to vhost_vdpa Sasha Levin
` (109 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Leo Yan, Hamza Mahfooz, Thomas Voegtle, Greg Kroah-Hartman,
Ian Rogers, James Clark, Namhyung Kim, stable,
Arnaldo Carvalho de Melo, Sasha Levin
From: Leo Yan <leo.yan@arm.com>
[ Upstream commit a537c0da168a08b0b6a7f7bd9e75f4cc8d45ff57 ]
A perf build failure was reported by Thomas Voegtle on stable kernel
v6.6.120:
CC tests/sample-parsing.o
CC util/intel-pt-decoder/intel-pt-pkt-decoder.o
CC util/perf-regs-arch/perf_regs_csky.o
CC util/arm-spe-decoder/arm-spe-pkt-decoder.o
CC util/perf-regs-arch/perf_regs_loongarch.o
In file included from util/arm-spe-decoder/arm-spe-pkt-decoder.h:10,
from util/arm-spe-decoder/arm-spe-pkt-decoder.c:14:
/local/git/linux-stable-rc/tools/include/linux/bitfield.h: In function ‘le16_encode_bits’:
/local/git/linux-stable-rc/tools/include/linux/bitfield.h:166:31: error: implicit declaration of
function ‘cpu_to_le16’; did you mean ‘htole16’? [-Werror=implicit-function-declaration]
____MAKE_OP(le##size,u##size,cpu_to_le##size,le##size##_to_cpu) \
^~~~~~~~~
/local/git/linux-stable-rc/tools/include/linux/bitfield.h:149:9: note: in definition of macro
‘____MAKE_OP’
return to((v & field_mask(field)) * field_multiplier(field)); \
^~
/local/git/linux-stable-rc/tools/include/linux/bitfield.h:170:1: note: in expansion of macro
‘__MAKE_OP’
__MAKE_OP(16)
Fix this by including linux/kernel.h, which provides the required
definitions.
The issue was not found on the mainline due to the relevant C files have
included kernel.h. It'd be good to merge this change on mainline
as well for robustness.
Closes: https://lore.kernel.org/stable/3a44500b-d7c8-179f-61f6-e51cb50d3512@lio96.de/
Fixes: 64d86c03e1441742 ("perf arm-spe: Extend branch operations")
Reported-by: Hamza Mahfooz <hamzamahfooz@linux.microsoft.com>
Reported-by: Thomas Voegtle <tv@lio96.de>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ian Rogers <irogers@google.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
To: Sasha Levin <sashal@kernel.org>
Cc: stable@vger.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
tools/include/linux/bitfield.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/include/linux/bitfield.h b/tools/include/linux/bitfield.h
index 6093fa6db2600..ddf81f24956ba 100644
--- a/tools/include/linux/bitfield.h
+++ b/tools/include/linux/bitfield.h
@@ -8,6 +8,7 @@
#define _LINUX_BITFIELD_H
#include <linux/build_bug.h>
+#include <linux/kernel.h>
#include <asm/byteorder.h>
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 635/752] vhost: move vdpa group bound check to vhost_vdpa
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (174 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 634/752] tools: Fix bitfield dependency failure Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 636/752] powerpc/smp: Add check for kcalloc() failure in parse_thread_groups() Sasha Levin
` (108 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Eugenio Pérez, stable, Jason Wang, Michael S. Tsirkin,
Sasha Levin
From: Eugenio Pérez <eperezma@redhat.com>
[ Upstream commit cd025c1e876b4e262e71398236a1550486a73ede ]
Remove duplication by consolidating these here. This reduces the
posibility of a parent driver missing them.
While we're at it, fix a bug in vdpa_sim where a valid ASID can be
assigned to a group equal to ngroups, causing an out of bound write.
Cc: stable@vger.kernel.org
Fixes: bda324fd037a ("vdpasim: control virtqueue support")
Acked-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: Eugenio Pérez <eperezma@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20260119143306.1818855-2-eperezma@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ---
drivers/vdpa/vdpa_sim/vdpa_sim.c | 6 ------
drivers/vhost/vdpa.c | 2 +-
3 files changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
index ddaa1366704bb..44062e9d68f00 100644
--- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
+++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
@@ -3640,9 +3640,6 @@ static int mlx5_set_group_asid(struct vdpa_device *vdev, u32 group,
struct mlx5_vdpa_dev *mvdev = to_mvdev(vdev);
int err = 0;
- if (group >= MLX5_VDPA_NUMVQ_GROUPS)
- return -EINVAL;
-
mvdev->mres.group2asid[group] = asid;
mutex_lock(&mvdev->mres.lock);
diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim.c b/drivers/vdpa/vdpa_sim/vdpa_sim.c
index c1c6431950e1b..df9c7ddc5d782 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim.c
@@ -606,12 +606,6 @@ static int vdpasim_set_group_asid(struct vdpa_device *vdpa, unsigned int group,
struct vhost_iotlb *iommu;
int i;
- if (group > vdpasim->dev_attr.ngroups)
- return -EINVAL;
-
- if (asid >= vdpasim->dev_attr.nas)
- return -EINVAL;
-
iommu = &vdpasim->iommu[asid];
mutex_lock(&vdpasim->mutex);
diff --git a/drivers/vhost/vdpa.c b/drivers/vhost/vdpa.c
index b0179e8567aba..7e51eec842b8c 100644
--- a/drivers/vhost/vdpa.c
+++ b/drivers/vhost/vdpa.c
@@ -680,7 +680,7 @@ static long vhost_vdpa_vring_ioctl(struct vhost_vdpa *v, unsigned int cmd,
case VHOST_VDPA_SET_GROUP_ASID:
if (copy_from_user(&s, argp, sizeof(s)))
return -EFAULT;
- if (s.num >= vdpa->nas)
+ if (idx >= vdpa->ngroups || s.num >= vdpa->nas)
return -EINVAL;
if (!ops->set_group_asid)
return -EOPNOTSUPP;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 636/752] powerpc/smp: Add check for kcalloc() failure in parse_thread_groups()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (175 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 635/752] vhost: move vdpa group bound check to vhost_vdpa Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 637/752] iio: gyro: itg3200: Fix unchecked return value in read_raw Sasha Levin
` (107 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Guangshuo Li, stable, Christophe Leroy, Madhavan Srinivasan,
Sasha Levin
From: Guangshuo Li <lgs201920130244@gmail.com>
[ Upstream commit 33c1c6d8a28a2761ac74b0380b2563cf546c2a3a ]
As kcalloc() may fail, check its return value to avoid a NULL pointer
dereference when passing it to of_property_read_u32_array().
Fixes: 790a1662d3a26 ("powerpc/smp: Parse ibm,thread-groups with multiple properties")
Cc: stable@vger.kernel.org
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20250923133235.1862108-1-lgs201920130244@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/powerpc/kernel/smp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 68edb66c2964b..0cd9c0c21af3e 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -822,6 +822,8 @@ static int parse_thread_groups(struct device_node *dn,
count = of_property_count_u32_elems(dn, "ibm,thread-groups");
thread_group_array = kcalloc(count, sizeof(u32), GFP_KERNEL);
+ if (!thread_group_array)
+ return -ENOMEM;
ret = of_property_read_u32_array(dn, "ibm,thread-groups",
thread_group_array, count);
if (ret)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 637/752] iio: gyro: itg3200: Fix unchecked return value in read_raw
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (176 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 636/752] powerpc/smp: Add check for kcalloc() failure in parse_thread_groups() Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 638/752] mtd: spinand: Disable continuous read during probe Sasha Levin
` (106 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Antoniu Miclaus, Andy Shevchenko, Stable, Jonathan Cameron,
Sasha Levin
From: Antoniu Miclaus <antoniu.miclaus@analog.com>
[ Upstream commit b79b24f578cdb2d657db23e5fafe82c7e6a36b72 ]
The return value from itg3200_read_reg_s16() is stored in ret but
never checked. The function unconditionally returns IIO_VAL_INT,
ignoring potential I2C read failures. This causes garbage data to
be returned to userspace when the read fails, with no error reported.
Add proper error checking to propagate the failure to callers.
Fixes: 9dbf091da080 ("iio: gyro: Add itg3200")
Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/iio/gyro/itg3200_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iio/gyro/itg3200_core.c b/drivers/iio/gyro/itg3200_core.c
index cd8a2dae56cd9..bfe95ec1abda9 100644
--- a/drivers/iio/gyro/itg3200_core.c
+++ b/drivers/iio/gyro/itg3200_core.c
@@ -93,6 +93,8 @@ static int itg3200_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_RAW:
reg = (u8)chan->address;
ret = itg3200_read_reg_s16(indio_dev, reg, val);
+ if (ret)
+ return ret;
return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE:
*val = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 638/752] mtd: spinand: Disable continuous read during probe
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (177 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 637/752] iio: gyro: itg3200: Fix unchecked return value in read_raw Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 639/752] power: reset: tdx-ec-poweroff: fix restart Sasha Levin
` (105 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: David LaPorte, stable, Gunnar Kudrjavets, Mikhail Kshevetskiy,
Miquel Raynal, Sasha Levin
From: David LaPorte <dalaport@amazon.com>
[ Upstream commit b4af7d194dc879353829f3c56988a68fbba1fbdd ]
Macronix serial NAND devices with continuous read support do not
clear the configuration register on soft reset and lack a hardware
reset pin. When continuous read is interrupted (e.g., during reboot),
the feature remains enabled at the device level.
With continuous read enabled, the OOB area becomes inaccessible and
all reads are instead directed to the main area. As a result, during
partition allocation as part of MTD device registration, the first two
bytes of the main area for the master block are read and indicate that
the block is bad. This process repeats for every subsequent block for
the partition.
All reads and writes that reference the BBT find no good blocks and
fail.
The only paths for recovery from this state are triggering the
continuous read feature by way of raw MTD reads or through a NAND
device power drain.
Disable continuous read explicitly during spinand probe to ensure
quiescent feature state.
Fixes: 631cfdd0520d ("mtd: spi-nand: Add continuous read support")
Cc: stable@vger.kernel.org
Signed-off-by: David LaPorte <dalaport@amazon.com>
Reviewed-by: Gunnar Kudrjavets <gunnarku@amazon.com>
Reviewed-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mtd/nand/spi/core.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index f92133b8e1a60..697877584a285 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -859,6 +859,14 @@ static void spinand_cont_read_init(struct spinand_device *spinand)
(engine_type == NAND_ECC_ENGINE_TYPE_ON_DIE ||
engine_type == NAND_ECC_ENGINE_TYPE_NONE)) {
spinand->cont_read_possible = true;
+
+ /*
+ * Ensure continuous read is disabled on probe.
+ * Some devices retain this state across soft reset,
+ * which leaves the OOB area inaccessible and results
+ * in false positive returns from spinand_isbad().
+ */
+ spinand_cont_read_enable(spinand, false);
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 639/752] power: reset: tdx-ec-poweroff: fix restart
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (178 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 638/752] mtd: spinand: Disable continuous read during probe Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 640/752] mm/highmem: fix __kmap_to_page() build error Sasha Levin
` (104 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Emanuele Ghidoli, stable, Francesco Dolcini, Sebastian Reichel,
Sasha Levin
From: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
[ Upstream commit 562357a6310f79e45844c3e980d410a1e8e02ce6 ]
During testing, restart occasionally failed on Toradex modules.
The issue was traced to an interaction between the EC-based reset/poweroff
handler and the PSCI restart handler. While the embedded controller is
resetting or powering off the module, the PSCI code may still be invoked,
triggering an I2C transaction to the PMIC. This can leave the PMIC I2C
in a frozen state.
Add a delay after issuing the EC reset or power-off command to give the
controller time to complete the operation and avoid falling back to another
restart/poweroff provider.
Also print an error message if sending the command to the embedded controller
fails.
Fixes: 18672fe12367 ("power: reset: add Toradex Embedded Controller")
Cc: stable@vger.kernel.org
Signed-off-by: Emanuele Ghidoli <emanuele.ghidoli@toradex.com>
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Link: https://patch.msgid.link/20260130071208.1184239-1-ghidoliemanuele@gmail.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/power/reset/tdx-ec-poweroff.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/power/reset/tdx-ec-poweroff.c b/drivers/power/reset/tdx-ec-poweroff.c
index 3302a127fce52..8040aa03d74d4 100644
--- a/drivers/power/reset/tdx-ec-poweroff.c
+++ b/drivers/power/reset/tdx-ec-poweroff.c
@@ -8,7 +8,10 @@
*/
#include <linux/array_size.h>
+#include <linux/bug.h>
+#include <linux/delay.h>
#include <linux/device.h>
+#include <linux/dev_printk.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/mod_devicetable.h>
@@ -31,6 +34,8 @@
#define EC_REG_MAX 0xD0
+#define EC_CMD_TIMEOUT_MS 1000
+
static const struct regmap_range volatile_ranges[] = {
regmap_reg_range(EC_CMD_REG, EC_CMD_REG),
};
@@ -75,6 +80,13 @@ static int tdx_ec_power_off(struct sys_off_data *data)
err = tdx_ec_cmd(regmap, EC_CMD_POWEROFF);
+ if (err) {
+ dev_err(data->dev, "Failed to send power off command\n");
+ } else {
+ mdelay(EC_CMD_TIMEOUT_MS);
+ WARN_ONCE(1, "Unable to power off system\n");
+ }
+
return err ? NOTIFY_BAD : NOTIFY_DONE;
}
@@ -85,6 +97,13 @@ static int tdx_ec_restart(struct sys_off_data *data)
err = tdx_ec_cmd(regmap, EC_CMD_RESET);
+ if (err) {
+ dev_err(data->dev, "Failed to send restart command\n");
+ } else {
+ mdelay(EC_CMD_TIMEOUT_MS);
+ WARN_ONCE(1, "Unable to restart system\n");
+ }
+
return err ? NOTIFY_BAD : NOTIFY_DONE;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 640/752] mm/highmem: fix __kmap_to_page() build error
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (179 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 639/752] power: reset: tdx-ec-poweroff: fix restart Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 641/752] compiler-clang.h: require LLVM 19.1.0 or higher for __typeof_unqual__ Sasha Levin
` (103 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: William Tambe, Max Filippov, Chris Zankel, stable, Andrew Morton,
Sasha Levin
From: William Tambe <williamt@cadence.com>
[ Upstream commit 94350fe6cad77b46c3dcb8c96543bef7647efbc0 ]
This changes fixes following build error which is a miss from ef6e06b2ef87
("highmem: fix kmap_to_page() for kmap_local_page() addresses").
mm/highmem.c:184:66: error: 'pteval' undeclared (first use in this
function); did you mean 'pte_val'?
184 | idx = arch_kmap_local_map_idx(i, pte_pfn(pteval));
In __kmap_to_page(), pteval is used but does not exist in the function.
(akpm: affects xtensa only)
Link: https://lkml.kernel.org/r/SJ0PR07MB86317E00EC0C59DA60935FDCD18DA@SJ0PR07MB8631.namprd07.prod.outlook.com
Fixes: ef6e06b2ef87 ("highmem: fix kmap_to_page() for kmap_local_page() addresses")
Signed-off-by: William Tambe <williamt@cadence.com>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/highmem.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/highmem.c b/mm/highmem.c
index b5c8e4c2d5d49..a33e411839517 100644
--- a/mm/highmem.c
+++ b/mm/highmem.c
@@ -180,12 +180,13 @@ struct page *__kmap_to_page(void *vaddr)
for (i = 0; i < kctrl->idx; i++) {
unsigned long base_addr;
int idx;
+ pte_t pteval = kctrl->pteval[i];
idx = arch_kmap_local_map_idx(i, pte_pfn(pteval));
base_addr = __fix_to_virt(FIX_KMAP_BEGIN + idx);
if (base_addr == base)
- return pte_page(kctrl->pteval[i]);
+ return pte_page(pteval);
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 641/752] compiler-clang.h: require LLVM 19.1.0 or higher for __typeof_unqual__
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (180 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 640/752] mm/highmem: fix __kmap_to_page() build error Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 642/752] rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net() Sasha Levin
` (102 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Nathan Chancellor, Bill Wendling, Justin Stitt, Uros Bizjak,
stable, Andrew Morton, Sasha Levin
From: Nathan Chancellor <nathan@kernel.org>
[ Upstream commit e8d899d301346a5591c9d1af06c3c9b3501cf84b ]
When building the kernel using a version of LLVM between llvmorg-19-init
(the first commit of the LLVM 19 development cycle) and the change in
LLVM that actually added __typeof_unqual__ for all C modes [1], which
might happen during a bisect of LLVM, there is a build failure:
In file included from arch/x86/kernel/asm-offsets.c:9:
In file included from include/linux/crypto.h:15:
In file included from include/linux/completion.h:12:
In file included from include/linux/swait.h:7:
In file included from include/linux/spinlock.h:56:
In file included from include/linux/preempt.h:79:
arch/x86/include/asm/preempt.h:61:2: error: call to undeclared function '__typeof_unqual__'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
61 | raw_cpu_and_4(__preempt_count, ~PREEMPT_NEED_RESCHED);
| ^
arch/x86/include/asm/percpu.h:478:36: note: expanded from macro 'raw_cpu_and_4'
478 | #define raw_cpu_and_4(pcp, val) percpu_binary_op(4, , "and", (pcp), val)
| ^
arch/x86/include/asm/percpu.h:210:3: note: expanded from macro 'percpu_binary_op'
210 | TYPEOF_UNQUAL(_var) pto_tmp__; \
| ^
include/linux/compiler.h:248:29: note: expanded from macro 'TYPEOF_UNQUAL'
248 | # define TYPEOF_UNQUAL(exp) __typeof_unqual__(exp)
| ^
The current logic of CC_HAS_TYPEOF_UNQUAL just checks for a major
version of 19 but half of the 19 development cycle did not have support
for __typeof_unqual__.
Harden the logic of CC_HAS_TYPEOF_UNQUAL to avoid this error by only
using __typeof_unqual__ with a released version of LLVM 19, which is
greater than or equal to 19.1.0 with LLVM's versioning scheme that
matches GCC's [2].
Link: https://github.com/llvm/llvm-project/commit/cc308f60d41744b5920ec2e2e5b25e1273c8704b [1]
Link: https://github.com/llvm/llvm-project/commit/4532617ae420056bf32f6403dde07fb99d276a49 [2]
Link: https://lkml.kernel.org/r/20260116-require-llvm-19-1-for-typeof_unqual-v1-1-3b9a4a4b212b@kernel.org
Fixes: ac053946f5c4 ("compiler.h: introduce TYPEOF_UNQUAL() macro")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Cc: Bill Wendling <morbo@google.com>
Cc: Justin Stitt <justinstitt@google.com>
Cc: Uros Bizjak <ubizjak@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/compiler-clang.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index 107ce05bd16eb..cccc72fd336b8 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -152,4 +152,4 @@
* Bindgen uses LLVM even if our C compiler is GCC, so we cannot
* rely on the auto-detected CONFIG_CC_HAS_TYPEOF_UNQUAL.
*/
-#define CC_HAS_TYPEOF_UNQUAL (__clang_major__ >= 19)
+#define CC_HAS_TYPEOF_UNQUAL (__clang_major__ > 19 || (__clang_major__ == 19 && __clang_minor__ > 0))
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 642/752] rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (181 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 641/752] compiler-clang.h: require LLVM 19.1.0 or higher for __typeof_unqual__ Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 643/752] ocfs2: fix reflink preserve cleanup issue Sasha Levin
` (101 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Haoxiang Li, Andrew Morton, Alexandre Bounine, Matt Porter,
stable, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit 666183dcdd9ad3b8156a1df7f204f728f720380f ]
When idtab allocation fails, net is not registered with rio_add_net() yet,
so kfree(net) is sufficient to release the memory. Set mport->net to NULL
to avoid dangling pointer.
Link: https://lkml.kernel.org/r/20260121013508.195836-1-lihaoxiang@isrc.iscas.ac.cn
Fixes: e6b585ca6e81 ("rapidio: move net allocation into core code")
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/rapidio/rio-scan.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/rapidio/rio-scan.c b/drivers/rapidio/rio-scan.c
index c12941f71e2cb..dcd6619a4b027 100644
--- a/drivers/rapidio/rio-scan.c
+++ b/drivers/rapidio/rio-scan.c
@@ -854,7 +854,8 @@ static struct rio_net *rio_scan_alloc_net(struct rio_mport *mport,
if (idtab == NULL) {
pr_err("RIO: failed to allocate destID table\n");
- rio_free_net(net);
+ kfree(net);
+ mport->net = NULL;
net = NULL;
} else {
net->enum_data = idtab;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 643/752] ocfs2: fix reflink preserve cleanup issue
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (182 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 642/752] rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net() Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 644/752] kexec: derive purgatory entry from symbol Sasha Levin
` (100 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Heming Zhao, Mark Fasheh, Joel Becker, Junxiao Bi, Joseph Qi,
Changwei Ge, Jun Piao, stable, Andrew Morton, Sasha Levin
From: Heming Zhao <heming.zhao@suse.com>
[ Upstream commit 5138c936c2c82c9be8883921854bc6f7e1177d8c ]
commit c06c303832ec ("ocfs2: fix xattr array entry __counted_by error")
doesn't handle all cases and the cleanup job for preserved xattr entries
still has bug:
- the 'last' pointer should be shifted by one unit after cleanup
an array entry.
- current code logic doesn't cleanup the first entry when xh_count is 1.
Note, commit c06c303832ec is also a bug fix for 0fe9b66c65f3.
Link: https://lkml.kernel.org/r/20251210015725.8409-2-heming.zhao@suse.com
Fixes: 0fe9b66c65f3 ("ocfs2: Add preserve to reflink.")
Signed-off-by: Heming Zhao <heming.zhao@suse.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Joseph Qi <jiangqi903@gmail.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ocfs2/xattr.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index d70a20d29e3e9..64ba3946f8408 100644
--- a/fs/ocfs2/xattr.c
+++ b/fs/ocfs2/xattr.c
@@ -6364,6 +6364,10 @@ static int ocfs2_reflink_xattr_header(handle_t *handle,
(void *)last - (void *)xe);
memset(last, 0,
sizeof(struct ocfs2_xattr_entry));
+ last = &new_xh->xh_entries[le16_to_cpu(new_xh->xh_count)] - 1;
+ } else {
+ memset(xe, 0, sizeof(struct ocfs2_xattr_entry));
+ last = NULL;
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 644/752] kexec: derive purgatory entry from symbol
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (183 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 643/752] ocfs2: fix reflink preserve cleanup issue Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 645/752] crash_dump: fix dm_crypt keys locking and ref leak Sasha Levin
` (99 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Li Chen, Baoquan He, Alexander Graf, Eric Biggers, Philipp Rudo,
Ricardo Ribalda Delgado, Ross Zwisler, Sourabh Jain,
Steven Rostedt, stable, Andrew Morton, Sasha Levin
From: Li Chen <me@linux.beauty>
[ Upstream commit 480e1d5c64bb14441f79f2eb9421d5e26f91ea3d ]
kexec_load_purgatory() derives image->start by locating e_entry inside an
SHF_EXECINSTR section. If the purgatory object contains multiple
executable sections with overlapping sh_addr, the entrypoint check can
match more than once and trigger a WARN.
Derive the entry section from the purgatory_start symbol when present and
compute image->start from its final placement. Keep the existing e_entry
fallback for purgatories that do not expose the symbol.
WARNING: kernel/kexec_file.c:1009 at kexec_load_purgatory+0x395/0x3c0, CPU#10: kexec/1784
Call Trace:
<TASK>
bzImage64_load+0x133/0xa00
__do_sys_kexec_file_load+0x2b3/0x5c0
do_syscall_64+0x81/0x610
entry_SYSCALL_64_after_hwframe+0x76/0x7e
[me@linux.beauty: move helper to avoid forward declaration, per Baoquan]
Link: https://lkml.kernel.org/r/20260128043511.316860-1-me@linux.beauty
Link: https://lkml.kernel.org/r/20260120124005.148381-1-me@linux.beauty
Fixes: 8652d44f466a ("kexec: support purgatories with .text.hot sections")
Signed-off-by: Li Chen <me@linux.beauty>
Acked-by: Baoquan He <bhe@redhat.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: Eric Biggers <ebiggers@kernel.org>
Cc: Li Chen <me@linux.beauty>
Cc: Philipp Rudo <prudo@redhat.com>
Cc: Ricardo Ribalda Delgado <ribalda@chromium.org>
Cc: Ross Zwisler <zwisler@google.com>
Cc: Sourabh Jain <sourabhjain@linux.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kexec_file.c | 131 +++++++++++++++++++++++++-------------------
1 file changed, 74 insertions(+), 57 deletions(-)
diff --git a/kernel/kexec_file.c b/kernel/kexec_file.c
index eb62a97942428..2bfbb2d144e69 100644
--- a/kernel/kexec_file.c
+++ b/kernel/kexec_file.c
@@ -882,6 +882,60 @@ static int kexec_calculate_store_digests(struct kimage *image)
}
#ifdef CONFIG_ARCH_SUPPORTS_KEXEC_PURGATORY
+/*
+ * kexec_purgatory_find_symbol - find a symbol in the purgatory
+ * @pi: Purgatory to search in.
+ * @name: Name of the symbol.
+ *
+ * Return: pointer to symbol in read-only symtab on success, NULL on error.
+ */
+static const Elf_Sym *kexec_purgatory_find_symbol(struct purgatory_info *pi,
+ const char *name)
+{
+ const Elf_Shdr *sechdrs;
+ const Elf_Ehdr *ehdr;
+ const Elf_Sym *syms;
+ const char *strtab;
+ int i, k;
+
+ if (!pi->ehdr)
+ return NULL;
+
+ ehdr = pi->ehdr;
+ sechdrs = (void *)ehdr + ehdr->e_shoff;
+
+ for (i = 0; i < ehdr->e_shnum; i++) {
+ if (sechdrs[i].sh_type != SHT_SYMTAB)
+ continue;
+
+ if (sechdrs[i].sh_link >= ehdr->e_shnum)
+ /* Invalid strtab section number */
+ continue;
+ strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset;
+ syms = (void *)ehdr + sechdrs[i].sh_offset;
+
+ /* Go through symbols for a match */
+ for (k = 0; k < sechdrs[i].sh_size/sizeof(Elf_Sym); k++) {
+ if (ELF_ST_BIND(syms[k].st_info) != STB_GLOBAL)
+ continue;
+
+ if (strcmp(strtab + syms[k].st_name, name) != 0)
+ continue;
+
+ if (syms[k].st_shndx == SHN_UNDEF ||
+ syms[k].st_shndx >= ehdr->e_shnum) {
+ pr_debug("Symbol: %s has bad section index %d.\n",
+ name, syms[k].st_shndx);
+ return NULL;
+ }
+
+ /* Found the symbol we are looking for */
+ return &syms[k];
+ }
+ }
+
+ return NULL;
+}
/*
* kexec_purgatory_setup_kbuf - prepare buffer to load purgatory.
* @pi: Purgatory to be loaded.
@@ -960,6 +1014,10 @@ static int kexec_purgatory_setup_sechdrs(struct purgatory_info *pi,
unsigned long offset;
size_t sechdrs_size;
Elf_Shdr *sechdrs;
+ const Elf_Sym *entry_sym;
+ u16 entry_shndx = 0;
+ unsigned long entry_off = 0;
+ bool start_fixed = false;
int i;
/*
@@ -977,6 +1035,12 @@ static int kexec_purgatory_setup_sechdrs(struct purgatory_info *pi,
bss_addr = kbuf->mem + kbuf->bufsz;
kbuf->image->start = pi->ehdr->e_entry;
+ entry_sym = kexec_purgatory_find_symbol(pi, "purgatory_start");
+ if (entry_sym) {
+ entry_shndx = entry_sym->st_shndx;
+ entry_off = entry_sym->st_value;
+ }
+
for (i = 0; i < pi->ehdr->e_shnum; i++) {
unsigned long align;
void *src, *dst;
@@ -994,6 +1058,13 @@ static int kexec_purgatory_setup_sechdrs(struct purgatory_info *pi,
offset = ALIGN(offset, align);
+ if (!start_fixed && entry_sym && i == entry_shndx &&
+ (sechdrs[i].sh_flags & SHF_EXECINSTR) &&
+ entry_off < sechdrs[i].sh_size) {
+ kbuf->image->start = kbuf->mem + offset + entry_off;
+ start_fixed = true;
+ }
+
/*
* Check if the segment contains the entry point, if so,
* calculate the value of image->start based on it.
@@ -1004,13 +1075,14 @@ static int kexec_purgatory_setup_sechdrs(struct purgatory_info *pi,
* is not set to the initial value, and warn the user so they
* have a chance to fix their purgatory's linker script.
*/
- if (sechdrs[i].sh_flags & SHF_EXECINSTR &&
+ if (!start_fixed && sechdrs[i].sh_flags & SHF_EXECINSTR &&
pi->ehdr->e_entry >= sechdrs[i].sh_addr &&
pi->ehdr->e_entry < (sechdrs[i].sh_addr
+ sechdrs[i].sh_size) &&
- !WARN_ON(kbuf->image->start != pi->ehdr->e_entry)) {
+ kbuf->image->start == pi->ehdr->e_entry) {
kbuf->image->start -= sechdrs[i].sh_addr;
kbuf->image->start += kbuf->mem + offset;
+ start_fixed = true;
}
src = (void *)pi->ehdr + sechdrs[i].sh_offset;
@@ -1128,61 +1200,6 @@ int kexec_load_purgatory(struct kimage *image, struct kexec_buf *kbuf)
return ret;
}
-/*
- * kexec_purgatory_find_symbol - find a symbol in the purgatory
- * @pi: Purgatory to search in.
- * @name: Name of the symbol.
- *
- * Return: pointer to symbol in read-only symtab on success, NULL on error.
- */
-static const Elf_Sym *kexec_purgatory_find_symbol(struct purgatory_info *pi,
- const char *name)
-{
- const Elf_Shdr *sechdrs;
- const Elf_Ehdr *ehdr;
- const Elf_Sym *syms;
- const char *strtab;
- int i, k;
-
- if (!pi->ehdr)
- return NULL;
-
- ehdr = pi->ehdr;
- sechdrs = (void *)ehdr + ehdr->e_shoff;
-
- for (i = 0; i < ehdr->e_shnum; i++) {
- if (sechdrs[i].sh_type != SHT_SYMTAB)
- continue;
-
- if (sechdrs[i].sh_link >= ehdr->e_shnum)
- /* Invalid strtab section number */
- continue;
- strtab = (void *)ehdr + sechdrs[sechdrs[i].sh_link].sh_offset;
- syms = (void *)ehdr + sechdrs[i].sh_offset;
-
- /* Go through symbols for a match */
- for (k = 0; k < sechdrs[i].sh_size/sizeof(Elf_Sym); k++) {
- if (ELF_ST_BIND(syms[k].st_info) != STB_GLOBAL)
- continue;
-
- if (strcmp(strtab + syms[k].st_name, name) != 0)
- continue;
-
- if (syms[k].st_shndx == SHN_UNDEF ||
- syms[k].st_shndx >= ehdr->e_shnum) {
- pr_debug("Symbol: %s has bad section index %d.\n",
- name, syms[k].st_shndx);
- return NULL;
- }
-
- /* Found the symbol we are looking for */
- return &syms[k];
- }
- }
-
- return NULL;
-}
-
void *kexec_purgatory_get_symbol_addr(struct kimage *image, const char *name)
{
struct purgatory_info *pi = &image->purgatory_info;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 645/752] crash_dump: fix dm_crypt keys locking and ref leak
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (184 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 644/752] kexec: derive purgatory entry from symbol Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 646/752] kho: skip memoryless NUMA nodes when reserving scratch areas Sasha Levin
` (98 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Vasily Gorbik, Baoquan He, Coiby Xu, Dave Young, Vivek Goyal,
stable, Andrew Morton, Sasha Levin
From: Vasily Gorbik <gor@linux.ibm.com>
[ Upstream commit 96a54b8ffc8c4567c32fe0b6996669f1132b026d ]
crash_load_dm_crypt_keys() reads dm-crypt volume keys from the user
keyring. It uses user_key_payload_locked() without holding key->sem,
which makes lockdep complain when kexec_file_load() assembles the crash
image:
=============================
WARNING: suspicious RCU usage
-----------------------------
./include/keys/user-type.h:53 suspicious rcu_dereference_protected() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
no locks held by kexec/4875.
stack backtrace:
Call Trace:
<TASK>
dump_stack_lvl+0x5d/0x80
lockdep_rcu_suspicious.cold+0x4e/0x96
crash_load_dm_crypt_keys+0x314/0x390
bzImage64_load+0x116/0x9a0
? __lock_acquire+0x464/0x1ba0
__do_sys_kexec_file_load+0x26a/0x4f0
do_syscall_64+0xbd/0x430
entry_SYSCALL_64_after_hwframe+0x77/0x7f
In addition, the key returned by request_key() is never key_put()'d,
leaking a key reference on each load attempt.
Take key->sem while copying the payload and drop the key reference
afterwards.
Link: https://lkml.kernel.org/r/patch.git-2d4d76083a5c.your-ad-here.call-01769426386-ext-2560@work.hours
Fixes: 479e58549b0f ("crash_dump: store dm crypt keys in kdump reserved memory")
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Cc: Baoquan He <bhe@redhat.com>
Cc: Coiby Xu <coxu@redhat.com>
Cc: Dave Young <dyoung@redhat.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/crash_dump_dm_crypt.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/kernel/crash_dump_dm_crypt.c b/kernel/crash_dump_dm_crypt.c
index 401423ba477da..abb307a23de33 100644
--- a/kernel/crash_dump_dm_crypt.c
+++ b/kernel/crash_dump_dm_crypt.c
@@ -143,6 +143,7 @@ static int read_key_from_user_keying(struct dm_crypt_key *dm_key)
{
const struct user_key_payload *ukp;
struct key *key;
+ int ret = 0;
kexec_dprintk("Requesting logon key %s", dm_key->key_desc);
key = request_key(&key_type_logon, dm_key->key_desc, NULL);
@@ -152,20 +153,28 @@ static int read_key_from_user_keying(struct dm_crypt_key *dm_key)
return PTR_ERR(key);
}
+ down_read(&key->sem);
ukp = user_key_payload_locked(key);
- if (!ukp)
- return -EKEYREVOKED;
+ if (!ukp) {
+ ret = -EKEYREVOKED;
+ goto out;
+ }
if (ukp->datalen > KEY_SIZE_MAX) {
pr_err("Key size %u exceeds maximum (%u)\n", ukp->datalen, KEY_SIZE_MAX);
- return -EINVAL;
+ ret = -EINVAL;
+ goto out;
}
memcpy(dm_key->data, ukp->data, ukp->datalen);
dm_key->key_size = ukp->datalen;
kexec_dprintk("Get dm crypt key (size=%u) %s: %8ph\n", dm_key->key_size,
dm_key->key_desc, dm_key->data);
- return 0;
+
+out:
+ up_read(&key->sem);
+ key_put(key);
+ return ret;
}
struct config_key {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 646/752] kho: skip memoryless NUMA nodes when reserving scratch areas
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (185 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 645/752] crash_dump: fix dm_crypt keys locking and ref leak Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 647/752] Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV" Sasha Levin
` (97 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Evangelos Petrongonas, Pratyush Yadav, Mike Rapoport (Microsoft),
Pasha Tatashin, Alexander Graf, stable, Andrew Morton,
Sasha Levin
From: Evangelos Petrongonas <epetron@amazon.de>
[ Upstream commit 427b2535f51342de3156babc6bdc3f3b7dd2c707 ]
kho_reserve_scratch() iterates over all online NUMA nodes to allocate
per-node scratch memory. On systems with memoryless NUMA nodes (nodes
that have CPUs but no memory), memblock_alloc_range_nid() fails because
there is no memory available on that node. This causes KHO initialization
to fail and kho_enable to be set to false.
Some ARM64 systems have NUMA topologies where certain nodes contain only
CPUs without any associated memory. These configurations are valid and
should not prevent KHO from functioning.
Fix this by only counting nodes that have memory (N_MEMORY state) and skip
memoryless nodes in the per-node scratch allocation loop.
Link: https://lkml.kernel.org/r/20260120175913.34368-1-epetron@amazon.de
Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers").
Signed-off-by: Evangelos Petrongonas <epetron@amazon.de>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Reviewed-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Alexander Graf <graf@amazon.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/kexec_handover.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/kexec_handover.c b/kernel/kexec_handover.c
index 03d12e27189fc..2da4bd994322f 100644
--- a/kernel/kexec_handover.c
+++ b/kernel/kexec_handover.c
@@ -619,7 +619,7 @@ static void __init kho_reserve_scratch(void)
scratch_size_update();
/* FIXME: deal with node hot-plug/remove */
- kho_scratch_cnt = num_online_nodes() + 2;
+ kho_scratch_cnt = nodes_weight(node_states[N_MEMORY]) + 2;
size = kho_scratch_cnt * sizeof(*kho_scratch);
kho_scratch = memblock_alloc(size, PAGE_SIZE);
if (!kho_scratch)
@@ -649,7 +649,11 @@ static void __init kho_reserve_scratch(void)
kho_scratch[i].size = size;
i++;
- for_each_online_node(nid) {
+ /*
+ * Loop over nodes that have both memory and are online. Skip
+ * memoryless nodes, as we can not allocate scratch areas there.
+ */
+ for_each_node_state(nid, N_MEMORY) {
size = scratch_size_node(nid);
addr = memblock_alloc_range_nid(size, CMA_MIN_ALIGNMENT_BYTES,
0, MEMBLOCK_ALLOC_ACCESSIBLE,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 647/752] Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV"
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (186 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 646/752] kho: skip memoryless NUMA nodes when reserving scratch areas Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 648/752] PCI/IOV: Fix race between SR-IOV enable/disable and hotplug Sasha Levin
` (96 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Niklas Schnelle, Benjamin Block, Bjorn Helgaas, Gerd Bayer,
stable, Sasha Levin
From: Niklas Schnelle <schnelle@linux.ibm.com>
[ Upstream commit 2fa119c0e5e528453ebae9e70740e8d2d8c0ed5a ]
This reverts commit 05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking
when enabling/disabling SR-IOV"), which causes a deadlock by recursively
taking pci_rescan_remove_lock when sriov_del_vfs() is called as part of
pci_stop_and_remove_bus_device(). For example with the following sequence
of commands:
$ echo <NUM> > /sys/bus/pci/devices/<pf>/sriov_numvfs
$ echo 1 > /sys/bus/pci/devices/<pf>/remove
A trimmed trace of the deadlock on a mlx5 device is as below:
zsh/5715 is trying to acquire lock:
000002597926ef50 (pci_rescan_remove_lock){+.+.}-{3:3}, at: sriov_disable+0x34/0x140
but task is already holding lock:
000002597926ef50 (pci_rescan_remove_lock){+.+.}-{3:3}, at: pci_stop_and_remove_bus_device_locked+0x24/0x80
...
Call Trace:
[<00000259778c4f90>] dump_stack_lvl+0xc0/0x110
[<00000259779c844e>] print_deadlock_bug+0x31e/0x330
[<00000259779c1908>] __lock_acquire+0x16c8/0x32f0
[<00000259779bffac>] lock_acquire+0x14c/0x350
[<00000259789643a6>] __mutex_lock_common+0xe6/0x1520
[<000002597896413c>] mutex_lock_nested+0x3c/0x50
[<00000259784a07e4>] sriov_disable+0x34/0x140
[<00000258f7d6dd80>] mlx5_sriov_disable+0x50/0x80 [mlx5_core]
[<00000258f7d5745e>] remove_one+0x5e/0xf0 [mlx5_core]
[<00000259784857fc>] pci_device_remove+0x3c/0xa0
[<000002597851012e>] device_release_driver_internal+0x18e/0x280
[<000002597847ae22>] pci_stop_bus_device+0x82/0xa0
[<000002597847afce>] pci_stop_and_remove_bus_device_locked+0x5e/0x80
[<00000259784972c2>] remove_store+0x72/0x90
[<0000025977e6661a>] kernfs_fop_write_iter+0x15a/0x200
[<0000025977d7241c>] vfs_write+0x24c/0x300
[<0000025977d72696>] ksys_write+0x86/0x110
[<000002597895b61c>] __do_syscall+0x14c/0x400
[<000002597896e0ee>] system_call+0x6e/0x90
This alone is not a complete fix as it restores the issue the cited commit
tried to solve. A new fix will be provided as a follow on.
Fixes: 05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV")
Reported-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Acked-by: Gerd Bayer <gbayer@linux.ibm.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251216-revert_sriov_lock-v3-1-dac4925a7621@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/iov.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index 77dee43b78583..ac4375954c947 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -629,18 +629,15 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs)
if (dev->no_vf_scan)
return 0;
- pci_lock_rescan_remove();
for (i = 0; i < num_vfs; i++) {
rc = pci_iov_add_virtfn(dev, i);
if (rc)
goto failed;
}
- pci_unlock_rescan_remove();
return 0;
failed:
while (i--)
pci_iov_remove_virtfn(dev, i);
- pci_unlock_rescan_remove();
return rc;
}
@@ -765,10 +762,8 @@ static void sriov_del_vfs(struct pci_dev *dev)
struct pci_sriov *iov = dev->sriov;
int i;
- pci_lock_rescan_remove();
for (i = 0; i < iov->num_VFs; i++)
pci_iov_remove_virtfn(dev, i);
- pci_unlock_rescan_remove();
}
static void sriov_disable(struct pci_dev *dev)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 648/752] PCI/IOV: Fix race between SR-IOV enable/disable and hotplug
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (187 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 647/752] Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV" Sasha Levin
@ 2026-02-28 17:45 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 649/752] arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y Sasha Levin
` (95 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:45 UTC (permalink / raw)
To: patches
Cc: Niklas Schnelle, Benjamin Block, Bjorn Helgaas, Gerd Bayer,
stable, Sasha Levin
From: Niklas Schnelle <schnelle@linux.ibm.com>
[ Upstream commit a5338e365c4559d7b4d7356116b0eb95b12e08d5 ]
Commit 05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking when
enabling/disabling SR-IOV") tried to fix a race between the VF removal
inside sriov_del_vfs() and concurrent hot unplug by taking the PCI
rescan/remove lock in sriov_del_vfs(). Similarly the PCI rescan/remove lock
was also taken in sriov_add_vfs() to protect addition of VFs.
This approach however causes deadlock on trying to remove PFs with SR-IOV
enabled because PFs disable SR-IOV during removal and this removal happens
under the PCI rescan/remove lock. So the original fix had to be reverted.
Instead of taking the PCI rescan/remove lock in sriov_add_vfs() and
sriov_del_vfs(), fix the race that occurs with SR-IOV enable and disable vs
hotplug higher up in the callchain by taking the lock in
sriov_numvfs_store() before calling into the driver's sriov_configure()
callback.
Fixes: 05703271c3cd ("PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV")
Reported-by: Benjamin Block <bblock@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Benjamin Block <bblock@linux.ibm.com>
Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251216-revert_sriov_lock-v3-2-dac4925a7621@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/iov.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
index ac4375954c947..c6dc1b44bf602 100644
--- a/drivers/pci/iov.c
+++ b/drivers/pci/iov.c
@@ -495,7 +495,9 @@ static ssize_t sriov_numvfs_store(struct device *dev,
if (num_vfs == 0) {
/* disable VFs */
+ pci_lock_rescan_remove();
ret = pdev->driver->sriov_configure(pdev, 0);
+ pci_unlock_rescan_remove();
goto exit;
}
@@ -507,7 +509,9 @@ static ssize_t sriov_numvfs_store(struct device *dev,
goto exit;
}
+ pci_lock_rescan_remove();
ret = pdev->driver->sriov_configure(pdev, num_vfs);
+ pci_unlock_rescan_remove();
if (ret < 0)
goto exit;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 649/752] arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (188 preceding siblings ...)
2026-02-28 17:45 ` [PATCH 6.18 648/752] PCI/IOV: Fix race between SR-IOV enable/disable and hotplug Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 650/752] uprobes: Fix incorrect lockdep condition in filter_chain() Sasha Levin
` (94 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Marco Elver, stable, Boqun Feng, David Laight, Will Deacon,
Sasha Levin
From: Marco Elver <elver@google.com>
[ Upstream commit bb0c99e08ab9aa6d04b40cb63c72db9950d51749 ]
The implementation of __READ_ONCE() under CONFIG_LTO=y incorrectly
qualified the fallback "once" access for types larger than 8 bytes,
which are not atomic but should still happen "once" and suppress common
compiler optimizations.
The cast `volatile typeof(__x)` applied the volatile qualifier to the
pointer type itself rather than the pointee. This created a volatile
pointer to a non-volatile type, which violated __READ_ONCE() semantics.
Fix this by casting to `volatile typeof(*__x) *`.
With a defconfig + LTO + debug options build, we see the following
functions to be affected:
xen_manage_runstate_time (884 -> 944 bytes)
xen_steal_clock (248 -> 340 bytes)
^-- use __READ_ONCE() to load vcpu_runstate_info structs
Fixes: e35123d83ee3 ("arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y")
Cc: stable@vger.kernel.org
Reviewed-by: Boqun Feng <boqun@kernel.org>
Signed-off-by: Marco Elver <elver@google.com>
Tested-by: David Laight <david.laight.linux@gmail.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/include/asm/rwonce.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/include/asm/rwonce.h b/arch/arm64/include/asm/rwonce.h
index 97d9256d33c97..ac370a4a01ee9 100644
--- a/arch/arm64/include/asm/rwonce.h
+++ b/arch/arm64/include/asm/rwonce.h
@@ -58,7 +58,7 @@
default: \
atomic = 0; \
} \
- atomic ? (typeof(*__x))__u.__val : (*(volatile typeof(__x))__x);\
+ atomic ? (typeof(*__x))__u.__val : (*(volatile typeof(*__x) *)__x);\
})
#endif /* !BUILD_VDSO */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 650/752] uprobes: Fix incorrect lockdep condition in filter_chain()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (189 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 649/752] arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 651/752] clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841 Sasha Levin
` (93 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Breno Leitao, Peter Zijlstra (Intel), Oleg Nesterov,
Andrii Nakryiko, Masami Hiramatsu (Google), stable, Sasha Levin
From: Breno Leitao <leitao@debian.org>
[ Upstream commit a56a38fd9196fc89401e498d70b7aa9c9679fa6e ]
The list_for_each_entry_rcu() in filter_chain() uses
rcu_read_lock_trace_held() as the lockdep condition, but the function
holds consumer_rwsem, not the RCU trace lock.
This gives me the following output when running with some locking debug
option enabled:
kernel/events/uprobes.c:1141 RCU-list traversed in non-reader section!!
filter_chain
register_for_each_vma
uprobe_unregister_nosync
__probe_event_disable
Remove the incorrect lockdep condition since the rwsem provides
sufficient protection for the list traversal.
Fixes: cc01bd044e6a ("uprobes: travers uprobe's consumer list locklessly under SRCU protection")
Signed-off-by: Breno Leitao <leitao@debian.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260128-uprobe_rcu-v2-1-994ea6d32730@debian.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/events/uprobes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index f11ceb8be8c41..4f42e7af575f5 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1138,7 +1138,7 @@ static bool filter_chain(struct uprobe *uprobe, struct mm_struct *mm)
bool ret = false;
down_read(&uprobe->consumer_rwsem);
- list_for_each_entry_rcu(uc, &uprobe->consumers, cons_node, rcu_read_lock_trace_held()) {
+ list_for_each_entry(uc, &uprobe->consumers, cons_node) {
ret = consumer_filter(uc, mm);
if (ret)
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 651/752] clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (190 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 650/752] uprobes: Fix incorrect lockdep condition in filter_chain() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 652/752] btrfs: fix periodic reclaim condition Sasha Levin
` (92 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Marek Vasut, stable, Geert Uytterhoeven, Stephen Boyd,
Sasha Levin
From: Marek Vasut <marek.vasut+renesas@mailbox.org>
[ Upstream commit 5ec820fc28d0b8a0f3890d476b1976f20e8343cc ]
The 9FGV0841 has 8 outputs and registers 8 struct clk_hw, make sure
there are 8 slots for those newly registered clk_hw pointers, else
there is going to be out of bounds write when pointers 4..7 are set
into struct rs9_driver_data .clk_dif[4..7] field.
Since there are other structure members past this struct clk_hw
pointer array, writing to .clk_dif[4..7] fields corrupts both
the struct rs9_driver_data content and data around it, sometimes
without crashing the kernel. However, the kernel does surely
crash when the driver is unbound or during suspend.
Fix this, increase the struct clk_hw pointer array size to the
maximum output count of 9FGV0841, which is the biggest chip that
is supported by this driver.
Cc: stable@vger.kernel.org
Fixes: f0e5e1800204 ("clk: rs9: Add support for 9FGV0841")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Closes: https://lore.kernel.org/CAMuHMdVyQpOBT+Ho+mXY07fndFN9bKJdaaWGn91WOFnnYErLyg@mail.gmail.com
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/clk/clk-renesas-pcie.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/clk-renesas-pcie.c b/drivers/clk/clk-renesas-pcie.c
index 4c3a5e4eb77ac..f94a9c4d0b670 100644
--- a/drivers/clk/clk-renesas-pcie.c
+++ b/drivers/clk/clk-renesas-pcie.c
@@ -64,7 +64,7 @@ struct rs9_driver_data {
struct i2c_client *client;
struct regmap *regmap;
const struct rs9_chip_info *chip_info;
- struct clk_hw *clk_dif[4];
+ struct clk_hw *clk_dif[8];
u8 pll_amplitude;
u8 pll_ssc;
u8 clk_dif_sr;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 652/752] btrfs: fix periodic reclaim condition
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (191 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 651/752] clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841 Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 653/752] btrfs: zoned: fixup last alloc pointer after extent removal for RAID1 Sasha Levin
` (91 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Sun YangKai, stable, Boris Burkov, David Sterba, Sasha Levin
From: Sun YangKai <sunk67188@gmail.com>
[ Upstream commit 19eff93dc738e8afaa59cb374b44bb5a162e6c2d ]
Problems with current implementation:
1. reclaimable_bytes is signed while chunk_sz is unsigned, causing
negative reclaimable_bytes to trigger reclaim unexpectedly
2. The "space must be freed between scans" assumption breaks the
two-scan requirement: first scan marks block groups, second scan
reclaims them. Without the second scan, no reclamation occurs.
Instead, track actual reclaim progress: pause reclaim when block groups
will be reclaimed, and resume only when progress is made. This ensures
reclaim continues until no further progress can be made. And resume
periodic reclaim when there's enough free space.
And we take care if reclaim is making any progress now, so it's
unnecessary to set periodic_reclaim_ready to false when failed to reclaim
a block group.
Fixes: 813d4c6422516 ("btrfs: prevent pathological periodic reclaim loops")
CC: stable@vger.kernel.org # 6.12+
Suggested-by: Boris Burkov <boris@bur.io>
Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Sun YangKai <sunk67188@gmail.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/block-group.c | 6 ++++--
fs/btrfs/space-info.c | 21 ++++++++++++---------
2 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index f7f6d8cb33114..4689ef206d0ee 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -1877,6 +1877,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
while (!list_empty(&fs_info->reclaim_bgs)) {
u64 used;
u64 reserved;
+ u64 old_total;
int ret = 0;
bg = list_first_entry(&fs_info->reclaim_bgs,
@@ -1942,6 +1943,7 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
}
spin_unlock(&bg->lock);
+ old_total = space_info->total_bytes;
spin_unlock(&space_info->lock);
/*
@@ -1994,14 +1996,14 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
reserved = 0;
spin_lock(&space_info->lock);
space_info->reclaim_errors++;
- if (READ_ONCE(space_info->periodic_reclaim))
- space_info->periodic_reclaim_ready = false;
spin_unlock(&space_info->lock);
}
spin_lock(&space_info->lock);
space_info->reclaim_count++;
space_info->reclaim_bytes += used;
space_info->reclaim_bytes += reserved;
+ if (space_info->total_bytes < old_total)
+ btrfs_set_periodic_reclaim_ready(space_info, true);
spin_unlock(&space_info->lock);
next:
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c
index 474ed47095ba7..6b64691034de4 100644
--- a/fs/btrfs/space-info.c
+++ b/fs/btrfs/space-info.c
@@ -2074,11 +2074,11 @@ static bool is_reclaim_urgent(struct btrfs_space_info *space_info)
return unalloc < data_chunk_size;
}
-static void do_reclaim_sweep(struct btrfs_space_info *space_info, int raid)
+static bool do_reclaim_sweep(struct btrfs_space_info *space_info, int raid)
{
struct btrfs_block_group *bg;
int thresh_pct;
- bool try_again = true;
+ bool will_reclaim = false;
bool urgent;
spin_lock(&space_info->lock);
@@ -2096,7 +2096,7 @@ static void do_reclaim_sweep(struct btrfs_space_info *space_info, int raid)
spin_lock(&bg->lock);
thresh = mult_perc(bg->length, thresh_pct);
if (bg->used < thresh && bg->reclaim_mark) {
- try_again = false;
+ will_reclaim = true;
reclaim = true;
}
bg->reclaim_mark++;
@@ -2113,12 +2113,13 @@ static void do_reclaim_sweep(struct btrfs_space_info *space_info, int raid)
* If we have any staler groups, we don't touch the fresher ones, but if we
* really need a block group, do take a fresh one.
*/
- if (try_again && urgent) {
- try_again = false;
+ if (!will_reclaim && urgent) {
+ urgent = false;
goto again;
}
up_read(&space_info->groups_sem);
+ return will_reclaim;
}
void btrfs_space_info_update_reclaimable(struct btrfs_space_info *space_info, s64 bytes)
@@ -2128,7 +2129,8 @@ void btrfs_space_info_update_reclaimable(struct btrfs_space_info *space_info, s6
lockdep_assert_held(&space_info->lock);
space_info->reclaimable_bytes += bytes;
- if (space_info->reclaimable_bytes >= chunk_sz)
+ if (space_info->reclaimable_bytes > 0 &&
+ space_info->reclaimable_bytes >= chunk_sz)
btrfs_set_periodic_reclaim_ready(space_info, true);
}
@@ -2155,7 +2157,6 @@ static bool btrfs_should_periodic_reclaim(struct btrfs_space_info *space_info)
spin_lock(&space_info->lock);
ret = space_info->periodic_reclaim_ready;
- btrfs_set_periodic_reclaim_ready(space_info, false);
spin_unlock(&space_info->lock);
return ret;
@@ -2169,8 +2170,10 @@ void btrfs_reclaim_sweep(const struct btrfs_fs_info *fs_info)
list_for_each_entry(space_info, &fs_info->space_info, list) {
if (!btrfs_should_periodic_reclaim(space_info))
continue;
- for (raid = 0; raid < BTRFS_NR_RAID_TYPES; raid++)
- do_reclaim_sweep(space_info, raid);
+ for (raid = 0; raid < BTRFS_NR_RAID_TYPES; raid++) {
+ if (do_reclaim_sweep(space_info, raid))
+ btrfs_set_periodic_reclaim_ready(space_info, false);
+ }
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 653/752] btrfs: zoned: fixup last alloc pointer after extent removal for RAID1
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (192 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 652/752] btrfs: fix periodic reclaim condition Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 654/752] btrfs: zoned: fixup last alloc pointer after extent removal for DUP Sasha Levin
` (90 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Naohiro Aota, stable, Johannes Thumshirn, David Sterba,
Sasha Levin
From: Naohiro Aota <naohiro.aota@wdc.com>
[ Upstream commit dda3ec9ee6b3e120603bff1b798f25b51e54ac5d ]
When a block group is composed of a sequential write zone and a
conventional zone, we recover the (pseudo) write pointer of the
conventional zone using the end of the last allocated position.
However, if the last extent in a block group is removed, the last extent
position will be smaller than the other real write pointer position.
Then, that will cause an error due to mismatch of the write pointers.
We can fixup this case by moving the alloc_offset to the corresponding
write pointer position.
Fixes: 568220fa9657 ("btrfs: zoned: support RAID0/1/10 on top of raid stripe tree")
CC: stable@vger.kernel.org # 6.12+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 3afc9c0c22287..8e6e96660fa66 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1483,6 +1483,21 @@ static int btrfs_load_block_group_raid1(struct btrfs_block_group *bg,
/* In case a device is missing we have a cap of 0, so don't use it. */
bg->zone_capacity = min_not_zero(zone_info[0].capacity, zone_info[1].capacity);
+ /*
+ * When the last extent is removed, last_alloc can be smaller than the other write
+ * pointer. In that case, last_alloc should be moved to the corresponding write
+ * pointer position.
+ */
+ for (i = 0; i < map->num_stripes; i++) {
+ if (zone_info[i].alloc_offset == WP_MISSING_DEV ||
+ zone_info[i].alloc_offset == WP_CONVENTIONAL)
+ continue;
+ if (last_alloc <= zone_info[i].alloc_offset) {
+ last_alloc = zone_info[i].alloc_offset;
+ break;
+ }
+ }
+
for (i = 0; i < map->num_stripes; i++) {
if (zone_info[i].alloc_offset == WP_MISSING_DEV)
continue;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 654/752] btrfs: zoned: fixup last alloc pointer after extent removal for DUP
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (193 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 653/752] btrfs: zoned: fixup last alloc pointer after extent removal for RAID1 Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 655/752] btrfs: continue trimming remaining devices on failure Sasha Levin
` (89 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Naohiro Aota, stable, Johannes Thumshirn, David Sterba,
Sasha Levin
From: Naohiro Aota <naohiro.aota@wdc.com>
[ Upstream commit e2d848649e64de39fc1b9c64002629b4daa1105d ]
When a block group is composed of a sequential write zone and a
conventional zone, we recover the (pseudo) write pointer of the
conventional zone using the end of the last allocated position.
However, if the last extent in a block group is removed, the last extent
position will be smaller than the other real write pointer position.
Then, that will cause an error due to mismatch of the write pointers.
We can fixup this case by moving the alloc_offset to the corresponding
write pointer position.
Fixes: c0d90a79e8e6 ("btrfs: zoned: fix alloc_offset calculation for partly conventional block groups")
CC: stable@vger.kernel.org # 6.16+
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/zoned.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index 8e6e96660fa66..4cbe1ba7af66d 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -1442,6 +1442,20 @@ static int btrfs_load_block_group_dup(struct btrfs_block_group *bg,
return -EIO;
}
+ /*
+ * When the last extent is removed, last_alloc can be smaller than the other write
+ * pointer. In that case, last_alloc should be moved to the corresponding write
+ * pointer position.
+ */
+ for (int i = 0; i < map->num_stripes; i++) {
+ if (zone_info[i].alloc_offset == WP_CONVENTIONAL)
+ continue;
+ if (last_alloc <= zone_info[i].alloc_offset) {
+ last_alloc = zone_info[i].alloc_offset;
+ break;
+ }
+ }
+
if (zone_info[0].alloc_offset == WP_CONVENTIONAL)
zone_info[0].alloc_offset = last_alloc;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 655/752] btrfs: continue trimming remaining devices on failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (194 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 654/752] btrfs: zoned: fixup last alloc pointer after extent removal for DUP Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 656/752] remoteproc: imx_rproc: Fix invalid loaded resource table detection Sasha Levin
` (88 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: jinbaohong, stable, Qu Wenruo, Robbie Ko, Filipe Manana,
David Sterba, Sasha Levin
From: jinbaohong <jinbaohong@synology.com>
[ Upstream commit 912d1c6680bdb40b72b1b9204706f32b6eb842c3 ]
Commit 93bba24d4b5a ("btrfs: Enhance btrfs_trim_fs function to handle
error better") intended to make device trimming continue even if one
device fails, tracking failures and reporting them at the end. However,
it used 'break' instead of 'continue', causing the loop to exit on the
first device failure.
Fix this by replacing 'break' with 'continue'.
Fixes: 93bba24d4b5a ("btrfs: Enhance btrfs_trim_fs function to handle error better")
CC: stable@vger.kernel.org # 5.4+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Robbie Ko <robbieko@synology.com>
Signed-off-by: jinbaohong <jinbaohong@synology.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/btrfs/extent-tree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index a48ba97bb3694..08b7109299472 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6601,7 +6601,7 @@ int btrfs_trim_fs(struct btrfs_fs_info *fs_info, struct fstrim_range *range)
if (ret) {
dev_failed++;
dev_ret = ret;
- break;
+ continue;
}
}
mutex_unlock(&fs_devices->device_list_mutex);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 656/752] remoteproc: imx_rproc: Fix invalid loaded resource table detection
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (195 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 655/752] btrfs: continue trimming remaining devices on failure Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 657/752] perf/arm-cmn: Reject unsupported hardware configurations Sasha Levin
` (87 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Peng Fan, stable, Daniel Baluta, Mathieu Poirier, Sasha Levin
From: Peng Fan <peng.fan@nxp.com>
[ Upstream commit 26aa5295010ffaebcf8f1991c53fa7cf2ee1b20d ]
imx_rproc_elf_find_loaded_rsc_table() may incorrectly report a loaded
resource table even when the current firmware does not provide one.
When the device tree contains a "rsc-table" entry, priv->rsc_table is
non-NULL and denotes where a resource table would be located if one is
present in memory. However, when the current firmware has no resource
table, rproc->table_ptr is NULL. The function still returns
priv->rsc_table, and the remoteproc core interprets this as a valid loaded
resource table.
Fix this by returning NULL from imx_rproc_elf_find_loaded_rsc_table() when
there is no resource table for the current firmware (i.e. when
rproc->table_ptr is NULL). This aligns the function's semantics with the
remoteproc core: a loaded resource table is only reported when a valid
table_ptr exists.
With this change, starting firmware without a resource table no longer
triggers a crash.
Fixes: e954a1bd1610 ("remoteproc: imx_rproc: Use imx specific hook for find_loaded_rsc_table")
Cc: stable@vger.kernel.org
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20260129-imx-rproc-fix-v3-1-fc4e41e6e750@nxp.com
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/remoteproc/imx_rproc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/remoteproc/imx_rproc.c b/drivers/remoteproc/imx_rproc.c
index 8424e6ea5569b..7ef99eac37f1a 100644
--- a/drivers/remoteproc/imx_rproc.c
+++ b/drivers/remoteproc/imx_rproc.c
@@ -608,6 +608,10 @@ imx_rproc_elf_find_loaded_rsc_table(struct rproc *rproc, const struct firmware *
{
struct imx_rproc *priv = rproc->priv;
+ /* No resource table in the firmware */
+ if (!rproc->table_ptr)
+ return NULL;
+
if (priv->rsc_table)
return (struct resource_table *)priv->rsc_table;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 657/752] perf/arm-cmn: Reject unsupported hardware configurations
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (196 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 656/752] remoteproc: imx_rproc: Fix invalid loaded resource table detection Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 658/752] scsi: ufs: core: Flush exception handling work when RPM level is zero Sasha Levin
` (86 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Robin Murphy, stable, Ilkka Koskinen, Will Deacon, Sasha Levin
From: Robin Murphy <robin.murphy@arm.com>
[ Upstream commit 36c0de02575ce59dfd879eb4ef63d53a68bbf9ce ]
So far we've been fairly lax about accepting both unknown CMN models
(at least with a warning), and unknown revisions of those which we
do know, as although things do frequently change between releases,
typically enough remains the same to be somewhat useful for at least
some basic bringup checks. However, we also make assumptions of the
maximum supported sizes and numbers of things in various places, and
there's no guarantee that something new might not be bigger and lead
to nasty array overflows. Make sure we only try to run on things that
actually match our assumptions and so will not risk memory corruption.
We have at least always failed on completely unknown node types, so
update that error message for clarity and consistency too.
Cc: stable@vger.kernel.org
Fixes: 7819e05a0dce ("perf/arm-cmn: Revamp model detection")
Reviewed-by: Ilkka Koskinen <ilkka@os.amperecomputing.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/perf/arm-cmn.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/perf/arm-cmn.c b/drivers/perf/arm-cmn.c
index 651edd73bfcb1..4fbafc4b79843 100644
--- a/drivers/perf/arm-cmn.c
+++ b/drivers/perf/arm-cmn.c
@@ -2422,6 +2422,15 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
arm_cmn_init_node_info(cmn, reg & CMN_CHILD_NODE_ADDR, dn);
dn->portid_bits = xp->portid_bits;
dn->deviceid_bits = xp->deviceid_bits;
+ /*
+ * Logical IDs are assigned from 0 per node type, so as
+ * soon as we see one bigger than expected, we can assume
+ * there are more than we can cope with.
+ */
+ if (dn->logid > CMN_MAX_NODES_PER_EVENT) {
+ dev_err(cmn->dev, "Node ID invalid for supported CMN versions: %d\n", dn->logid);
+ return -ENODEV;
+ }
switch (dn->type) {
case CMN_TYPE_DTC:
@@ -2471,7 +2480,7 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
break;
/* Something has gone horribly wrong */
default:
- dev_err(cmn->dev, "invalid device node type: 0x%x\n", dn->type);
+ dev_err(cmn->dev, "Device node type invalid for supported CMN versions: 0x%x\n", dn->type);
return -ENODEV;
}
}
@@ -2499,6 +2508,10 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)
cmn->mesh_x = cmn->num_xps;
cmn->mesh_y = cmn->num_xps / cmn->mesh_x;
+ if (max(cmn->mesh_x, cmn->mesh_y) > CMN_MAX_DIMENSION) {
+ dev_err(cmn->dev, "Mesh size invalid for supported CMN versions: %dx%d\n", cmn->mesh_x, cmn->mesh_y);
+ return -ENODEV;
+ }
/* 1x1 config plays havoc with XP event encodings */
if (cmn->num_xps == 1)
dev_warn(cmn->dev, "1x1 config not fully supported, translate XP events manually\n");
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 658/752] scsi: ufs: core: Flush exception handling work when RPM level is zero
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (197 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 657/752] perf/arm-cmn: Reject unsupported hardware configurations Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 659/752] mm/slab: avoid allocating slabobj_ext array from its own slab Sasha Levin
` (85 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Thomas Yen, Stable Tree, Peter Wang, Bart Van Assche,
Martin K. Petersen, Sasha Levin
From: Thomas Yen <thomasyen@google.com>
[ Upstream commit f8ef441811ec413717f188f63d99182f30f0f08e ]
Ensure that the exception event handling work is explicitly flushed during
suspend when the runtime power management level is set to UFS_PM_LVL_0.
When the RPM level is zero, the device power mode and link state both
remain active. Previously, the UFS core driver bypassed flushing exception
event handling jobs in this configuration. This created a race condition
where the driver could attempt to access the host controller to handle an
exception after the system had already entered a deep power-down state,
resulting in a system crash.
Explicitly flush this work and disable auto BKOPs before the suspend
callback proceeds. This guarantees that pending exception tasks complete
and prevents illegal hardware access during the power-down sequence.
Fixes: 57d104c153d3 ("ufs: add UFS power management support")
Signed-off-by: Thomas Yen <thomasyen@google.com>
Cc: Stable Tree <stable@vger.kernel.org>
Reviewed-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20260129165156.956601-1-thomasyen@google.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ufs/core/ufshcd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 022810b524e96..755aa9c0017df 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -9878,6 +9878,8 @@ static int __ufshcd_wl_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op)
if (req_dev_pwr_mode == UFS_ACTIVE_PWR_MODE &&
req_link_state == UIC_LINK_ACTIVE_STATE) {
+ ufshcd_disable_auto_bkops(hba);
+ flush_work(&hba->eeh_work);
goto vops_suspend;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 659/752] mm/slab: avoid allocating slabobj_ext array from its own slab
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (198 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 658/752] scsi: ufs: core: Flush exception handling work when RPM level is zero Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 660/752] mm/slab: use unsigned long for orig_size to ensure proper metadata align Sasha Levin
` (84 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Harry Yoo, kernel test robot, stable, Hao Li, Vlastimil Babka,
Sasha Levin
From: Harry Yoo <harry.yoo@oracle.com>
[ Upstream commit 280ea9c3154b2af7d841f992c9fc79e9d6534e03 ]
When allocating slabobj_ext array in alloc_slab_obj_exts(), the array
can be allocated from the same slab we're allocating the array for.
This led to obj_exts_in_slab() incorrectly returning true [1],
although the array is not allocated from wasted space of the slab.
Vlastimil Babka observed that this problem should be fixed even when
ignoring its incompatibility with obj_exts_in_slab(), because it creates
slabs that are never freed as there is always at least one allocated
object.
To avoid this, use the next kmalloc size or large kmalloc when
the array can be allocated from the same cache we're allocating
the array for.
In case of random kmalloc caches, there are multiple kmalloc caches
for the same size and the cache is selected based on the caller address.
Because it is fragile to ensure the same caller address is passed to
kmalloc_slab(), kmalloc_noprof(), and kmalloc_node_noprof(), bump the
size to (s->object_size + 1) when the sizes are equal, instead of
directly comparing the kmem_cache pointers.
Note that this doesn't happen when memory allocation profiling is
disabled, as when the allocation of the array is triggered by memory
cgroup (KMALLOC_CGROUP), the array is allocated from KMALLOC_NORMAL.
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202601231457.f7b31e09-lkp@intel.com [1]
Cc: stable@vger.kernel.org
Fixes: 4b8736964640 ("mm/slab: add allocation accounting into slab allocation and free paths")
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Link: https://patch.msgid.link/20260126125714.88008-1-harry.yoo@oracle.com
Reviewed-by: Hao Li <hao.li@linux.dev>
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/slub.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 53 insertions(+), 7 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index 896421a555573..e8cffd89b73d7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -2099,6 +2099,49 @@ static inline void init_slab_obj_exts(struct slab *slab)
slab->obj_exts = 0;
}
+/*
+ * Calculate the allocation size for slabobj_ext array.
+ *
+ * When memory allocation profiling is enabled, the obj_exts array
+ * could be allocated from the same slab cache it's being allocated for.
+ * This would prevent the slab from ever being freed because it would
+ * always contain at least one allocated object (its own obj_exts array).
+ *
+ * To avoid this, increase the allocation size when we detect the array
+ * may come from the same cache, forcing it to use a different cache.
+ */
+static inline size_t obj_exts_alloc_size(struct kmem_cache *s,
+ struct slab *slab, gfp_t gfp)
+{
+ size_t sz = sizeof(struct slabobj_ext) * slab->objects;
+ struct kmem_cache *obj_exts_cache;
+
+ /*
+ * slabobj_ext array for KMALLOC_CGROUP allocations
+ * are served from KMALLOC_NORMAL caches.
+ */
+ if (!mem_alloc_profiling_enabled())
+ return sz;
+
+ if (sz > KMALLOC_MAX_CACHE_SIZE)
+ return sz;
+
+ if (!is_kmalloc_normal(s))
+ return sz;
+
+ obj_exts_cache = kmalloc_slab(sz, NULL, gfp, 0);
+ /*
+ * We can't simply compare s with obj_exts_cache, because random kmalloc
+ * caches have multiple caches per size, selected by caller address.
+ * Since caller address may differ between kmalloc_slab() and actual
+ * allocation, bump size when sizes are equal.
+ */
+ if (s->object_size == obj_exts_cache->object_size)
+ return obj_exts_cache->object_size + 1;
+
+ return sz;
+}
+
int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
gfp_t gfp, bool new_slab)
{
@@ -2107,26 +2150,26 @@ int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
unsigned long new_exts;
unsigned long old_exts;
struct slabobj_ext *vec;
+ size_t sz;
gfp &= ~OBJCGS_CLEAR_MASK;
/* Prevent recursive extension vector allocation */
gfp |= __GFP_NO_OBJ_EXT;
+ sz = obj_exts_alloc_size(s, slab, gfp);
+
/*
* Note that allow_spin may be false during early boot and its
* restricted GFP_BOOT_MASK. Due to kmalloc_nolock() only supporting
* architectures with cmpxchg16b, early obj_exts will be missing for
* very early allocations on those.
*/
- if (unlikely(!allow_spin)) {
- size_t sz = objects * sizeof(struct slabobj_ext);
-
+ if (unlikely(!allow_spin))
vec = kmalloc_nolock(sz, __GFP_ZERO | __GFP_NO_OBJ_EXT,
slab_nid(slab));
- } else {
- vec = kcalloc_node(objects, sizeof(struct slabobj_ext), gfp,
- slab_nid(slab));
- }
+ else
+ vec = kmalloc_node(sz, gfp | __GFP_ZERO, slab_nid(slab));
+
if (!vec) {
/*
* Try to mark vectors which failed to allocate.
@@ -2140,6 +2183,9 @@ int alloc_slab_obj_exts(struct slab *slab, struct kmem_cache *s,
return -ENOMEM;
}
+ VM_WARN_ON_ONCE(virt_to_slab(vec) != NULL &&
+ virt_to_slab(vec)->slab_cache == s);
+
new_exts = (unsigned long)vec;
if (unlikely(!allow_spin))
new_exts |= OBJEXTS_NOSPIN_ALLOC;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 660/752] mm/slab: use unsigned long for orig_size to ensure proper metadata align
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (199 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 659/752] mm/slab: avoid allocating slabobj_ext array from its own slab Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 661/752] MIPS: Loongson2ef: Register PCI controller in early stage Sasha Levin
` (83 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Harry Yoo, Andrey Ryabinin, stable, Vlastimil Babka, Sasha Levin
From: Harry Yoo <harry.yoo@oracle.com>
[ Upstream commit b85f369b81aed457acbea4ad3314218254a72fd2 ]
When both KASAN and SLAB_STORE_USER are enabled, accesses to
struct kasan_alloc_meta fields can be misaligned on 64-bit architectures.
This occurs because orig_size is currently defined as unsigned int,
which only guarantees 4-byte alignment. When struct kasan_alloc_meta is
placed after orig_size, it may end up at a 4-byte boundary rather than
the required 8-byte boundary on 64-bit systems.
Note that 64-bit architectures without HAVE_EFFICIENT_UNALIGNED_ACCESS
are assumed to require 64-bit accesses to be 64-bit aligned.
See HAVE_64BIT_ALIGNED_ACCESS and commit adab66b71abf ("Revert:
"ring-buffer: Remove HAVE_64BIT_ALIGNED_ACCESS"") for more details.
Change orig_size from unsigned int to unsigned long to ensure proper
alignment for any subsequent metadata. This should not waste additional
memory because kmalloc objects are already aligned to at least
ARCH_KMALLOC_MINALIGN.
Closes: https://lore.kernel.org/all/aPrLF0OUK651M4dk@hyeyoo
Suggested-by: Andrey Ryabinin <ryabinin.a.a@gmail.com>
Cc: stable@vger.kernel.org
Fixes: 6edf2576a6cc ("mm/slub: enable debugging memory wasting of kmalloc")
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Closes: https://lore.kernel.org/all/aPrLF0OUK651M4dk@hyeyoo/
Link: https://patch.msgid.link/20260113061845.159790-2-harry.yoo@oracle.com
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/slub.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index e8cffd89b73d7..bc6156801e8e6 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -863,7 +863,7 @@ static inline bool slab_update_freelist(struct kmem_cache *s, struct slab *slab,
* request size in the meta data area, for better debug and sanity check.
*/
static inline void set_orig_size(struct kmem_cache *s,
- void *object, unsigned int orig_size)
+ void *object, unsigned long orig_size)
{
void *p = kasan_reset_tag(object);
@@ -873,10 +873,10 @@ static inline void set_orig_size(struct kmem_cache *s,
p += get_info_end(s);
p += sizeof(struct track) * 2;
- *(unsigned int *)p = orig_size;
+ *(unsigned long *)p = orig_size;
}
-static inline unsigned int get_orig_size(struct kmem_cache *s, void *object)
+static inline unsigned long get_orig_size(struct kmem_cache *s, void *object)
{
void *p = kasan_reset_tag(object);
@@ -889,7 +889,7 @@ static inline unsigned int get_orig_size(struct kmem_cache *s, void *object)
p += get_info_end(s);
p += sizeof(struct track) * 2;
- return *(unsigned int *)p;
+ return *(unsigned long *)p;
}
#ifdef CONFIG_SLUB_DEBUG
@@ -1204,7 +1204,7 @@ static void print_trailer(struct kmem_cache *s, struct slab *slab, u8 *p)
off += 2 * sizeof(struct track);
if (slub_debug_orig_size(s))
- off += sizeof(unsigned int);
+ off += sizeof(unsigned long);
off += kasan_metadata_size(s, false);
@@ -1400,7 +1400,7 @@ static int check_pad_bytes(struct kmem_cache *s, struct slab *slab, u8 *p)
off += 2 * sizeof(struct track);
if (s->flags & SLAB_KMALLOC)
- off += sizeof(unsigned int);
+ off += sizeof(unsigned long);
}
off += kasan_metadata_size(s, false);
@@ -8013,7 +8013,7 @@ static int calculate_sizes(struct kmem_cache_args *args, struct kmem_cache *s)
/* Save the original kmalloc request size */
if (flags & SLAB_KMALLOC)
- size += sizeof(unsigned int);
+ size += sizeof(unsigned long);
}
#endif
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 661/752] MIPS: Loongson2ef: Register PCI controller in early stage
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (200 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 660/752] mm/slab: use unsigned long for orig_size to ensure proper metadata align Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 662/752] MIPS: Loongson2ef: Use pcibios_align_resource() to block io range Sasha Levin
` (82 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Rong Zhang, stable, Beiyan Yun, Yao Zi, Jiaxun Yang,
Thomas Bogendoerfer, Sasha Levin
From: Rong Zhang <rongrong@oss.cipunited.com>
[ Upstream commit 6a00c043af07492502ba7a2263ddc4cdb01b66a7 ]
We are about to set loongson_pci_io_resource.start to 0 and adopt
PCIBIOS_MIN_IO. As the first step, PCI controller needs to be registered
in early stage to make it the root of other resources (e.g., i8259) and
prevent resource conflicts.
Register it in plat_mem_setup() instead of arch_initcall().
Fixes: ae81aad5c2e1 ("MIPS: PCI: Use pci_enable_resources()")
Cc: stable@vger.kernel.org
Tested-by: Beiyan Yun <root@infi.wang>
Tested-by: Yao Zi <me@ziyao.cc>
Signed-off-by: Rong Zhang <rongrong@oss.cipunited.com>
Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/include/asm/mach-loongson2ef/loongson.h | 6 ++++++
arch/mips/loongson2ef/common/pci.c | 7 +------
arch/mips/loongson2ef/common/setup.c | 1 +
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/mips/include/asm/mach-loongson2ef/loongson.h b/arch/mips/include/asm/mach-loongson2ef/loongson.h
index 4a098fb102325..0e586787eb87a 100644
--- a/arch/mips/include/asm/mach-loongson2ef/loongson.h
+++ b/arch/mips/include/asm/mach-loongson2ef/loongson.h
@@ -324,4 +324,10 @@ extern unsigned long _loongson_addrwincfg_base;
#endif /* ! CONFIG_CPU_SUPPORTS_ADDRWINCFG */
+#ifdef CONFIG_PCI
+void loongson2ef_pcibios_init(void);
+#else
+static inline void loongson2ef_pcibios_init(void) { }
+#endif
+
#endif /* __ASM_MACH_LOONGSON2EF_LOONGSON_H */
diff --git a/arch/mips/loongson2ef/common/pci.c b/arch/mips/loongson2ef/common/pci.c
index 7d9ea51e8c01e..55524f9a7b96b 100644
--- a/arch/mips/loongson2ef/common/pci.c
+++ b/arch/mips/loongson2ef/common/pci.c
@@ -73,15 +73,10 @@ static void __init setup_pcimap(void)
#endif
}
-static int __init pcibios_init(void)
+void __init loongson2ef_pcibios_init(void)
{
setup_pcimap();
loongson_pci_controller.io_map_base = mips_io_port_base;
register_pci_controller(&loongson_pci_controller);
-
-
- return 0;
}
-
-arch_initcall(pcibios_init);
diff --git a/arch/mips/loongson2ef/common/setup.c b/arch/mips/loongson2ef/common/setup.c
index 4fd27f4f90edb..a639e35acce59 100644
--- a/arch/mips/loongson2ef/common/setup.c
+++ b/arch/mips/loongson2ef/common/setup.c
@@ -27,4 +27,5 @@ EXPORT_SYMBOL(__wbflush);
void __init plat_mem_setup(void)
{
+ loongson2ef_pcibios_init();
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 662/752] MIPS: Loongson2ef: Use pcibios_align_resource() to block io range
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (201 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 661/752] MIPS: Loongson2ef: Register PCI controller in early stage Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 663/752] PCI: dwc: Fix msg_atu_index assignment Sasha Levin
` (81 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Rong Zhang, stable, Beiyan Yun, Yao Zi, Jiaxun Yang,
Thomas Bogendoerfer, Sasha Levin
From: Rong Zhang <rongrong@oss.cipunited.com>
[ Upstream commit 32ec465103527ede09b640cd0ab0636dc58827fb ]
Loongson2ef reserves io range below 0x4000 (LOONGSON_PCI_IO_START) while
ISA-mode only IDE controller on the south bridge still has a hard
dependency on ISA IO ports.
The reservation was done by lifting loongson_pci_io_resource.start onto
0x4000. Prior to commit ae81aad5c2e1 ("MIPS: PCI: Use
pci_enable_resources()"), the arch specific pcibios_enable_resources()
did not check if the resources were claimed, which diverges from what
PCI core checks, effectively hiding the fact that IDE IO resources were
not properly within the resource tree. After starting to use
pcibios_enable_resources() from PCI core, enabling IDE controller fails:
pata_cs5536 0000:00:0e.2: BAR 0 [io 0x01f0-0x01f7]: not claimed; can't enable device
pata_cs5536 0000:00:0e.2: probe with driver pata_cs5536 failed with error -22
MIPS PCI code already has support for enforcing lower bounds using
PCIBIOS_MIN_IO in pcibios_align_resource() without altering the IO
window start address itself. Make Loongson2ef PCI code use
PCIBIOS_MIN_IO too.
Fixes: ae81aad5c2e1 ("MIPS: PCI: Use pci_enable_resources()")
Cc: stable@vger.kernel.org
Tested-by: Beiyan Yun <root@infi.wang>
Tested-by: Yao Zi <me@ziyao.cc>
Signed-off-by: Rong Zhang <rongrong@oss.cipunited.com>
Acked-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/loongson2ef/common/pci.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/arch/mips/loongson2ef/common/pci.c b/arch/mips/loongson2ef/common/pci.c
index 55524f9a7b96b..0f11392104bfd 100644
--- a/arch/mips/loongson2ef/common/pci.c
+++ b/arch/mips/loongson2ef/common/pci.c
@@ -17,7 +17,7 @@ static struct resource loongson_pci_mem_resource = {
static struct resource loongson_pci_io_resource = {
.name = "pci io space",
- .start = LOONGSON_PCI_IO_START,
+ .start = 0x00000000UL, /* See loongson2ef_pcibios_init(). */
.end = IO_SPACE_LIMIT,
.flags = IORESOURCE_IO,
};
@@ -77,6 +77,15 @@ void __init loongson2ef_pcibios_init(void)
{
setup_pcimap();
+ /*
+ * ISA-mode only IDE controllers have a hard dependency on ISA IO ports.
+ *
+ * Claim them by setting PCI IO space to start at 0x00000000, and set
+ * PCIBIOS_MIN_IO to prevent non-legacy PCI devices from touching
+ * reserved regions.
+ */
+ PCIBIOS_MIN_IO = LOONGSON_PCI_IO_START;
+
loongson_pci_controller.io_map_base = mips_io_port_base;
register_pci_controller(&loongson_pci_controller);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 663/752] PCI: dwc: Fix msg_atu_index assignment
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (202 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 662/752] MIPS: Loongson2ef: Use pcibios_align_resource() to block io range Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 664/752] mux: mmio: fix regmap leak on probe failure Sasha Levin
` (80 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Niklas Cassel, Manivannan Sadhasivam, Maciej W. Rozycki,
Damien Le Moal, Hans Zhang, Frank Li, Shawn Lin, stable,
Sasha Levin
From: Niklas Cassel <cassel@kernel.org>
[ Upstream commit 58fbf08935d9c4396417e5887df89a4e681fa7e3 ]
When dw_pcie_iatu_setup() configures outbound address translation for both
type PCIE_ATU_TYPE_MEM and PCIE_ATU_TYPE_IO, the iATU index to use is
incremented before calling dw_pcie_prog_outbound_atu().
However for msg_atu_index, the index is not incremented before use,
causing the iATU index to be the same as the last configured iATU index,
which means that it will incorrectly use the same iATU index that is
already in use, breaking outbound address translation.
In total there are three problems with this code:
-It assigns msg_atu_index the same index that was used for the last
outbound address translation window, rather than incrementing the index
before assignment.
-The index should only be incremented (and msg_atu_index assigned) if the
use_atu_msg feature is actually requested/in use (pp->use_atu_msg is set).
-If the use_atu_msg feature is requested/in use, and there are no outbound
iATUs available, the code should return an error, as otherwise when this
this feature is used, it will use an iATU index that is out of bounds.
Fixes: e1a4ec1a9520 ("PCI: dwc: Add generic MSG TLP support for sending PME_Turn_Off when system suspend")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <mani@kernel.org>
Tested-by: Maciej W. Rozycki <macro@orcam.me.uk>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hans Zhang <zhanghuabing@ecosda.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260127151038.1484881-6-cassel@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index 03d01d051e9b0..925d5f818f12b 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -936,7 +936,14 @@ static int dw_pcie_iatu_setup(struct dw_pcie_rp *pp)
dev_warn(pci->dev, "Ranges exceed outbound iATU size (%d)\n",
pci->num_ob_windows);
- pp->msg_atu_index = i;
+ if (pp->use_atu_msg) {
+ if (pci->num_ob_windows > ++i) {
+ pp->msg_atu_index = i;
+ } else {
+ dev_err(pci->dev, "Cannot add outbound window for MSG TLP\n");
+ return -ENOMEM;
+ }
+ }
i = 0;
resource_list_for_each_entry(entry, &pp->bridge->dma_ranges) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 664/752] mux: mmio: fix regmap leak on probe failure
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (203 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 663/752] PCI: dwc: Fix msg_atu_index assignment Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 668/752] tipc: fix RCU dereference race in tipc_aead_users_dec() Sasha Levin
` (79 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Johan Hovold, stable, Andrew Davis, Greg Kroah-Hartman,
Sasha Levin
From: Johan Hovold <johan@kernel.org>
[ Upstream commit 3c4ae63073d84abee5d81ce46d86a94e9dae9c89 ]
The mmio regmap that may be allocated during probe is never freed.
Switch to using the device managed allocator so that the regmap is
released on probe failures (e.g. probe deferral) and on driver unbind.
Fixes: 61de83fd8256 ("mux: mmio: Do not use syscon helper to build regmap")
Cc: stable@vger.kernel.org # 6.16
Cc: Andrew Davis <afd@ti.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Acked-by: Andrew Davis <afd@ti.com>
Link: https://patch.msgid.link/20251127134702.1915-1-johan@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mux/mmio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mux/mmio.c b/drivers/mux/mmio.c
index 9993ce38a818d..5b0171d19d430 100644
--- a/drivers/mux/mmio.c
+++ b/drivers/mux/mmio.c
@@ -58,7 +58,7 @@ static int mux_mmio_probe(struct platform_device *pdev)
if (IS_ERR(base))
regmap = ERR_PTR(-ENODEV);
else
- regmap = regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
+ regmap = devm_regmap_init_mmio(dev, base, &mux_mmio_regmap_cfg);
/* Fallback to checking the parent node on "real" errors. */
if (IS_ERR(regmap) && regmap != ERR_PTR(-EPROBE_DEFER)) {
regmap = dev_get_regmap(dev->parent, NULL);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 668/752] tipc: fix RCU dereference race in tipc_aead_users_dec()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (204 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 664/752] mux: mmio: fix regmap leak on probe failure Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 669/752] drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set() Sasha Levin
` (78 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Daniel Hodges, stable, Eric Dumazet, Jakub Kicinski, Sasha Levin
From: Daniel Hodges <hodgesd@meta.com>
[ Upstream commit 6a65c0cb0ff20b3cbc5f1c87b37dd22cdde14a1c ]
tipc_aead_users_dec() calls rcu_dereference(aead) twice: once to store
in 'tmp' for the NULL check, and again inside the atomic_add_unless()
call.
Use the already-dereferenced 'tmp' pointer consistently, matching the
correct pattern used in tipc_aead_users_inc() and tipc_aead_users_set().
Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication")
Cc: stable@vger.kernel.org
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Daniel Hodges <hodgesd@meta.com>
Link: https://patch.msgid.link/20260203145621.17399-1-git@danielhodges.dev
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/tipc/crypto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
index 970db62bd029b..a3f9ca28c3d53 100644
--- a/net/tipc/crypto.c
+++ b/net/tipc/crypto.c
@@ -460,7 +460,7 @@ static void tipc_aead_users_dec(struct tipc_aead __rcu *aead, int lim)
rcu_read_lock();
tmp = rcu_dereference(aead);
if (tmp)
- atomic_add_unless(&rcu_dereference(aead)->users, -1, lim);
+ atomic_add_unless(&tmp->users, -1, lim);
rcu_read_unlock();
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 669/752] drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (205 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 668/752] tipc: fix RCU dereference race in tipc_aead_users_dec() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 670/752] drm/amdgpu: Protect GPU register accesses in powergated state in some paths Sasha Levin
` (77 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Sunday Clement, Alexander Deucher, Alex Deucher, stable,
Sasha Levin
From: Sunday Clement <Sunday.Clement@amd.com>
[ Upstream commit 8a70a26c9f34baea6c3199a9862ddaff4554a96d ]
The kfd_event_page_set() function writes KFD_SIGNAL_EVENT_LIMIT * 8
bytes via memset without checking the buffer size parameter. This allows
unprivileged userspace to trigger an out-of bounds kernel memory write
by passing a small buffer, leading to potential privilege
escalation.
Signed-off-by: Sunday Clement <Sunday.Clement@amd.com>
Reviewed-by: Alexander Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdkfd/kfd_events.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_events.c b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
index 82905f3e54ddd..261db87e86fe6 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_events.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_events.c
@@ -331,6 +331,12 @@ static int kfd_event_page_set(struct kfd_process *p, void *kernel_address,
if (p->signal_page)
return -EBUSY;
+ if (size < KFD_SIGNAL_EVENT_LIMIT * 8) {
+ pr_err("Event page size %llu is too small, need at least %lu bytes\n",
+ size, (unsigned long)(KFD_SIGNAL_EVENT_LIMIT * 8));
+ return -EINVAL;
+ }
+
page = kzalloc(sizeof(*page), GFP_KERNEL);
if (!page)
return -ENOMEM;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 670/752] drm/amdgpu: Protect GPU register accesses in powergated state in some paths
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (206 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 669/752] drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 671/752] net: cpsw_new: Fix unnecessary netdev unregistration in cpsw_probe() error path Sasha Levin
` (76 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Yifan Zhang, Alex Deucher, Lijo Lazar, stable, Sasha Levin
From: Yifan Zhang <yifan1.zhang@amd.com>
[ Upstream commit 39fc2bc4da0082c226cbee331f0a5d44db3997da ]
Ungate GPU CG/PG in device_fini_hw and device_halt to protect GPU
register accesses, e.g. GC registers are accessed in amdgpu_irq_disable_all()
and amdgpu_fence_driver_hw_fini().
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index c052da36aa9c2..b28ebb44c695d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3630,9 +3630,6 @@ static int amdgpu_device_ip_fini_early(struct amdgpu_device *adev)
}
}
- amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
- amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
-
amdgpu_amdkfd_suspend(adev, true);
amdgpu_userq_suspend(adev);
@@ -4961,6 +4958,9 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)
amdgpu_virt_fini_data_exchange(adev);
}
+ amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
+ amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
+
/* disable all interrupts */
amdgpu_irq_disable_all(adev);
if (adev->mode_info.mode_config_initialized) {
@@ -7354,6 +7354,9 @@ void amdgpu_device_halt(struct amdgpu_device *adev)
amdgpu_xcp_dev_unplug(adev);
drm_dev_unplug(ddev);
+ amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
+ amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
+
amdgpu_irq_disable_all(adev);
amdgpu_fence_driver_hw_fini(adev);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 671/752] net: cpsw_new: Fix unnecessary netdev unregistration in cpsw_probe() error path
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (207 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 670/752] drm/amdgpu: Protect GPU register accesses in powergated state in some paths Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 672/752] net: cpsw_new: Fix potential unregister of netdev that has not been registered yet Sasha Levin
` (75 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Kevin Hao, stable, Alexander Sverdlin, Jakub Kicinski,
Sasha Levin
From: Kevin Hao <haokexin@gmail.com>
[ Upstream commit 62db84b7efa63b78aed9fdbdae90f198771be94c ]
The current error handling in cpsw_probe() has two issues:
- cpsw_unregister_ports() may be called before cpsw_register_ports() has
been executed.
- cpsw_unregister_ports() is already invoked within cpsw_register_ports()
in case of a register_netdev() failure, but the error path would call
it again.
Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://patch.msgid.link/20260205-cpsw-error-path-v1-1-6e58bae6b299@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/cpsw_new.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 371a099ac4e63..4d763e571cfa9 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -2001,7 +2001,7 @@ static int cpsw_probe(struct platform_device *pdev)
/* setup netdevs */
ret = cpsw_create_ports(cpsw);
if (ret)
- goto clean_unregister_netdev;
+ goto clean_cpts;
/* Grab RX and TX IRQs. Note that we also have RX_THRESHOLD and
* MISC IRQs which are always kept disabled with this driver so
@@ -2015,14 +2015,14 @@ static int cpsw_probe(struct platform_device *pdev)
0, dev_name(dev), cpsw);
if (ret < 0) {
dev_err(dev, "error attaching irq (%d)\n", ret);
- goto clean_unregister_netdev;
+ goto clean_cpts;
}
ret = devm_request_irq(dev, cpsw->irqs_table[1], cpsw_tx_interrupt,
0, dev_name(dev), cpsw);
if (ret < 0) {
dev_err(dev, "error attaching irq (%d)\n", ret);
- goto clean_unregister_netdev;
+ goto clean_cpts;
}
if (!cpsw->cpts)
@@ -2032,7 +2032,7 @@ static int cpsw_probe(struct platform_device *pdev)
0, dev_name(&pdev->dev), cpsw);
if (ret < 0) {
dev_err(dev, "error attaching misc irq (%d)\n", ret);
- goto clean_unregister_netdev;
+ goto clean_cpts;
}
/* Enable misc CPTS evnt_pend IRQ */
@@ -2041,7 +2041,7 @@ static int cpsw_probe(struct platform_device *pdev)
skip_cpts:
ret = cpsw_register_notifiers(cpsw);
if (ret)
- goto clean_unregister_netdev;
+ goto clean_cpts;
ret = cpsw_register_devlink(cpsw);
if (ret)
@@ -2063,8 +2063,6 @@ static int cpsw_probe(struct platform_device *pdev)
clean_unregister_notifiers:
cpsw_unregister_notifiers(cpsw);
-clean_unregister_netdev:
- cpsw_unregister_ports(cpsw);
clean_cpts:
cpts_release(cpsw->cpts);
cpdma_ctlr_destroy(cpsw->dma);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 672/752] net: cpsw_new: Fix potential unregister of netdev that has not been registered yet
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (208 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 671/752] net: cpsw_new: Fix unnecessary netdev unregistration in cpsw_probe() error path Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 673/752] PCI: Don't claim disabled bridge windows Sasha Levin
` (74 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Kevin Hao, stable, Alexander Sverdlin, Jakub Kicinski,
Sasha Levin
From: Kevin Hao <haokexin@gmail.com>
[ Upstream commit 9d724b34fbe13b71865ad0906a4be97571f19cf5 ]
If an error occurs during register_netdev() for the first MAC in
cpsw_register_ports(), even though cpsw->slaves[0].ndev is set to NULL,
cpsw->slaves[1].ndev would remain unchanged. This could later cause
cpsw_unregister_ports() to attempt unregistering the second MAC.
To address this, add a check for ndev->reg_state before calling
unregister_netdev(). With this change, setting cpsw->slaves[i].ndev
to NULL becomes unnecessary and can be removed accordingly.
Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Cc: stable@vger.kernel.org
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://patch.msgid.link/20260205-cpsw-error-path-v1-2-6e58bae6b299@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/cpsw_new.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 4d763e571cfa9..fd3931d667021 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -1472,7 +1472,7 @@ static void cpsw_unregister_ports(struct cpsw_common *cpsw)
for (i = 0; i < cpsw->data.slaves; i++) {
ndev = cpsw->slaves[i].ndev;
- if (!ndev)
+ if (!ndev || ndev->reg_state != NETREG_REGISTERED)
continue;
priv = netdev_priv(ndev);
@@ -1494,7 +1494,6 @@ static int cpsw_register_ports(struct cpsw_common *cpsw)
if (ret) {
dev_err(cpsw->dev,
"cpsw: err registering net device%d\n", i);
- cpsw->slaves[i].ndev = NULL;
break;
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 673/752] PCI: Don't claim disabled bridge windows
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (209 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 672/752] net: cpsw_new: Fix potential unregister of netdev that has not been registered yet Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 674/752] PCI: Fix pci_slot_trylock() error handling Sasha Levin
` (73 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Ilpo Järvinen, Sizhe Liu, Bjorn Helgaas, stable, Sasha Levin
From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
[ Upstream commit 2ecc1bf14e2fdaff78bd1b8e7ed3dba336a3fad5 ]
The commit 8278c6914306 ("PCI: Preserve bridge window resource type flags")
changed bridge window resource behavior such that flags are no longer zero
if the bridge window is not valid or is disabled (mainly to preserve the
type flags for later use). If a bridge window has its limit smaller than
base address, pci_read_bridge_*() sets both IORESOURCE_UNSET and
IORESOURCE_DISABLED to indicate the bridge window exists but is not valid
with the current base and limit configuration.
The code in pci_claim_bridge_resources() still depends on the old behavior
of checking validity of the bridge window solely based on !r->flags,
whereas after 8278c6914306, also IORESOURCE_DISABLED may indicate bridge
window addresses are not valid.
While pci_claim_resource() does check IORESOURCE_UNSET,
pci_claim_bridge_resource() attempts to clip the resource if
pci_claim_resource() fails, which is not correct for bridge window
resources that are not valid. As pci_bus_clip_resource() performs clipping
regardless of flags and then clears IORESOURCE_UNSET, it should not be
called unless the resource is valid.
The problem is visible in this log:
pci 0000:20:00.0: PCI bridge to [bus 21]
pci 0000:20:00.0: bridge window [io size 0x0000 disabled]: can't claim; no address assigned
pci 0000:20:00.0: [io 0x0000-0xffffffffffffffff disabled] clipped to [io 0x0000-0xffff disabled]
Add IORESOURCE_DISABLED check in pci_claim_bridge_resources() to only
claim bridge windows that appear to have a valid configuration.
Fixes: 8278c6914306 ("PCI: Preserve bridge window resource type flags")
Reported-by: Sizhe Liu <liusizhe5@huawei.com>
Link: https://lore.kernel.org/all/20260203023545.2753811-1-liusizhe5@huawei.com
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/4d9228d6-a230-6ddf-e300-fbf42d523863@linux.intel.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/setup-bus.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c
index 5d15298469cbc..c2d640164f697 100644
--- a/drivers/pci/setup-bus.c
+++ b/drivers/pci/setup-bus.c
@@ -1681,6 +1681,8 @@ static void pci_claim_bridge_resources(struct pci_dev *dev)
if (!r->flags || r->parent)
continue;
+ if (r->flags & IORESOURCE_DISABLED)
+ continue;
pci_claim_bridge_resource(dev, i);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 674/752] PCI: Fix pci_slot_trylock() error handling
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (210 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 673/752] PCI: Don't claim disabled bridge windows Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 675/752] parisc: kernel: replace kfree() with put_device() in create_tree_node() Sasha Levin
` (72 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Jinhui Guo, Bjorn Helgaas, Dan Williams, stable, Sasha Levin
From: Jinhui Guo <guojinhui.liam@bytedance.com>
[ Upstream commit 9368d1ee62829b08aa31836b3ca003803caf0b72 ]
Commit a4e772898f8b ("PCI: Add missing bridge lock to pci_bus_lock()")
delegates the bridge device's pci_dev_trylock() to pci_bus_trylock() in
pci_slot_trylock(), but it forgets to remove the corresponding
pci_dev_unlock() when pci_bus_trylock() fails.
Before a4e772898f8b, the code did:
if (!pci_dev_trylock(dev)) /* <- lock bridge device */
goto unlock;
if (dev->subordinate) {
if (!pci_bus_trylock(dev->subordinate)) {
pci_dev_unlock(dev); /* <- unlock bridge device */
goto unlock;
}
}
After a4e772898f8b the bridge-device lock is no longer taken, but the
pci_dev_unlock(dev) on the failure path was left in place, leading to the
bug.
This yields one of two errors:
1. A warning that the lock is being unlocked when no one holds it.
2. An incorrect unlock of a lock that belongs to another thread.
Fix it by removing the now-redundant pci_dev_unlock(dev) on the failure
path.
[Same patch later posted by Keith at
https://patch.msgid.link/20260116184150.3013258-1-kbusch@meta.com]
Fixes: a4e772898f8b ("PCI: Add missing bridge lock to pci_bus_lock()")
Signed-off-by: Jinhui Guo <guojinhui.liam@bytedance.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251212145528.2555-1-guojinhui.liam@bytedance.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/pci/pci.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 7858121344655..d4e70570d09f2 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -5500,10 +5500,8 @@ static int pci_slot_trylock(struct pci_slot *slot)
if (!dev->slot || dev->slot != slot)
continue;
if (dev->subordinate) {
- if (!pci_bus_trylock(dev->subordinate)) {
- pci_dev_unlock(dev);
+ if (!pci_bus_trylock(dev->subordinate))
goto unlock;
- }
} else if (!pci_dev_trylock(dev))
goto unlock;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 675/752] parisc: kernel: replace kfree() with put_device() in create_tree_node()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (211 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 674/752] PCI: Fix pci_slot_trylock() error handling Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 676/752] mptcp: pm: in-kernel: always set ID as avail when rm endp Sasha Levin
` (71 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Haoxiang Li, stable, Helge Deller, Sasha Levin
From: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
[ Upstream commit dcf69599c47f29ce0a99117eb3f9ddcd2c4e78b6 ]
If device_register() fails, put_device() is the correct way to
drop the device reference.
Found by code review.
Fixes: 1070c9655b90 ("[PA-RISC] Fix must_check warnings in drivers.c")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/parisc/kernel/drivers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
index 1f8936fc22928..427e1334f8352 100644
--- a/arch/parisc/kernel/drivers.c
+++ b/arch/parisc/kernel/drivers.c
@@ -435,7 +435,7 @@ static struct parisc_device * __init create_tree_node(char id,
dev->dev.dma_mask = &dev->dma_mask;
dev->dev.coherent_dma_mask = dev->dma_mask;
if (device_register(&dev->dev)) {
- kfree(dev);
+ put_device(&dev->dev);
return NULL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 676/752] mptcp: pm: in-kernel: always set ID as avail when rm endp
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (212 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 675/752] parisc: kernel: replace kfree() with put_device() in create_tree_node() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 677/752] staging: rtl8723bs: fix null dereference in find_network Sasha Levin
` (70 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Matthieu Baerts (NGI0), stable, syzbot+f56f7d56e2c6e11a01b6,
Mat Martineau, Jakub Kicinski, Sasha Levin
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
[ Upstream commit d191101dee25567c2af3b28565f45346c33d65f5 ]
Syzkaller managed to find a combination of actions that was generating
this warning:
WARNING: net/mptcp/pm_kernel.c:1074 at __mark_subflow_endp_available net/mptcp/pm_kernel.c:1074 [inline], CPU#1: syz.7.48/2535
WARNING: net/mptcp/pm_kernel.c:1074 at mptcp_pm_nl_fullmesh net/mptcp/pm_kernel.c:1446 [inline], CPU#1: syz.7.48/2535
WARNING: net/mptcp/pm_kernel.c:1074 at mptcp_pm_nl_set_flags_all net/mptcp/pm_kernel.c:1474 [inline], CPU#1: syz.7.48/2535
WARNING: net/mptcp/pm_kernel.c:1074 at mptcp_pm_nl_set_flags+0x5de/0x640 net/mptcp/pm_kernel.c:1538, CPU#1: syz.7.48/2535
Modules linked in:
CPU: 1 UID: 0 PID: 2535 Comm: syz.7.48 Not tainted 6.18.0-03987-gea5f5e676cf5 #17 PREEMPT(voluntary)
Hardware name: QEMU Ubuntu 25.10 PC (i440FX + PIIX, 1996), BIOS 1.17.0-debian-1.17.0-1 04/01/2014
RIP: 0010:__mark_subflow_endp_available net/mptcp/pm_kernel.c:1074 [inline]
RIP: 0010:mptcp_pm_nl_fullmesh net/mptcp/pm_kernel.c:1446 [inline]
RIP: 0010:mptcp_pm_nl_set_flags_all net/mptcp/pm_kernel.c:1474 [inline]
RIP: 0010:mptcp_pm_nl_set_flags+0x5de/0x640 net/mptcp/pm_kernel.c:1538
Code: 89 c7 e8 c5 8c 73 fe e9 f7 fd ff ff 49 83 ef 80 e8 b7 8c 73 fe 4c 89 ff be 03 00 00 00 e8 4a 29 e3 fe eb ac e8 a3 8c 73 fe 90 <0f> 0b 90 e9 3d ff ff ff e8 95 8c 73 fe b8 a1 ff ff ff eb 1a e8 89
RSP: 0018:ffffc9001535b820 EFLAGS: 00010287
netdevsim0: tun_chr_ioctl cmd 1074025677
RAX: ffffffff82da294d RBX: 0000000000000001 RCX: 0000000000080000
RDX: ffffc900096d0000 RSI: 00000000000006d6 RDI: 00000000000006d7
netdevsim0: linktype set to 823
RBP: ffff88802cdb2240 R08: 00000000000104ae R09: ffffffffffffffff
R10: ffffffff82da27d4 R11: 0000000000000000 R12: 0000000000000000
R13: ffff88801246d8c0 R14: ffffc9001535b8b8 R15: ffff88802cdb1800
FS: 00007fc6ac5a76c0(0000) GS:ffff8880f90c8000(0000) knlGS:0000000000000000
netlink: 'syz.3.50': attribute type 5 has an invalid length.
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
netlink: 1232 bytes leftover after parsing attributes in process `syz.3.50'.
CR2: 0000200000010000 CR3: 0000000025b1a000 CR4: 0000000000350ef0
Call Trace:
<TASK>
mptcp_pm_set_flags net/mptcp/pm_netlink.c:277 [inline]
mptcp_pm_nl_set_flags_doit+0x1d7/0x210 net/mptcp/pm_netlink.c:282
genl_family_rcv_msg_doit+0x117/0x180 net/netlink/genetlink.c:1115
genl_family_rcv_msg net/netlink/genetlink.c:1195 [inline]
genl_rcv_msg+0x3a8/0x3f0 net/netlink/genetlink.c:1210
netlink_rcv_skb+0x16d/0x240 net/netlink/af_netlink.c:2550
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1219
netlink_unicast_kernel net/netlink/af_netlink.c:1318 [inline]
netlink_unicast+0x3e9/0x4c0 net/netlink/af_netlink.c:1344
netlink_sendmsg+0x4ab/0x5b0 net/netlink/af_netlink.c:1894
sock_sendmsg_nosec net/socket.c:718 [inline]
__sock_sendmsg+0xc9/0xf0 net/socket.c:733
____sys_sendmsg+0x272/0x3b0 net/socket.c:2608
___sys_sendmsg+0x2de/0x320 net/socket.c:2662
__sys_sendmsg net/socket.c:2694 [inline]
__do_sys_sendmsg net/socket.c:2699 [inline]
__se_sys_sendmsg net/socket.c:2697 [inline]
__x64_sys_sendmsg+0x110/0x1a0 net/socket.c:2697
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xed/0x360 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fc6adb66f6d
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fc6ac5a6ff8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fc6addf5fa0 RCX: 00007fc6adb66f6d
RDX: 0000000000048084 RSI: 00002000000002c0 RDI: 000000000000000e
RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
netlink: 'syz.5.51': attribute type 2 has an invalid length.
R13: 00007fff25e91fe0 R14: 00007fc6ac5a7ce4 R15: 00007fff25e920d7
</TASK>
The actions that caused that seem to be:
- Create an MPTCP endpoint for address A without any flags
- Create a new MPTCP connection from address A
- Remove the MPTCP endpoint: the corresponding subflows will be removed
- Recreate the endpoint with the same ID, but with the subflow flag
- Change the same endpoint to add the fullmesh flag
In this case, msk->pm.local_addr_used has been kept to 0 as expected,
but the corresponding bit in msk->pm.id_avail_bitmap was still unset
after having removed the endpoint, causing the splat later on.
When removing an endpoint, the corresponding endpoint ID was only marked
as available for "signal" types with an announced address, plus all
"subflow" types, but not the other types like an endpoint corresponding
to the initial subflow. In these cases, re-creating an endpoint with the
same ID didn't signal/create anything. Here, adding the fullmesh flag
was creating the splat when calling __mark_subflow_endp_available() from
mptcp_pm_nl_fullmesh(), because msk->pm.local_addr_used was set to 0
while the ID was marked as used.
To fix this issue, the corresponding bit in msk->pm.id_avail_bitmap can
always be set as available when removing an MPTCP in-kernel endpoint. In
other words, moving the call to __set_bit() to do it in all cases,
except for "subflow" types where this bit is handled in a dedicated
helper.
Note: instead of adding a new spin_(un)lock_bh that would be taken in
all cases, do all the actions requiring the spin lock under the same
block.
This modification potentially fixes another issue reported by syzbot,
see [1]. But without a reproducer or more details about what exactly
happened before, it is hard to confirm.
Fixes: e255683c06df ("mptcp: pm: re-using ID of unused removed ADD_ADDR")
Cc: stable@vger.kernel.org
Closes: https://github.com/multipath-tcp/mptcp_net-next/issues/606
Reported-by: syzbot+f56f7d56e2c6e11a01b6@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/68fcfc4a.050a0220.346f24.02fb.GAE@google.com [1]
Reviewed-by: Mat Martineau <martineau@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20260205-net-mptcp-misc-fixes-6-19-rc8-v2-1-c2720ce75c34@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/mptcp/pm_kernel.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/net/mptcp/pm_kernel.c b/net/mptcp/pm_kernel.c
index 1b517a81e0299..f47c91141631f 100644
--- a/net/mptcp/pm_kernel.c
+++ b/net/mptcp/pm_kernel.c
@@ -1042,10 +1042,8 @@ static bool mptcp_pm_remove_anno_addr(struct mptcp_sock *msk,
ret = mptcp_remove_anno_list_by_saddr(msk, addr);
if (ret || force) {
spin_lock_bh(&msk->pm.lock);
- if (ret) {
- __set_bit(addr->id, msk->pm.id_avail_bitmap);
+ if (ret)
msk->pm.add_addr_signaled--;
- }
mptcp_pm_remove_addr(msk, &list);
spin_unlock_bh(&msk->pm.lock);
}
@@ -1083,17 +1081,15 @@ static int mptcp_nl_remove_subflow_and_signal_addr(struct net *net,
!(entry->flags & MPTCP_PM_ADDR_FLAG_IMPLICIT));
list.ids[0] = mptcp_endp_get_local_id(msk, addr);
- if (remove_subflow) {
- spin_lock_bh(&msk->pm.lock);
- mptcp_pm_rm_subflow(msk, &list);
- spin_unlock_bh(&msk->pm.lock);
- }
- if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW) {
- spin_lock_bh(&msk->pm.lock);
+ spin_lock_bh(&msk->pm.lock);
+ if (remove_subflow)
+ mptcp_pm_rm_subflow(msk, &list);
+ if (entry->flags & MPTCP_PM_ADDR_FLAG_SUBFLOW)
__mark_subflow_endp_available(msk, list.ids[0]);
- spin_unlock_bh(&msk->pm.lock);
- }
+ else /* mark endp ID as available, e.g. Signal or MPC endp */
+ __set_bit(addr->id, msk->pm.id_avail_bitmap);
+ spin_unlock_bh(&msk->pm.lock);
if (msk->mpc_endpoint_id == entry->addr.id)
msk->mpc_endpoint_id = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 677/752] staging: rtl8723bs: fix null dereference in find_network
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (213 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 676/752] mptcp: pm: in-kernel: always set ID as avail when rm endp Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 678/752] kcsan, compiler_types: avoid duplicate type issues in BPF Type Format Sasha Levin
` (69 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Ethan Tidmore, stable, Greg Kroah-Hartman, Sasha Levin
From: Ethan Tidmore <ethantidmore06@gmail.com>
[ Upstream commit 41460a19654c32d39fd0e3a3671cd8d4b7b8479f ]
The variable pwlan has the possibility of being NULL when passed into
rtw_free_network_nolock() which would later dereference the variable.
Fixes: 554c0a3abf21 ("staging: Add rtl8723bs sdio wifi driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260202205429.20181-1-ethantidmore06@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/staging/rtl8723bs/core/rtw_mlme.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
index c06d990350e69..362c904adddc5 100644
--- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
@@ -835,8 +835,10 @@ static void find_network(struct adapter *adapter)
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
- if (pwlan)
- pwlan->fixed = false;
+ if (!pwlan)
+ return;
+
+ pwlan->fixed = false;
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) &&
(adapter->stapriv.asoc_sta_count == 1))
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 678/752] kcsan, compiler_types: avoid duplicate type issues in BPF Type Format
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (214 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 677/752] staging: rtl8723bs: fix null dereference in find_network Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 679/752] watchdog/softlockup: fix sample ring index wrap in need_counting_irqs() Sasha Levin
` (68 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Alan Maguire, Nilay Shroff, Marco Elver, Yonghong Song,
Alexei Starovoitov, Andrii Nakryiko, Bart van Assche,
Daniel Borkman, Eduard Zingerman, Hao Luo, Heiko Carstens,
H. Peter Anvin, Jason A. Donenfeld, Jiri Olsa, John Fastabend,
Kees Cook, KP Singh, Martin KaFai Lau, Miguel Ojeda, Naman Jain,
Nathan Chancellor, Paul E . McKenney, Peter Zijlstra,
Stanislav Fomichev, Uros Bizjak, stable, Andrew Morton,
Sasha Levin
From: Alan Maguire <alan.maguire@oracle.com>
[ Upstream commit 9dc052234da736f7749f19ab6936342ec7dbe3ac ]
Enabling KCSAN is causing a large number of duplicate types in BTF for
core kernel structs like task_struct [1]. This is due to the definition
in include/linux/compiler_types.h
`#ifdef __SANITIZE_THREAD__
...
`#define __data_racy volatile
..
`#else
...
`#define __data_racy
...
`#endif
Because some objects in the kernel are compiled without KCSAN flags
(KCSAN_SANITIZE) we sometimes get the empty __data_racy annotation for
objects; as a result we get multiple conflicting representations of the
associated structs in DWARF, and these lead to multiple instances of core
kernel types in BTF since they cannot be deduplicated due to the
additional modifier in some instances.
Moving the __data_racy definition under CONFIG_KCSAN avoids this problem,
since the volatile modifier will be present for both KCSAN and
KCSAN_SANITIZE objects in a CONFIG_KCSAN=y kernel.
Link: https://lkml.kernel.org/r/20260116091730.324322-1-alan.maguire@oracle.com
Fixes: 31f605a308e6 ("kcsan, compiler_types: Introduce __data_racy type qualifier")
Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Reported-by: Nilay Shroff <nilay@linux.ibm.com>
Tested-by: Nilay Shroff <nilay@linux.ibm.com>
Suggested-by: Marco Elver <elver@google.com>
Reviewed-by: Marco Elver <elver@google.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Andrii Nakryiko <andrii.nakryiko@gmail.com>
Cc: Bart van Assche <bvanassche@acm.org>
Cc: Daniel Borkman <daniel@iogearbox.net>
Cc: Eduard Zingerman <eddyz87@gmail.com>
Cc: Hao Luo <haoluo@google.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Jason A. Donenfeld <jason@zx2c4.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: John Fastabend <john.fastabend@gmail.com>
Cc: Kees Cook <kees@kernel.org>
Cc: KP Singh <kpsingh@kernel.org>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: Miguel Ojeda <ojeda@kernel.org>
Cc: Naman Jain <namjain@linux.microsoft.com>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: "Paul E . McKenney" <paulmck@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stanislav Fomichev <sdf@fomichev.me>
Cc: Uros Bizjak <ubizjak@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/compiler_types.h | 23 ++++++++++++++++-------
1 file changed, 16 insertions(+), 7 deletions(-)
diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h
index 8128a445f0480..2998af80cbef3 100644
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -303,6 +303,22 @@ struct ftrace_likely_data {
# define __no_kasan_or_inline __always_inline
#endif
+#ifdef CONFIG_KCSAN
+/*
+ * Type qualifier to mark variables where all data-racy accesses should be
+ * ignored by KCSAN. Note, the implementation simply marks these variables as
+ * volatile, since KCSAN will treat such accesses as "marked".
+ *
+ * Defined here because defining __data_racy as volatile for KCSAN objects only
+ * causes problems in BPF Type Format (BTF) generation since struct members
+ * of core kernel data structs will be volatile in some objects and not in
+ * others. Instead define it globally for KCSAN kernels.
+ */
+# define __data_racy volatile
+#else
+# define __data_racy
+#endif
+
#ifdef __SANITIZE_THREAD__
/*
* Clang still emits instrumentation for __tsan_func_{entry,exit}() and builtin
@@ -314,16 +330,9 @@ struct ftrace_likely_data {
* disable all instrumentation. See Kconfig.kcsan where this is mandatory.
*/
# define __no_kcsan __no_sanitize_thread __disable_sanitizer_instrumentation
-/*
- * Type qualifier to mark variables where all data-racy accesses should be
- * ignored by KCSAN. Note, the implementation simply marks these variables as
- * volatile, since KCSAN will treat such accesses as "marked".
- */
-# define __data_racy volatile
# define __no_sanitize_or_inline __no_kcsan notrace __maybe_unused
#else
# define __no_kcsan
-# define __data_racy
#endif
#ifdef __SANITIZE_MEMORY__
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 679/752] watchdog/softlockup: fix sample ring index wrap in need_counting_irqs()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (215 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 678/752] kcsan, compiler_types: avoid duplicate type issues in BPF Type Format Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 680/752] i2c: imx-lpi2c: fix SMBus block read NACK after byte count Sasha Levin
` (67 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Shengming Hu, Petr Mladek, Ingo Molnar, Mark Brown,
Thomas Gleixner, Zhang Run, stable, Andrew Morton, Sasha Levin
From: Shengming Hu <hu.shengming@zte.com.cn>
[ Upstream commit cafe4074a7221dca2fa954dd1ab0cf99b6318e23 ]
cpustat_tail indexes cpustat_util[], which is a NUM_SAMPLE_PERIODS-sized
ring buffer. need_counting_irqs() currently wraps the index using
NUM_HARDIRQ_REPORT, which only happens to match NUM_SAMPLE_PERIODS.
Use NUM_SAMPLE_PERIODS for the wrap to keep the ring math correct even if
the NUM_HARDIRQ_REPORT or NUM_SAMPLE_PERIODS changes.
Link: https://lkml.kernel.org/r/tencent_7068189CB6D6689EB353F3D17BF5A5311A07@qq.com
Fixes: e9a9292e2368 ("watchdog/softlockup: Report the most frequent interrupts")
Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
Reviewed-by: Petr Mladek <pmladek@suse.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Zhang Run <zhang.run@zte.com.cn>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/watchdog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/watchdog.c b/kernel/watchdog.c
index 5b62d10027836..25d134306e146 100644
--- a/kernel/watchdog.c
+++ b/kernel/watchdog.c
@@ -521,7 +521,7 @@ static bool need_counting_irqs(void)
u8 util;
int tail = __this_cpu_read(cpustat_tail);
- tail = (tail + NUM_HARDIRQ_REPORT - 1) % NUM_HARDIRQ_REPORT;
+ tail = (tail + NUM_SAMPLE_PERIODS - 1) % NUM_SAMPLE_PERIODS;
util = __this_cpu_read(cpustat_util[tail][STATS_HARDIRQ]);
return util > HARDIRQ_PERCENT_THRESH;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 680/752] i2c: imx-lpi2c: fix SMBus block read NACK after byte count
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (216 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 679/752] watchdog/softlockup: fix sample ring index wrap in need_counting_irqs() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 681/752] cifs: Fix locking usage for tcon fields Sasha Levin
` (66 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Carlos Song, stable, Frank Li, Andi Shyti, Wolfram Sang,
Sasha Levin
From: Carlos Song <carlos.song@nxp.com>
[ Upstream commit efdc383d1cc28d45cbf5a23b5ffa997010aaacb4 ]
The LPI2C controller sends a NACK at the end of a receive command
unless another receive command is already queued in MTDR. During
SMBus block reads, this causes the controller to NACK immediately
after receiving the block length byte, aborting the transfer before
the data bytes are read.
Fix this by queueing a second receive command as soon as the block
length byte is received, keeping MTDR non-empty and ensuring
continuous ACKs. The initial receive command reads the block length,
and the subsequent command reads the remaining data bytes according
to the reported length.
Fixes: a55fa9d0e42e ("i2c: imx-lpi2c: add low power i2c bus driver")
Signed-off-by: Carlos Song <carlos.song@nxp.com>
Cc: <stable@vger.kernel.org> # v4.10+
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260123105459.3448822-1-carlos.song@nxp.com
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/i2c/busses/i2c-imx-lpi2c.c | 107 ++++++++++++++++++++++-------
1 file changed, 83 insertions(+), 24 deletions(-)
diff --git a/drivers/i2c/busses/i2c-imx-lpi2c.c b/drivers/i2c/busses/i2c-imx-lpi2c.c
index d882126c1778c..519a1ac832a41 100644
--- a/drivers/i2c/busses/i2c-imx-lpi2c.c
+++ b/drivers/i2c/busses/i2c-imx-lpi2c.c
@@ -5,6 +5,7 @@
* Copyright 2016 Freescale Semiconductor, Inc.
*/
+#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
@@ -90,6 +91,7 @@
#define MRDR_RXEMPTY BIT(14)
#define MDER_TDDE BIT(0)
#define MDER_RDDE BIT(1)
+#define MSR_RDF_ASSERTED(x) FIELD_GET(MSR_RDF, (x))
#define SCR_SEN BIT(0)
#define SCR_RST BIT(1)
@@ -461,7 +463,7 @@ static bool lpi2c_imx_write_txfifo(struct lpi2c_imx_struct *lpi2c_imx, bool atom
static bool lpi2c_imx_read_rxfifo(struct lpi2c_imx_struct *lpi2c_imx, bool atomic)
{
- unsigned int blocklen, remaining;
+ unsigned int remaining;
unsigned int temp, data;
do {
@@ -472,15 +474,6 @@ static bool lpi2c_imx_read_rxfifo(struct lpi2c_imx_struct *lpi2c_imx, bool atomi
lpi2c_imx->rx_buf[lpi2c_imx->delivered++] = data & 0xff;
} while (1);
- /*
- * First byte is the length of remaining packet in the SMBus block
- * data read. Add it to msgs->len.
- */
- if (lpi2c_imx->block_data) {
- blocklen = lpi2c_imx->rx_buf[0];
- lpi2c_imx->msglen += blocklen;
- }
-
remaining = lpi2c_imx->msglen - lpi2c_imx->delivered;
if (!remaining) {
@@ -493,12 +486,7 @@ static bool lpi2c_imx_read_rxfifo(struct lpi2c_imx_struct *lpi2c_imx, bool atomi
lpi2c_imx_set_rx_watermark(lpi2c_imx);
/* multiple receive commands */
- if (lpi2c_imx->block_data) {
- lpi2c_imx->block_data = 0;
- temp = remaining;
- temp |= (RECV_DATA << 8);
- writel(temp, lpi2c_imx->base + LPI2C_MTDR);
- } else if (!(lpi2c_imx->delivered & 0xff)) {
+ if (!(lpi2c_imx->delivered & 0xff)) {
temp = (remaining > CHUNK_DATA ? CHUNK_DATA : remaining) - 1;
temp |= (RECV_DATA << 8);
writel(temp, lpi2c_imx->base + LPI2C_MTDR);
@@ -536,18 +524,77 @@ static int lpi2c_imx_write_atomic(struct lpi2c_imx_struct *lpi2c_imx,
return err;
}
-static void lpi2c_imx_read_init(struct lpi2c_imx_struct *lpi2c_imx,
- struct i2c_msg *msgs)
+static unsigned int lpi2c_SMBus_block_read_length_byte(struct lpi2c_imx_struct *lpi2c_imx)
{
- unsigned int temp;
+ unsigned int data;
+
+ data = readl(lpi2c_imx->base + LPI2C_MRDR);
+ lpi2c_imx->rx_buf[lpi2c_imx->delivered++] = data & 0xff;
+
+ return data;
+}
+
+static int lpi2c_imx_read_init(struct lpi2c_imx_struct *lpi2c_imx,
+ struct i2c_msg *msgs)
+{
+ unsigned int temp, val, block_len;
+ int ret;
lpi2c_imx->rx_buf = msgs->buf;
lpi2c_imx->block_data = msgs->flags & I2C_M_RECV_LEN;
lpi2c_imx_set_rx_watermark(lpi2c_imx);
- temp = msgs->len > CHUNK_DATA ? CHUNK_DATA - 1 : msgs->len - 1;
- temp |= (RECV_DATA << 8);
- writel(temp, lpi2c_imx->base + LPI2C_MTDR);
+
+ if (!lpi2c_imx->block_data) {
+ temp = msgs->len > CHUNK_DATA ? CHUNK_DATA - 1 : msgs->len - 1;
+ temp |= (RECV_DATA << 8);
+ writel(temp, lpi2c_imx->base + LPI2C_MTDR);
+ } else {
+ /*
+ * The LPI2C controller automatically sends a NACK after the last byte of a
+ * receive command, unless the next command in MTDR is also a receive command.
+ * If MTDR is empty when a receive completes, a NACK is sent by default.
+ *
+ * To comply with the SMBus block read spec, we start with a 2-byte read:
+ * The first byte in RXFIFO is the block length. Once this byte arrives, the
+ * controller immediately updates MTDR with the next read command, ensuring
+ * continuous ACK instead of NACK.
+ *
+ * The second byte is the first block data byte. Therefore, the subsequent
+ * read command should request (block_len - 1) bytes, since one data byte
+ * has already been read.
+ */
+
+ writel((RECV_DATA << 8) | 0x01, lpi2c_imx->base + LPI2C_MTDR);
+
+ ret = readl_poll_timeout(lpi2c_imx->base + LPI2C_MSR, val,
+ MSR_RDF_ASSERTED(val), 1, 1000);
+ if (ret) {
+ dev_err(&lpi2c_imx->adapter.dev, "SMBus read count failed %d\n", ret);
+ return ret;
+ }
+
+ /* Read block length byte and confirm this SMBus transfer meets protocol */
+ block_len = lpi2c_SMBus_block_read_length_byte(lpi2c_imx);
+ if (block_len == 0 || block_len > I2C_SMBUS_BLOCK_MAX) {
+ dev_err(&lpi2c_imx->adapter.dev, "Invalid SMBus block read length\n");
+ return -EPROTO;
+ }
+
+ /*
+ * When block_len shows more bytes need to be read, update second read command to
+ * keep MTDR non-empty and ensuring continuous ACKs. Only update command register
+ * here. All block bytes will be read out at IRQ handler or lpi2c_imx_read_atomic()
+ * function.
+ */
+ if (block_len > 1)
+ writel((RECV_DATA << 8) | (block_len - 2), lpi2c_imx->base + LPI2C_MTDR);
+
+ lpi2c_imx->msglen += block_len;
+ msgs->len += block_len;
+ }
+
+ return 0;
}
static bool lpi2c_imx_read_chunk_atomic(struct lpi2c_imx_struct *lpi2c_imx)
@@ -592,6 +639,10 @@ static bool is_use_dma(struct lpi2c_imx_struct *lpi2c_imx, struct i2c_msg *msg)
if (!lpi2c_imx->can_use_dma)
return false;
+ /* DMA is not suitable for SMBus block read */
+ if (msg->flags & I2C_M_RECV_LEN)
+ return false;
+
/*
* A system-wide suspend or resume transition is in progress. LPI2C should use PIO to
* transfer data to avoid issue caused by no ready DMA HW resource.
@@ -609,10 +660,14 @@ static bool is_use_dma(struct lpi2c_imx_struct *lpi2c_imx, struct i2c_msg *msg)
static int lpi2c_imx_pio_xfer(struct lpi2c_imx_struct *lpi2c_imx,
struct i2c_msg *msg)
{
+ int ret;
+
reinit_completion(&lpi2c_imx->complete);
if (msg->flags & I2C_M_RD) {
- lpi2c_imx_read_init(lpi2c_imx, msg);
+ ret = lpi2c_imx_read_init(lpi2c_imx, msg);
+ if (ret)
+ return ret;
lpi2c_imx_intctrl(lpi2c_imx, MIER_RDIE | MIER_NDIE);
} else {
lpi2c_imx_write(lpi2c_imx, msg);
@@ -624,8 +679,12 @@ static int lpi2c_imx_pio_xfer(struct lpi2c_imx_struct *lpi2c_imx,
static int lpi2c_imx_pio_xfer_atomic(struct lpi2c_imx_struct *lpi2c_imx,
struct i2c_msg *msg)
{
+ int ret;
+
if (msg->flags & I2C_M_RD) {
- lpi2c_imx_read_init(lpi2c_imx, msg);
+ ret = lpi2c_imx_read_init(lpi2c_imx, msg);
+ if (ret)
+ return ret;
return lpi2c_imx_read_atomic(lpi2c_imx, msg);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 681/752] cifs: Fix locking usage for tcon fields
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (217 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 680/752] i2c: imx-lpi2c: fix SMBus block read NACK after byte count Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 682/752] MIPS: rb532: Fix MMIO UART resource registration Sasha Levin
` (65 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Shyam Prasad N, stable, Steve French, Sasha Levin
From: Shyam Prasad N <sprasad@microsoft.com>
[ Upstream commit 96c4af418586ee9a6aab61738644366426e05316 ]
We used to use the cifs_tcp_ses_lock to protect a lot of objects
that are not just the server, ses or tcon lists. We later introduced
srv_lock, ses_lock and tc_lock to protect fields within the
corresponding structs. This was done to provide a more granular
protection and avoid unnecessary serialization.
There were still a couple of uses of cifs_tcp_ses_lock to provide
tcon fields. In this patch, I've replaced them with tc_lock.
Cc: stable@vger.kernel.org
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/cached_dir.c | 4 ++--
fs/smb/client/smb2misc.c | 6 +++---
fs/smb/client/smb2ops.c | 8 +++-----
fs/smb/client/smb2pdu.c | 2 ++
fs/smb/client/trace.h | 1 +
5 files changed, 11 insertions(+), 10 deletions(-)
diff --git a/fs/smb/client/cached_dir.c b/fs/smb/client/cached_dir.c
index e3ea6fe7edb47..09939fe9666ea 100644
--- a/fs/smb/client/cached_dir.c
+++ b/fs/smb/client/cached_dir.c
@@ -788,11 +788,11 @@ static void cfids_laundromat_worker(struct work_struct *work)
cfid->dentry = NULL;
if (cfid->is_open) {
- spin_lock(&cifs_tcp_ses_lock);
+ spin_lock(&cfid->tcon->tc_lock);
++cfid->tcon->tc_count;
trace_smb3_tcon_ref(cfid->tcon->debug_id, cfid->tcon->tc_count,
netfs_trace_tcon_ref_get_cached_laundromat);
- spin_unlock(&cifs_tcp_ses_lock);
+ spin_unlock(&cfid->tcon->tc_lock);
queue_work(serverclose_wq, &cfid->close_work);
} else
/*
diff --git a/fs/smb/client/smb2misc.c b/fs/smb/client/smb2misc.c
index 96bfe4c63ccf9..a6fc8ff398ebf 100644
--- a/fs/smb/client/smb2misc.c
+++ b/fs/smb/client/smb2misc.c
@@ -819,14 +819,14 @@ smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid,
int rc;
cifs_dbg(FYI, "%s: tc_count=%d\n", __func__, tcon->tc_count);
- spin_lock(&cifs_tcp_ses_lock);
+ spin_lock(&tcon->tc_lock);
if (tcon->tc_count <= 0) {
struct TCP_Server_Info *server = NULL;
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
netfs_trace_tcon_ref_see_cancelled_close);
WARN_ONCE(tcon->tc_count < 0, "tcon refcount is negative");
- spin_unlock(&cifs_tcp_ses_lock);
+ spin_unlock(&tcon->tc_lock);
if (tcon->ses) {
server = tcon->ses->server;
@@ -840,7 +840,7 @@ smb2_handle_cancelled_close(struct cifs_tcon *tcon, __u64 persistent_fid,
tcon->tc_count++;
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
netfs_trace_tcon_ref_get_cancelled_close);
- spin_unlock(&cifs_tcp_ses_lock);
+ spin_unlock(&tcon->tc_lock);
rc = __smb2_handle_cancelled_cmd(tcon, SMB2_CLOSE_HE, 0,
persistent_fid, volatile_fid);
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index c3c5fddb2caab..1b404def355e9 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -3074,7 +3074,9 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,
struct cifs_tcon,
tcon_list);
if (tcon) {
+ spin_lock(&tcon->tc_lock);
tcon->tc_count++;
+ spin_unlock(&tcon->tc_lock);
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
netfs_trace_tcon_ref_get_dfs_refer);
}
@@ -3143,13 +3145,9 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses,
out:
if (tcon && !tcon->ipc) {
/* ipc tcons are not refcounted */
- spin_lock(&cifs_tcp_ses_lock);
- tcon->tc_count--;
+ cifs_put_tcon(tcon, netfs_trace_tcon_ref_put_dfs_refer);
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
netfs_trace_tcon_ref_dec_dfs_refer);
- /* tc_count can never go negative */
- WARN_ON(tcon->tc_count < 0);
- spin_unlock(&cifs_tcp_ses_lock);
}
kfree(utf16_path);
kfree(dfs_req);
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index e661d40213eab..8082507586e81 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -4174,7 +4174,9 @@ void smb2_reconnect_server(struct work_struct *work)
list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
if (tcon->need_reconnect || tcon->need_reopen_files) {
+ spin_lock(&tcon->tc_lock);
tcon->tc_count++;
+ spin_unlock(&tcon->tc_lock);
trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count,
netfs_trace_tcon_ref_get_reconnect_server);
list_add_tail(&tcon->rlist, &tmp_list);
diff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h
index 28e00c34df1cb..e592b2627119f 100644
--- a/fs/smb/client/trace.h
+++ b/fs/smb/client/trace.h
@@ -59,6 +59,7 @@
EM(netfs_trace_tcon_ref_put_cancelled_close_fid, "PUT Cn-Fid") \
EM(netfs_trace_tcon_ref_put_cancelled_mid, "PUT Cn-Mid") \
EM(netfs_trace_tcon_ref_put_mnt_ctx, "PUT MntCtx") \
+ EM(netfs_trace_tcon_ref_put_dfs_refer, "PUT DfsRfr") \
EM(netfs_trace_tcon_ref_put_reconnect_server, "PUT Reconn") \
EM(netfs_trace_tcon_ref_put_tlink, "PUT Tlink ") \
EM(netfs_trace_tcon_ref_see_cancelled_close, "SEE Cn-Cls") \
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 682/752] MIPS: rb532: Fix MMIO UART resource registration
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (218 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 681/752] cifs: Fix locking usage for tcon fields Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 683/752] ceph: supply snapshot context in ceph_zero_partial_object() Sasha Levin
` (64 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Jiaxun Yang, stable, Waldemar Brodkorb, Thomas Bogendoerfer,
Sasha Levin
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
[ Upstream commit e93bb4b76cfefb302534246e892c7667491cb8cc ]
Since commit 6e690d54cfa8 ("serial: 8250: fix return error code in
serial8250_request_std_resource()"), registering an 8250 MMIO port
without mapbase no longer works, as the resource range is derived from
mapbase/mapsize.
Populate mapbase and mapsize accordingly. Also drop ugly membase KSEG1
pointer and set UPF_IOREMAP instead, letting the 8250 core perform the
ioremap.
Fixes: 6e690d54cfa8 ("serial: 8250: fix return error code in serial8250_request_std_resource()")
Cc: stable@vger.kernel.org
Reported-by: Waldemar Brodkorb <wbx@openadk.org>
Link: https://lore.kernel.org/linux-mips/aX-d0ShTplHKZT33@waldemar-brodkorb.de/
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/mips/rb532/devices.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/mips/rb532/devices.c b/arch/mips/rb532/devices.c
index b7f6f782d9a13..ffa4d38ca95df 100644
--- a/arch/mips/rb532/devices.c
+++ b/arch/mips/rb532/devices.c
@@ -212,11 +212,12 @@ static struct platform_device rb532_wdt = {
static struct plat_serial8250_port rb532_uart_res[] = {
{
.type = PORT_16550A,
- .membase = (char *)KSEG1ADDR(REGBASE + UART0BASE),
+ .mapbase = REGBASE + UART0BASE,
+ .mapsize = 0x1000,
.irq = UART0_IRQ,
.regshift = 2,
.iotype = UPIO_MEM,
- .flags = UPF_BOOT_AUTOCONF,
+ .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP,
},
{
.flags = 0,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 683/752] ceph: supply snapshot context in ceph_zero_partial_object()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (219 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 682/752] MIPS: rb532: Fix MMIO UART resource registration Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 684/752] drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry Sasha Levin
` (63 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: ethanwu, stable, Viacheslav Dubeyko, Ilya Dryomov, Sasha Levin
From: ethanwu <ethanwu@synology.com>
[ Upstream commit f16bd3fa74a2084ee7e16a8a2be7e7399b970907 ]
The ceph_zero_partial_object function was missing proper snapshot
context for its OSD write operations, which could lead to data
inconsistencies in snapshots.
Reproducer:
../src/vstart.sh --new -x --localhost --bluestore
./bin/ceph auth caps client.fs_a mds 'allow rwps fsname=a' mon 'allow r fsname=a' osd 'allow rw tag cephfs data=a'
mount -t ceph fs_a@.a=/ /mnt/mycephfs/ -o conf=./ceph.conf
dd if=/dev/urandom of=/mnt/mycephfs/foo bs=64K count=1
mkdir /mnt/mycephfs/.snap/snap1
md5sum /mnt/mycephfs/.snap/snap1/foo
fallocate -p -o 0 -l 4096 /mnt/mycephfs/foo
echo 3 > /proc/sys/vm/drop/caches
md5sum /mnt/mycephfs/.snap/snap1/foo # get different md5sum!!
Cc: stable@vger.kernel.org
Fixes: ad7a60de882ac ("ceph: punch hole support")
Signed-off-by: ethanwu <ethanwu@synology.com>
Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Tested-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ceph/file.c | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 99b30f784ee24..f43a42909e7cf 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -2568,6 +2568,7 @@ static int ceph_zero_partial_object(struct inode *inode,
struct ceph_inode_info *ci = ceph_inode(inode);
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
struct ceph_osd_request *req;
+ struct ceph_snap_context *snapc;
int ret = 0;
loff_t zero = 0;
int op;
@@ -2582,12 +2583,25 @@ static int ceph_zero_partial_object(struct inode *inode,
op = CEPH_OSD_OP_ZERO;
}
+ spin_lock(&ci->i_ceph_lock);
+ if (__ceph_have_pending_cap_snap(ci)) {
+ struct ceph_cap_snap *capsnap =
+ list_last_entry(&ci->i_cap_snaps,
+ struct ceph_cap_snap,
+ ci_item);
+ snapc = ceph_get_snap_context(capsnap->context);
+ } else {
+ BUG_ON(!ci->i_head_snapc);
+ snapc = ceph_get_snap_context(ci->i_head_snapc);
+ }
+ spin_unlock(&ci->i_ceph_lock);
+
req = ceph_osdc_new_request(&fsc->client->osdc, &ci->i_layout,
ceph_vino(inode),
offset, length,
0, 1, op,
CEPH_OSD_FLAG_WRITE,
- NULL, 0, 0, false);
+ snapc, 0, 0, false);
if (IS_ERR(req)) {
ret = PTR_ERR(req);
goto out;
@@ -2601,6 +2615,7 @@ static int ceph_zero_partial_object(struct inode *inode,
ceph_osdc_put_request(req);
out:
+ ceph_put_snap_context(snapc);
return ret;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 684/752] drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (220 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 683/752] ceph: supply snapshot context in ceph_zero_partial_object() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 685/752] rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0 Sasha Levin
` (62 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Ankit Nautiyal, Jani Nikula, Ville Syrjälä, stable,
Suraj Kandpal, Joonas Lahtinen, Sasha Levin
From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
[ Upstream commit 510e7261a7bcd6232e90f0b6b9f93303bdd29f8a ]
Update the device ID for Dell XPS 13 7390 2-in-1 in the quirk
`QUIRK_EDP_LIMIT_RATE_HBR2` entry. The previous ID (0x8a12) was
incorrect; the correct ID is 0x8a52.
Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/5969
Fixes: 21c586d9233a ("drm/i915/dp: Add device specific quirk to limit eDP rate to HBR2")
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: <stable@vger.kernel.org> # v6.18+
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20251226043359.2553-1-ankit.k.nautiyal@intel.com
(cherry picked from commit c7c30c4093cc11ff66672471f12599a555708343)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/i915/display/intel_quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/display/intel_quirks.c b/drivers/gpu/drm/i915/display/intel_quirks.c
index d2e16b79d6be1..1abbdd426e587 100644
--- a/drivers/gpu/drm/i915/display/intel_quirks.c
+++ b/drivers/gpu/drm/i915/display/intel_quirks.c
@@ -239,7 +239,7 @@ static struct intel_quirk intel_quirks[] = {
{ 0x0f31, 0x103c, 0x220f, quirk_invert_brightness },
/* Dell XPS 13 7390 2-in-1 */
- { 0x8a12, 0x1028, 0x08b0, quirk_edp_limit_rate_hbr2 },
+ { 0x8a52, 0x1028, 0x08b0, quirk_edp_limit_rate_hbr2 },
};
static const struct intel_dpcd_quirk intel_dpcd_quirks[] = {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 685/752] rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (221 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 684/752] drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 686/752] mm/slab: do not access current->mems_allowed_seq if !allow_spin Sasha Levin
` (61 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Miguel Ojeda, David Wood, Wesley Wiser, stable, Gary Guo,
Sasha Levin
From: Miguel Ojeda <ojeda@kernel.org>
[ Upstream commit 0a9be83e57de0d0ca8ca4ec610bc344f17a8e5e7 ]
Custom target specifications are unstable, but starting with Rust 1.95.0,
`rustc` requires to explicitly pass `-Zunstable-options` to use them [1]:
error: error loading target specification: custom targets are unstable and require `-Zunstable-options`
|
= help: run `rustc --print target-list` for a list of built-in targets
David (Rust compiler team lead), writes:
"We're destabilising custom targets to allow us to move forward with
build-std without accidentally exposing functionality that we'd like
to revisit prior to committing to. I'll start a thread on Zulip to
discuss with the RfL team how we can come up with an alternative
for them."
Thus pass it.
Cc: David Wood <david@davidtw.co>
Cc: Wesley Wiser <wwiser@gmail.com>
Cc: stable@vger.kernel.org # Needed in 6.12.y and later (Rust is pinned in older LTSs).
Link: https://github.com/rust-lang/rust/pull/151534 [1]
Reviewed-by: Gary Guo <gary@garyguo.net>
Tested-by: Gary Guo <gary@garyguo.net>
Link: https://patch.msgid.link/20260206204535.39431-1-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
rust/Makefile | 3 +++
1 file changed, 3 insertions(+)
diff --git a/rust/Makefile b/rust/Makefile
index 7842ad0a4ea72..d4618f646b05b 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -437,6 +437,8 @@ $(obj)/$(libpin_init_internal_name): private rustc_target_flags = --cfg kernel
$(obj)/$(libpin_init_internal_name): $(src)/pin-init/internal/src/lib.rs FORCE
+$(call if_changed_dep,rustc_procmacro)
+# `rustc` requires `-Zunstable-options` to use custom target specifications
+# since Rust 1.95.0 (https://github.com/rust-lang/rust/pull/151534).
quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L $@
cmd_rustc_library = \
OBJTREE=$(abspath $(objtree)) \
@@ -447,6 +449,7 @@ quiet_cmd_rustc_library = $(if $(skip_clippy),RUSTC,$(RUSTC_OR_CLIPPY_QUIET)) L
--crate-type rlib -L$(objtree)/$(obj) \
--crate-name $(patsubst %.o,%,$(notdir $@)) $< \
--sysroot=/dev/null \
+ -Zunstable-options \
$(if $(rustc_objcopy),;$(OBJCOPY) $(rustc_objcopy) $@) \
$(cmd_objtool)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 686/752] mm/slab: do not access current->mems_allowed_seq if !allow_spin
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (222 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 685/752] rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0 Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 687/752] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE Sasha Levin
` (60 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Harry Yoo, stable, Vlastimil Babka, Sasha Levin
From: Harry Yoo <harry.yoo@oracle.com>
[ Upstream commit 144080a5823b2dbd635acb6decf7ab23182664f3 ]
Lockdep complains when get_from_any_partial() is called in an NMI
context, because current->mems_allowed_seq is seqcount_spinlock_t and
not NMI-safe:
================================
WARNING: inconsistent lock state
6.19.0-rc5-kfree-rcu+ #315 Tainted: G N
--------------------------------
inconsistent {INITIAL USE} -> {IN-NMI} usage.
kunit_try_catch/9989 [HC1[1]:SC0[0]:HE0:SE1] takes:
ffff889085799820 (&____s->seqcount#3){.-.-}-{0:0}, at: ___slab_alloc+0x58f/0xc00
{INITIAL USE} state was registered at:
lock_acquire+0x185/0x320
kernel_init_freeable+0x391/0x1150
kernel_init+0x1f/0x220
ret_from_fork+0x736/0x8f0
ret_from_fork_asm+0x1a/0x30
irq event stamp: 56
hardirqs last enabled at (55): [<ffffffff850a68d7>] _raw_spin_unlock_irq+0x27/0x70
hardirqs last disabled at (56): [<ffffffff850858ca>] __schedule+0x2a8a/0x6630
softirqs last enabled at (0): [<ffffffff81536711>] copy_process+0x1dc1/0x6a10
softirqs last disabled at (0): [<0000000000000000>] 0x0
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&____s->seqcount#3);
<Interrupt>
lock(&____s->seqcount#3);
*** DEADLOCK ***
According to Documentation/locking/seqlock.rst, seqcount_t is not
NMI-safe and seqcount_latch_t should be used when read path can interrupt
the write-side critical section. In this case, do not access
current->mems_allowed_seq and avoid retry.
Fixes: af92793e52c3 ("slab: Introduce kmalloc_nolock() and kfree_nolock().")
Cc: stable@vger.kernel.org
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Link: https://patch.msgid.link/20260210081900.329447-2-harry.yoo@oracle.com
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/slub.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/mm/slub.c b/mm/slub.c
index bc6156801e8e6..4e2a3f7656099 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -3594,6 +3594,7 @@ static struct slab *get_any_partial(struct kmem_cache *s,
enum zone_type highest_zoneidx = gfp_zone(pc->flags);
struct slab *slab;
unsigned int cpuset_mems_cookie;
+ bool allow_spin = gfpflags_allow_spinning(pc->flags);
/*
* The defrag ratio allows a configuration of the tradeoffs between
@@ -3618,7 +3619,15 @@ static struct slab *get_any_partial(struct kmem_cache *s,
return NULL;
do {
- cpuset_mems_cookie = read_mems_allowed_begin();
+ /*
+ * read_mems_allowed_begin() accesses current->mems_allowed_seq,
+ * a seqcount_spinlock_t that is not NMI-safe. Do not access
+ * current->mems_allowed_seq and avoid retry when GFP flags
+ * indicate spinning is not allowed.
+ */
+ if (allow_spin)
+ cpuset_mems_cookie = read_mems_allowed_begin();
+
zonelist = node_zonelist(mempolicy_slab_node(), pc->flags);
for_each_zone_zonelist(zone, z, zonelist, highest_zoneidx) {
struct kmem_cache_node *n;
@@ -3640,7 +3649,7 @@ static struct slab *get_any_partial(struct kmem_cache *s,
}
}
}
- } while (read_mems_allowed_retry(cpuset_mems_cookie));
+ } while (allow_spin && read_mems_allowed_retry(cpuset_mems_cookie));
#endif /* CONFIG_NUMA */
return NULL;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 687/752] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (223 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 686/752] mm/slab: do not access current->mems_allowed_seq if !allow_spin Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 688/752] LoongArch: Prefer top-down allocation after arch_mem_init() Sasha Levin
` (59 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: John Garry, stable, Huacai Chen, Sasha Levin
From: John Garry <john.g.garry@oracle.com>
[ Upstream commit 94b0c831eda778ae9e4f2164a8b3de485d8977bb ]
The arch definition of cpumask_of_node() cannot handle NUMA_NO_NODE -
which is a valid index - so add a check for this.
Cc: stable@vger.kernel.org
Signed-off-by: John Garry <john.g.garry@oracle.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/loongarch/include/asm/topology.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/include/asm/topology.h b/arch/loongarch/include/asm/topology.h
index f06e7ff25bb7c..6b79d6183085a 100644
--- a/arch/loongarch/include/asm/topology.h
+++ b/arch/loongarch/include/asm/topology.h
@@ -12,7 +12,7 @@
extern cpumask_t cpus_on_node[];
-#define cpumask_of_node(node) (&cpus_on_node[node])
+#define cpumask_of_node(node) ((node) == NUMA_NO_NODE ? cpu_all_mask : &cpus_on_node[node])
struct pci_bus;
extern int pcibus_to_node(struct pci_bus *);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 688/752] LoongArch: Prefer top-down allocation after arch_mem_init()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (224 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 687/752] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 689/752] LoongArch: Use %px to print unmodified unwinding address Sasha Levin
` (58 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Huacai Chen, stable, Sasha Levin
From: Huacai Chen <chenhuacai@loongson.cn>
[ Upstream commit 2172d6ebac9372eb01fe4505a53e18cb061e103b ]
Currently we use bottom-up allocation after sparse_init(), the reason is
sparse_init() need a lot of memory, and bottom-up allocation may exhaust
precious low memory (below 4GB). On the other hand, SWIOTLB and CMA need
low memories for DMA32, so swiotlb_init() and dma_contiguous_reserve()
need bottom-up allocation.
Since swiotlb_init() and dma_contiguous_reserve() are both called in
arch_mem_init(), we no longer need bottom-up allocation after that. So
we set the allocation policy to top-down at the end of arch_mem_init(),
in order to avoid later memory allocations (such as KASAN) exhaust low
memory.
This solve at least two problems:
1. Some buggy BIOSes use 0xfd000000~0xfe000000 for secondary CPUs, but
didn't reserve this range, which causes smpboot failures.
2. Some DMA32 devices, such as Loongson-DRM and OHCI, cannot work with
KASAN enabled.
Cc: stable@vger.kernel.org
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/loongarch/kernel/setup.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/loongarch/kernel/setup.c b/arch/loongarch/kernel/setup.c
index 20cb6f3064568..2b260d15b2e25 100644
--- a/arch/loongarch/kernel/setup.c
+++ b/arch/loongarch/kernel/setup.c
@@ -421,6 +421,7 @@ static void __init arch_mem_init(char **cmdline_p)
PFN_UP(__pa_symbol(&__nosave_end)));
memblock_dump_all();
+ memblock_set_bottom_up(false);
early_memtest(PFN_PHYS(ARCH_PFN_OFFSET), PFN_PHYS(max_low_pfn));
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 689/752] LoongArch: Use %px to print unmodified unwinding address
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (225 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 688/752] LoongArch: Prefer top-down allocation after arch_mem_init() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 690/752] LoongArch: Guard percpu handler under !CONFIG_PREEMPT_RT Sasha Levin
` (57 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Tiezhu Yang, stable, Huacai Chen, Sasha Levin
From: Tiezhu Yang <yangtiezhu@loongson.cn>
[ Upstream commit 77403a06d845db1caf9a6b0867b43e9dd8de8e4a ]
Currently, use %p to prevent leaking information about the kernel memory
layout when printing the PC address, but the kernel log messages are not
useful to debug problem if bt_address() returns 0. Given that the type of
"pc" variable is unsigned long, it should use %px to print the unmodified
unwinding address.
Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/loongarch/kernel/unwind_orc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/kernel/unwind_orc.c b/arch/loongarch/kernel/unwind_orc.c
index 0d5fa64a22252..e410048489c66 100644
--- a/arch/loongarch/kernel/unwind_orc.c
+++ b/arch/loongarch/kernel/unwind_orc.c
@@ -508,7 +508,7 @@ bool unwind_next_frame(struct unwind_state *state)
state->pc = bt_address(pc);
if (!state->pc) {
- pr_err("cannot find unwind pc at %p\n", (void *)pc);
+ pr_err("cannot find unwind pc at %px\n", (void *)pc);
goto err;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 690/752] LoongArch: Guard percpu handler under !CONFIG_PREEMPT_RT
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (226 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 689/752] LoongArch: Use %px to print unmodified unwinding address Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 691/752] LoongArch: Disable instrumentation for setup_ptwalker() Sasha Levin
` (56 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Tiezhu Yang, stable, Huacai Chen, Sasha Levin
From: Tiezhu Yang <yangtiezhu@loongson.cn>
[ Upstream commit 70b0faae3590c628a98a627a10e5d211310169d4 ]
After commit 88fd2b70120d ("LoongArch: Fix sleeping in atomic context for
PREEMPT_RT"), it should guard percpu handler under !CONFIG_PREEMPT_RT to
avoid redundant operations.
Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/loongarch/kernel/unwind_prologue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/kernel/unwind_prologue.c b/arch/loongarch/kernel/unwind_prologue.c
index 729e775bd40dd..ee1c29686ab05 100644
--- a/arch/loongarch/kernel/unwind_prologue.c
+++ b/arch/loongarch/kernel/unwind_prologue.c
@@ -65,7 +65,7 @@ static inline bool scan_handlers(unsigned long entry_offset)
static inline bool fix_exception(unsigned long pc)
{
-#ifdef CONFIG_NUMA
+#if defined(CONFIG_NUMA) && !defined(CONFIG_PREEMPT_RT)
int cpu;
for_each_possible_cpu(cpu) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 691/752] LoongArch: Disable instrumentation for setup_ptwalker()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (227 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 690/752] LoongArch: Guard percpu handler under !CONFIG_PREEMPT_RT Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 692/752] net: ethernet: marvell: skge: remove incorrect conflicting PCI ID Sasha Levin
` (55 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Tiezhu Yang, stable, Huacai Chen, Sasha Levin
From: Tiezhu Yang <yangtiezhu@loongson.cn>
[ Upstream commit 7cb37af61f09c9cfd90c43c9275307c16320cbf2 ]
According to Documentation/dev-tools/kasan.rst, software KASAN modes use
compiler instrumentation to insert validity checks. Such instrumentation
might be incompatible with some parts of the kernel, and therefore needs
to be disabled, just use the attribute __no_sanitize_address to disable
instrumentation for the low level function setup_ptwalker().
Otherwise bringing up the secondary CPUs failed when CONFIG_KASAN is set
(especially when PTW is enabled), here are the call chains:
smpboot_entry()
start_secondary()
cpu_probe()
per_cpu_trap_init()
tlb_init()
setup_tlb_handler()
setup_ptwalker()
The reason is the PGD registers are configured in setup_ptwalker(), but
KASAN instrumentation may cause TLB exceptions before that.
Cc: stable@vger.kernel.org
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/loongarch/mm/tlb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/loongarch/mm/tlb.c b/arch/loongarch/mm/tlb.c
index 3b427b319db21..f46c15d6e7eae 100644
--- a/arch/loongarch/mm/tlb.c
+++ b/arch/loongarch/mm/tlb.c
@@ -202,7 +202,7 @@ void __update_tlb(struct vm_area_struct *vma, unsigned long address, pte_t *ptep
local_irq_restore(flags);
}
-static void setup_ptwalker(void)
+static void __no_sanitize_address setup_ptwalker(void)
{
unsigned long pwctl0, pwctl1;
unsigned long pgd_i = 0, pgd_w = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 692/752] net: ethernet: marvell: skge: remove incorrect conflicting PCI ID
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (228 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 691/752] LoongArch: Disable instrumentation for setup_ptwalker() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 693/752] net: wan/fsl_ucc_hdlc: Fix dma_free_coherent() in uhdlc_memclean() Sasha Levin
` (54 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Ethan Nelson-Moore, stable, Paolo Abeni, Sasha Levin
From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
[ Upstream commit d01103fdcb871fd83fd06ef5803d576507c6a801 ]
The ID 1186:4302 is matched by both r8169 and skge. The same device ID
should not be in more than one driver, because in that case, which
driver is used is unpredictable. I downloaded the latest drivers for
all hardware revisions of the D-Link DGE-530T from D-Link's website,
and the only drivers which contain this ID are Realtek drivers.
Therefore, remove this device ID from skge.
In the kernel bug report which requested addition of this device ID,
someone created a patch to add the ID to skge. Then, it was pointed
out that this device is an "r8169 in disguise", and a patch was created
to add it to r8169. Somehow, both of these patches got merged. See the
link below.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=38862
Fixes: c074304c2bcf ("add pci-id for DGE-530T")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Link: https://patch.msgid.link/20260206071724.15268-1-enelsonmoore@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/marvell/skge.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/marvell/skge.c b/drivers/net/ethernet/marvell/skge.c
index 05349a0b2db1c..cf4e26d337bb5 100644
--- a/drivers/net/ethernet/marvell/skge.c
+++ b/drivers/net/ethernet/marvell/skge.c
@@ -78,7 +78,6 @@ static const struct pci_device_id skge_id_table[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x4320) }, /* SK-98xx V2.0 */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* D-Link DGE-530T (rev.B) */
{ PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4c00) }, /* D-Link DGE-530T */
- { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4302) }, /* D-Link DGE-530T Rev C1 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, /* Marvell Yukon 88E8001/8003/8010 */
{ PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */
{ PCI_DEVICE(PCI_VENDOR_ID_CNET, 0x434E) }, /* CNet PowerG-2000 */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 693/752] net: wan/fsl_ucc_hdlc: Fix dma_free_coherent() in uhdlc_memclean()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (229 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 692/752] net: ethernet: marvell: skge: remove incorrect conflicting PCI ID Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 694/752] octeontx2-af: CGX: fix bitmap leaks Sasha Levin
` (53 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Thomas Fourier, Christophe Leroy (CS GROUP), stable, Paolo Abeni,
Sasha Levin
From: Thomas Fourier <fourier.thomas@gmail.com>
[ Upstream commit 36bd7d5deef936c4e1e3cd341598140e5c14c1d3 ]
The priv->rx_buffer and priv->tx_buffer are alloc'd together as
contiguous buffers in uhdlc_init() but freed as two buffers in
uhdlc_memclean().
Change the cleanup to only call dma_free_coherent() once on the whole
buffer.
Reviewed-by: Christophe Leroy (CS GROUP) <chleroy@kernel.org>
Fixes: c19b6d246a35 ("drivers/net: support hdlc function for QE-UCC")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20260206085334.21195-2-fourier.thomas@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/wan/fsl_ucc_hdlc.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
index f999798a56127..dff84731343cc 100644
--- a/drivers/net/wan/fsl_ucc_hdlc.c
+++ b/drivers/net/wan/fsl_ucc_hdlc.c
@@ -790,18 +790,14 @@ static void uhdlc_memclean(struct ucc_hdlc_private *priv)
if (priv->rx_buffer) {
dma_free_coherent(priv->dev,
- RX_BD_RING_LEN * MAX_RX_BUF_LENGTH,
+ (RX_BD_RING_LEN + TX_BD_RING_LEN) * MAX_RX_BUF_LENGTH,
priv->rx_buffer, priv->dma_rx_addr);
priv->rx_buffer = NULL;
priv->dma_rx_addr = 0;
- }
- if (priv->tx_buffer) {
- dma_free_coherent(priv->dev,
- TX_BD_RING_LEN * MAX_RX_BUF_LENGTH,
- priv->tx_buffer, priv->dma_tx_addr);
priv->tx_buffer = NULL;
priv->dma_tx_addr = 0;
+
}
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 694/752] octeontx2-af: CGX: fix bitmap leaks
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (230 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 693/752] net: wan/fsl_ucc_hdlc: Fix dma_free_coherent() in uhdlc_memclean() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 695/752] net: ti: icssg-prueth: Add optional dependency on HSR Sasha Levin
` (52 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Bo Sun, stable, Vadim Fedorenko, Jijie Shao, Jakub Kicinski,
Sasha Levin
From: Bo Sun <bo@mboxify.com>
[ Upstream commit 3def995c4ede842adf509c410e92d09a0cedc965 ]
The RX/TX flow-control bitmaps (rx_fc_pfvf_bmap and tx_fc_pfvf_bmap)
are allocated by cgx_lmac_init() but never freed in cgx_lmac_exit().
Unbinding and rebinding the driver therefore triggers kmemleak:
unreferenced object (size 16):
backtrace:
rvu_alloc_bitmap
cgx_probe
Free both bitmaps during teardown.
Fixes: e740003874ed ("octeontx2-af: Flow control resource management")
Cc: stable@vger.kernel.org
Signed-off-by: Bo Sun <bo@mboxify.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20260206130925.1087588-2-bo@mboxify.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/marvell/octeontx2/af/cgx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
index ec0e11c77cbf2..81b55f1416e0d 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/cgx.c
@@ -1823,6 +1823,8 @@ static int cgx_lmac_exit(struct cgx *cgx)
cgx->mac_ops->mac_pause_frm_config(cgx, lmac->lmac_id, false);
cgx_configure_interrupt(cgx, lmac, lmac->lmac_id, true);
kfree(lmac->mac_to_index_bmap.bmap);
+ rvu_free_bitmap(&lmac->rx_fc_pfvf_bmap);
+ rvu_free_bitmap(&lmac->tx_fc_pfvf_bmap);
kfree(lmac->name);
kfree(lmac);
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 695/752] net: ti: icssg-prueth: Add optional dependency on HSR
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (231 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 694/752] octeontx2-af: CGX: fix bitmap leaks Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 696/752] net: macb: Fix tx/rx malfunction after phy link down and up Sasha Levin
` (51 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Kevin Hao, stable, Paolo Abeni, Sasha Levin
From: Kevin Hao <haokexin@gmail.com>
[ Upstream commit e3998b6e90f875f19bf758053d79ccfd41880173 ]
Commit 95540ad6747c ("net: ti: icssg-prueth: Add support for HSR frame
forward offload") introduced support for offloading HSR frame forwarding,
which relies on functions such as is_hsr_master() provided by the HSR
module. Although HSR provides stubs for configurations with HSR
disabled, this driver still requires an optional dependency on HSR.
Otherwise, build failures will occur when icssg-prueth is built-in
while HSR is configured as a module.
ld.lld: error: undefined symbol: is_hsr_master
>>> referenced by icssg_prueth.c:710 (drivers/net/ethernet/ti/icssg/icssg_prueth.c:710)
>>> drivers/net/ethernet/ti/icssg/icssg_prueth.o:(icssg_prueth_hsr_del_mcast) in archive vmlinux.a
>>> referenced by icssg_prueth.c:681 (drivers/net/ethernet/ti/icssg/icssg_prueth.c:681)
>>> drivers/net/ethernet/ti/icssg/icssg_prueth.o:(icssg_prueth_hsr_add_mcast) in archive vmlinux.a
>>> referenced by icssg_prueth.c:1812 (drivers/net/ethernet/ti/icssg/icssg_prueth.c:1812)
>>> drivers/net/ethernet/ti/icssg/icssg_prueth.o:(prueth_netdevice_event) in archive vmlinux.a
ld.lld: error: undefined symbol: hsr_get_port_ndev
>>> referenced by icssg_prueth.c:712 (drivers/net/ethernet/ti/icssg/icssg_prueth.c:712)
>>> drivers/net/ethernet/ti/icssg/icssg_prueth.o:(icssg_prueth_hsr_del_mcast) in archive vmlinux.a
>>> referenced by icssg_prueth.c:712 (drivers/net/ethernet/ti/icssg/icssg_prueth.c:712)
>>> drivers/net/etherneteth_hsr_del_mcast) in archive vmlinux.a
>>> referenced by icssg_prueth.c:683 (drivers/net/ethernet/ti/icssg/icssg_prueth.c:683)
>>> drivers/net/ethernet/ti/icssg/icssg_prueth.o:(icssg_prueth_hsr_add_mcast) in archive vmlinux.a
>>> referenced 1 more times
Fixes: 95540ad6747c ("net: ti: icssg-prueth: Add support for HSR frame forward offload")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260207-icssg-dep-v3-1-8c47c1937f81@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ti/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/ethernet/ti/Kconfig b/drivers/net/ethernet/ti/Kconfig
index fe5b2926d8ab0..c60b04921c62c 100644
--- a/drivers/net/ethernet/ti/Kconfig
+++ b/drivers/net/ethernet/ti/Kconfig
@@ -192,6 +192,7 @@ config TI_ICSSG_PRUETH
depends on NET_SWITCHDEV
depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER
depends on PTP_1588_CLOCK_OPTIONAL
+ depends on HSR || !HSR
help
Support dual Gigabit Ethernet ports over the ICSSG PRU Subsystem.
This subsystem is available starting with the AM65 platform.
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 696/752] net: macb: Fix tx/rx malfunction after phy link down and up
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (232 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 695/752] net: ti: icssg-prueth: Add optional dependency on HSR Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 697/752] tracing: Fix to set write permission to per-cpu buffer_size_kb Sasha Levin
` (50 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Kevin Hao, stable, Paolo Abeni, Sasha Levin
From: Kevin Hao <haokexin@gmail.com>
[ Upstream commit bf9cf80cab81e39701861a42877a28295ade266f ]
In commit 99537d5c476c ("net: macb: Relocate mog_init_rings() callback
from macb_mac_link_up() to macb_open()"), the mog_init_rings() callback
was moved from macb_mac_link_up() to macb_open() to resolve a deadlock
issue. However, this change introduced a tx/rx malfunction following
phy link down and up events. The issue arises from a mismatch between
the software queue->tx_head, queue->tx_tail, queue->rx_prepared_head,
and queue->rx_tail values and the hardware's internal tx/rx queue
pointers.
According to the Zynq UltraScale TRM [1], when tx/rx is disabled, the
internal tx queue pointer resets to the value in the tx queue base
address register, while the internal rx queue pointer remains unchanged.
The following is quoted from the Zynq UltraScale TRM:
When transmit is disabled, with bit [3] of the network control register
set low, the transmit-buffer queue pointer resets to point to the address
indicated by the transmit-buffer queue base address register. Disabling
receive does not have the same effect on the receive-buffer queue
pointer.
Additionally, there is no need to reset the RBQP and TBQP registers in a
phy event callback. Therefore, move macb_init_buffers() to macb_open().
In a phy link up event, the only required action is to reset the tx
software head and tail pointers to align with the hardware's behavior.
[1] https://docs.amd.com/v/u/en-US/ug1085-zynq-ultrascale-trm
Fixes: 99537d5c476c ("net: macb: Relocate mog_init_rings() callback from macb_mac_link_up() to macb_open()")
Signed-off-by: Kevin Hao <haokexin@gmail.com>
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260208-macb-init-ring-v1-1-939a32c14635@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/cadence/macb_main.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 064fccdcf6994..90550055c71c1 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -741,14 +741,12 @@ static void macb_mac_link_up(struct phylink_config *config,
if (rx_pause)
ctrl |= MACB_BIT(PAE);
- /* Initialize rings & buffers as clearing MACB_BIT(TE) in link down
- * cleared the pipeline and control registers.
- */
- macb_init_buffers(bp);
-
- for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue)
+ for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
+ queue->tx_head = 0;
+ queue->tx_tail = 0;
queue_writel(queue, IER,
bp->rx_intr_mask | MACB_TX_INT_FLAGS | MACB_BIT(HRESP));
+ }
}
macb_or_gem_writel(bp, NCFGR, ctrl);
@@ -2991,6 +2989,7 @@ static int macb_open(struct net_device *dev)
}
bp->macbgem_ops.mog_init_rings(bp);
+ macb_init_buffers(bp);
for (q = 0, queue = bp->queues; q < bp->num_queues; ++q, ++queue) {
napi_enable(&queue->napi_rx);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 697/752] tracing: Fix to set write permission to per-cpu buffer_size_kb
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (233 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 696/752] net: macb: Fix tx/rx malfunction after phy link down and up Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 698/752] tracing: Reset last_boot_info if ring buffer is reset Sasha Levin
` (49 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Masami Hiramatsu (Google), stable, Mathieu Desnoyers,
Steven Rostedt (Google), Sasha Levin
From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
[ Upstream commit f844282deed7481cf2f813933229261e27306551 ]
Since the per-cpu buffer_size_kb file is writable for changing
per-cpu ring buffer size, the file should have the write access
permission.
Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/177071301597.2293046.11683339475076917920.stgit@mhiramat.tok.corp.google.com
Fixes: 21ccc9cd7211 ("tracing: Disable "other" permission bits in the tracefs files")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 907923d5f8bbb..e1d902464e080 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -9183,7 +9183,7 @@ tracing_init_tracefs_percpu(struct trace_array *tr, long cpu)
trace_create_cpu_file("stats", TRACE_MODE_READ, d_cpu,
tr, cpu, &tracing_stats_fops);
- trace_create_cpu_file("buffer_size_kb", TRACE_MODE_READ, d_cpu,
+ trace_create_cpu_file("buffer_size_kb", TRACE_MODE_WRITE, d_cpu,
tr, cpu, &tracing_entries_fops);
if (tr->range_addr_start)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 698/752] tracing: Reset last_boot_info if ring buffer is reset
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (234 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 697/752] tracing: Fix to set write permission to per-cpu buffer_size_kb Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 699/752] ceph: do not propagate page array emplacement errors as batch errors Sasha Levin
` (48 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Masami Hiramatsu (Google), stable, Mathieu Desnoyers,
Steven Rostedt (Google), Sasha Levin
From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
[ Upstream commit 804c4a2209bcf6ed4c45386f033e4d0f7c5bfda5 ]
Commit 32dc0042528d ("tracing: Reset last-boot buffers when reading
out all cpu buffers") resets the last_boot_info when user read out
all data via trace_pipe* files. But it is not reset when user
resets the buffer from other files. (e.g. write `trace` file)
Reset it when the corresponding ring buffer is reset too.
Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://patch.msgid.link/177071302364.2293046.17895165659153977720.stgit@mhiramat.tok.corp.google.com
Fixes: 32dc0042528d ("tracing: Reset last-boot buffers when reading out all cpu buffers")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index e1d902464e080..d2eabc162205c 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -4852,6 +4852,8 @@ static int tracing_single_release_tr(struct inode *inode, struct file *file)
return single_release(inode, file);
}
+static bool update_last_data_if_empty(struct trace_array *tr);
+
static int tracing_open(struct inode *inode, struct file *file)
{
struct trace_array *tr = inode->i_private;
@@ -4876,6 +4878,8 @@ static int tracing_open(struct inode *inode, struct file *file)
tracing_reset_online_cpus(trace_buf);
else
tracing_reset_cpu(trace_buf, cpu);
+
+ update_last_data_if_empty(tr);
}
if (file->f_mode & FMODE_READ) {
@@ -5917,6 +5921,7 @@ tracing_set_trace_read(struct file *filp, char __user *ubuf,
int tracer_init(struct tracer *t, struct trace_array *tr)
{
tracing_reset_online_cpus(&tr->array_buffer);
+ update_last_data_if_empty(tr);
return t->init(tr);
}
@@ -7582,6 +7587,7 @@ int tracing_set_clock(struct trace_array *tr, const char *clockstr)
ring_buffer_set_clock(tr->max_buffer.buffer, trace_clocks[i].func);
tracing_reset_online_cpus(&tr->max_buffer);
#endif
+ update_last_data_if_empty(tr);
if (tr->scratch && !(tr->flags & TRACE_ARRAY_FL_LAST_BOOT)) {
struct trace_scratch *tscratch = tr->scratch;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 699/752] ceph: do not propagate page array emplacement errors as batch errors
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (235 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 698/752] tracing: Reset last_boot_info if ring buffer is reset Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 700/752] ceph: fix write storm on fscrypted files Sasha Levin
` (47 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Sam Edwards, stable, Sam Edwards, Ilya Dryomov, Sasha Levin
From: Sam Edwards <cfsworks@gmail.com>
[ Upstream commit 707104682e3c163f7c14cdd6b07a3e95fb374759 ]
When fscrypt is enabled, move_dirty_folio_in_page_array() may fail
because it needs to allocate bounce buffers to store the encrypted
versions of each folio. Each folio beyond the first allocates its bounce
buffer with GFP_NOWAIT. Failures are common (and expected) under this
allocation mode; they should flush (not abort) the batch.
However, ceph_process_folio_batch() uses the same `rc` variable for its
own return code and for capturing the return codes of its routine calls;
failing to reset `rc` back to 0 results in the error being propagated
out to the main writeback loop, which cannot actually tolerate any
errors here: once `ceph_wbc.pages` is allocated, it must be passed to
ceph_submit_write() to be freed. If it survives until the next iteration
(e.g. due to the goto being followed), ceph_allocate_page_array()'s
BUG_ON() will oops the worker.
Note that this failure mode is currently masked due to another bug
(addressed next in this series) that prevents multiple encrypted folios
from being selected for the same write.
For now, just reset `rc` when redirtying the folio to prevent errors in
move_dirty_folio_in_page_array() from propagating. Note that
move_dirty_folio_in_page_array() is careful never to return errors on
the first folio, so there is no need to check for that. After this
change, ceph_process_folio_batch() no longer returns errors; its only
remaining failure indicator is `locked_pages == 0`, which the caller
already handles correctly.
Cc: stable@vger.kernel.org
Fixes: ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method")
Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ceph/addr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 9faeaf1196c5c..32447023615a0 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1373,6 +1373,7 @@ int ceph_process_folio_batch(struct address_space *mapping,
rc = move_dirty_folio_in_page_array(mapping, wbc, ceph_wbc,
folio);
if (rc) {
+ rc = 0;
folio_redirty_for_writepage(wbc, folio);
folio_unlock(folio);
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 700/752] ceph: fix write storm on fscrypted files
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (236 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 699/752] ceph: do not propagate page array emplacement errors as batch errors Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 701/752] io_uring/filetable: clamp alloc_hint to the configured alloc range Sasha Levin
` (46 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Sam Edwards, stable, Sam Edwards, Ilya Dryomov, Sasha Levin
From: Sam Edwards <cfsworks@gmail.com>
[ Upstream commit cac190c7674fea71620d754ffcdaaeed7c551dbc ]
CephFS stores file data across multiple RADOS objects. An object is the
atomic unit of storage, so the writeback code must clean only folios
that belong to the same object with each OSD request.
CephFS also supports RAID0-style striping of file contents: if enabled,
each object stores multiple unbroken "stripe units" covering different
portions of the file; if disabled, a "stripe unit" is simply the whole
object. The stripe unit is (usually) reported as the inode's block size.
Though the writeback logic could, in principle, lock all dirty folios
belonging to the same object, its current design is to lock only a
single stripe unit at a time. Ever since this code was first written,
it has determined this size by checking the inode's block size.
However, the relatively-new fscrypt support needed to reduce the block
size for encrypted inodes to the crypto block size (see 'fixes' commit),
which causes an unnecessarily high number of write operations (~1024x as
many, with 4MiB objects) and correspondingly degraded performance.
Fix this (and clarify intent) by using i_layout.stripe_unit directly in
ceph_define_write_size() so that encrypted inodes are written back with
the same number of operations as if they were unencrypted.
This patch depends on the preceding commit ("ceph: do not propagate page
array emplacement errors as batch errors") for correctness. While it
applies cleanly on its own, applying it alone will introduce a
regression. This dependency is only relevant for kernels where
ce80b76dd327 ("ceph: introduce ceph_process_folio_batch() method") has
been applied; stable kernels without that commit are unaffected.
Cc: stable@vger.kernel.org
Fixes: 94af0470924c ("ceph: add some fscrypt guardrails")
Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/ceph/addr.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/ceph/addr.c b/fs/ceph/addr.c
index 32447023615a0..261f8996abc0f 100644
--- a/fs/ceph/addr.c
+++ b/fs/ceph/addr.c
@@ -1000,7 +1000,8 @@ unsigned int ceph_define_write_size(struct address_space *mapping)
{
struct inode *inode = mapping->host;
struct ceph_fs_client *fsc = ceph_inode_to_fs_client(inode);
- unsigned int wsize = i_blocksize(inode);
+ struct ceph_inode_info *ci = ceph_inode(inode);
+ unsigned int wsize = ci->i_layout.stripe_unit;
if (fsc->mount_options->wsize < wsize)
wsize = fsc->mount_options->wsize;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 701/752] io_uring/filetable: clamp alloc_hint to the configured alloc range
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (237 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 700/752] ceph: fix write storm on fscrypted files Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 702/752] io_uring/openclose: fix io_pipe_fixed() slot tracking for specific slots Sasha Levin
` (45 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Jens Axboe, stable, Sasha Levin
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit a6bded921ed35f21b3f6bd8e629bf488499ca442 ]
Explicit fixed file install/remove operations on slots outside the
configured alloc range can corrupt alloc_hint via io_file_bitmap_set()
and io_file_bitmap_clear(), which unconditionally update alloc_hint to
the bit position. This causes subsequent auto-allocations to fall
outside the configured range.
For example, if the alloc range is [10, 20) and a file is removed at
slot 2, alloc_hint gets set to 2. The next auto-alloc then starts
searching from slot 2, potentially returning a slot below the range.
Fix this by clamping alloc_hint to [file_alloc_start, file_alloc_end)
at the top of io_file_bitmap_get() before starting the search.
Cc: stable@vger.kernel.org
Fixes: 6e73dffbb93c ("io_uring: let to set a range for file slot allocation")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/filetable.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/io_uring/filetable.c b/io_uring/filetable.c
index 794ef95df293c..cb1838c9fc377 100644
--- a/io_uring/filetable.c
+++ b/io_uring/filetable.c
@@ -22,6 +22,10 @@ static int io_file_bitmap_get(struct io_ring_ctx *ctx)
if (!table->bitmap)
return -ENFILE;
+ if (table->alloc_hint < ctx->file_alloc_start ||
+ table->alloc_hint >= ctx->file_alloc_end)
+ table->alloc_hint = ctx->file_alloc_start;
+
do {
ret = find_next_zero_bit(table->bitmap, nr, table->alloc_hint);
if (ret != nr)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 702/752] io_uring/openclose: fix io_pipe_fixed() slot tracking for specific slots
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (238 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 701/752] io_uring/filetable: clamp alloc_hint to the configured alloc range Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 703/752] drm/amd/display: Increase DCN35 SR enter/exit latency Sasha Levin
` (44 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches; +Cc: Jens Axboe, stable, Sasha Levin
From: Jens Axboe <axboe@kernel.dk>
[ Upstream commit f4d0668b38d8784f33a9a36c72ed5d0078247538 ]
__io_fixed_fd_install() returns 0 on success for non-alloc mode
(specific slot), not the slot index. io_pipe_fixed() used this return
value directly as the slot index in fds[], which can cause the reported
values returned via copy_to_user() to be incorrect, or the error path
operating on the incorrect direct descriptor.
Fix by computing the actual 0-based slot index (slot - 1) for specific
slot mode, while preserving the existing behavior for auto-alloc mode
where __io_fixed_fd_install() already returns the allocated index.
Cc: stable@vger.kernel.org
Fixes: 53db8a71ecb4 ("io_uring: add support for IORING_OP_PIPE")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/openclose.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/io_uring/openclose.c b/io_uring/openclose.c
index 15dde9bd6ff67..606ce0664e6a4 100644
--- a/io_uring/openclose.c
+++ b/io_uring/openclose.c
@@ -336,31 +336,34 @@ static int io_pipe_fixed(struct io_kiocb *req, struct file **files,
{
struct io_pipe *p = io_kiocb_to_cmd(req, struct io_pipe);
struct io_ring_ctx *ctx = req->ctx;
+ bool alloc_slot;
int ret, fds[2] = { -1, -1 };
int slot = p->file_slot;
if (p->flags & O_CLOEXEC)
return -EINVAL;
+ alloc_slot = slot == IORING_FILE_INDEX_ALLOC;
+
io_ring_submit_lock(ctx, issue_flags);
ret = __io_fixed_fd_install(ctx, files[0], slot);
if (ret < 0)
goto err;
- fds[0] = ret;
+ fds[0] = alloc_slot ? ret : slot - 1;
files[0] = NULL;
/*
* If a specific slot is given, next one will be used for
* the write side.
*/
- if (slot != IORING_FILE_INDEX_ALLOC)
+ if (!alloc_slot)
slot++;
ret = __io_fixed_fd_install(ctx, files[1], slot);
if (ret < 0)
goto err;
- fds[1] = ret;
+ fds[1] = alloc_slot ? ret : slot - 1;
files[1] = NULL;
io_ring_submit_unlock(ctx, issue_flags);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 703/752] drm/amd/display: Increase DCN35 SR enter/exit latency
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (239 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 702/752] io_uring/openclose: fix io_pipe_fixed() slot tracking for specific slots Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 704/752] drm/amdgpu: fix sync handling in amdgpu_dma_buf_move_notify Sasha Levin
` (43 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Leo Li, Nicholas Kazlauskas, Tom Chung, Daniel Wheeler,
Alex Deucher, stable, Sasha Levin
From: Leo Li <sunpeng.li@amd.com>
[ Upstream commit 318917e1d8ecc89f820f4fabf79935f4fed718cd ]
[Why & How]
On Framework laptops with DDR5 modules, underflow can be observed.
It's unclear why it only occurs on specific desktop contents. However,
increasing enter/exit latencies by 3us seems to resolve it.
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4463
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Tom Chung <chiahsuan.chung@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
.../amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 16 ++++++++--------
.../gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
index 1eb04772f5da2..817a0253d10e5 100644
--- a/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
+++ b/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
@@ -768,32 +768,32 @@ static struct wm_table ddr5_wm_table = {
.wm_inst = WM_A,
.wm_type = WM_TYPE_PSTATE_CHG,
.pstate_latency_us = 11.72,
- .sr_exit_time_us = 28.0,
- .sr_enter_plus_exit_time_us = 30.0,
+ .sr_exit_time_us = 31.0,
+ .sr_enter_plus_exit_time_us = 33.0,
.valid = true,
},
{
.wm_inst = WM_B,
.wm_type = WM_TYPE_PSTATE_CHG,
.pstate_latency_us = 11.72,
- .sr_exit_time_us = 28.0,
- .sr_enter_plus_exit_time_us = 30.0,
+ .sr_exit_time_us = 31.0,
+ .sr_enter_plus_exit_time_us = 33.0,
.valid = true,
},
{
.wm_inst = WM_C,
.wm_type = WM_TYPE_PSTATE_CHG,
.pstate_latency_us = 11.72,
- .sr_exit_time_us = 28.0,
- .sr_enter_plus_exit_time_us = 30.0,
+ .sr_exit_time_us = 31.0,
+ .sr_enter_plus_exit_time_us = 33.0,
.valid = true,
},
{
.wm_inst = WM_D,
.wm_type = WM_TYPE_PSTATE_CHG,
.pstate_latency_us = 11.72,
- .sr_exit_time_us = 28.0,
- .sr_enter_plus_exit_time_us = 30.0,
+ .sr_exit_time_us = 31.0,
+ .sr_enter_plus_exit_time_us = 33.0,
.valid = true,
},
}
diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c
index 817a370e80a77..8a177d5ae213e 100644
--- a/drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c
+++ b/drivers/gpu/drm/amd/display/dc/dml/dcn35/dcn35_fpu.c
@@ -164,8 +164,8 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_5_soc = {
},
},
.num_states = 5,
- .sr_exit_time_us = 28.0,
- .sr_enter_plus_exit_time_us = 30.0,
+ .sr_exit_time_us = 31.0,
+ .sr_enter_plus_exit_time_us = 33.0,
.sr_exit_z8_time_us = 250.0,
.sr_enter_plus_exit_z8_time_us = 350.0,
.fclk_change_latency_us = 24.0,
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 704/752] drm/amdgpu: fix sync handling in amdgpu_dma_buf_move_notify
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (240 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 703/752] drm/amd/display: Increase DCN35 SR enter/exit latency Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 705/752] mm/hugetlb: restore failed global reservations to subpool Sasha Levin
` (42 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Pierre-Eric Pelloux-Prayer, stable, Christian König,
Alex Deucher, Sasha Levin
From: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
[ Upstream commit b18fc0ab837381c1a6ef28386602cd888f2d9edf ]
Invalidating a dmabuf will impact other users of the shared BO.
In the scenario where process A moves the BO, it needs to inform
process B about the move and process B will need to update its
page table.
The commit fixes a synchronisation bug caused by the use of the
ticket: it made amdgpu_vm_handle_moved behave as if updating
the page table immediately was correct but in this case it's not.
An example is the following scenario, with 2 GPUs and glxgears
running on GPU0 and Xorg running on GPU1, on a system where P2P
PCI isn't supported:
glxgears:
export linear buffer from GPU0 and import using GPU1
submit frame rendering to GPU0
submit tiled->linear blit
Xorg:
copy of linear buffer
The sequence of jobs would be:
drm_sched_job_run # GPU0, frame rendering
drm_sched_job_queue # GPU0, blit
drm_sched_job_done # GPU0, frame rendering
drm_sched_job_run # GPU0, blit
move linear buffer for GPU1 access #
amdgpu_dma_buf_move_notify -> update pt # GPU0
It this point the blit job on GPU0 is still running and would
likely produce a page fault.
Cc: stable@vger.kernel.org
Fixes: a448cb003edc ("drm/amdgpu: implement amdgpu_gem_prime_move_notify v2")
Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
index ed3bef1edfe44..f20d4bc58904d 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
@@ -489,8 +489,15 @@ amdgpu_dma_buf_move_notify(struct dma_buf_attachment *attach)
r = dma_resv_reserve_fences(resv, 2);
if (!r)
r = amdgpu_vm_clear_freed(adev, vm, NULL);
+
+ /* Don't pass 'ticket' to amdgpu_vm_handle_moved: we want the clear=true
+ * path to be used otherwise we might update the PT of another process
+ * while it's using the BO.
+ * With clear=true, amdgpu_vm_bo_update will sync to command submission
+ * from the same VM.
+ */
if (!r)
- r = amdgpu_vm_handle_moved(adev, vm, ticket);
+ r = amdgpu_vm_handle_moved(adev, vm, NULL);
if (r && r != -EBUSY)
DRM_ERROR("Failed to invalidate VM page tables (%d))\n",
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 705/752] mm/hugetlb: restore failed global reservations to subpool
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (241 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 704/752] drm/amdgpu: fix sync handling in amdgpu_dma_buf_move_notify Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 706/752] mm/page_alloc: skip debug_check_no_{obj,locks}_freed with FPI_TRYLOCK Sasha Levin
` (41 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Joshua Hahn, Usama Arif, David Hildenbrand, Liam R. Howlett,
Lorenzo Stoakes, Ma Wupeng, Michal Hocko, Mike Rapoport,
Muchun Song, Oscar Salvador, Shakeel Butt, Suren Baghdasaryan,
Vlastimil Babka, Waiman Long, stable, Andrew Morton, Sasha Levin
From: Joshua Hahn <joshua.hahnjy@gmail.com>
[ Upstream commit 1d3f9bb4c8af70304d19c22e30f5d16a2d589bb5 ]
Commit a833a693a490 ("mm: hugetlb: fix incorrect fallback for subpool")
fixed an underflow error for hstate->resv_huge_pages caused by incorrectly
attributing globally requested pages to the subpool's reservation.
Unfortunately, this fix also introduced the opposite problem, which would
leave spool->used_hpages elevated if the globally requested pages could
not be acquired. This is because while a subpool's reserve pages only
accounts for what is requested and allocated from the subpool, its "used"
counter keeps track of what is consumed in total, both from the subpool
and globally. Thus, we need to adjust spool->used_hpages in the other
direction, and make sure that globally requested pages are uncharged from
the subpool's used counter.
Each failed allocation attempt increments the used_hpages counter by how
many pages were requested from the global pool. Ultimately, this renders
the subpool unusable, as used_hpages approaches the max limit.
The issue can be reproduced as follows:
1. Allocate 4 hugetlb pages
2. Create a hugetlb mount with max=4, min=2
3. Consume 2 pages globally
4. Request 3 pages from the subpool (2 from subpool + 1 from global)
4.1 hugepage_subpool_get_pages(spool, 3) succeeds.
used_hpages += 3
4.2 hugetlb_acct_memory(h, 1) fails: no global pages left
used_hpages -= 2
5. Subpool now has used_hpages = 1, despite not being able to
successfully allocate any hugepages. It believes it can now only
allocate 3 more hugepages, not 4.
With each failed allocation attempt incrementing the used counter, the
subpool eventually reaches a point where its used counter equals its
max counter. At that point, any future allocations that try to
allocate hugeTLB pages from the subpool will fail, despite the subpool
not having any of its hugeTLB pages consumed by any user.
Once this happens, there is no way to make the subpool usable again,
since there is no way to decrement the used counter as no process is
really consuming the hugeTLB pages.
The underflow issue that the original commit fixes still remains fixed
as well.
Without this fix, used_hpages would keep on leaking if
hugetlb_acct_memory() fails.
Link: https://lkml.kernel.org/r/20260116204037.2270096-1-joshua.hahnjy@gmail.com
Fixes: a833a693a490 ("mm: hugetlb: fix incorrect fallback for subpool")
Signed-off-by: Joshua Hahn <joshua.hahnjy@gmail.com>
Acked-by: Usama Arif <usama.arif@linux.dev>
Cc: David Hildenbrand <david@kernel.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Ma Wupeng <mawupeng1@huawei.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Oscar Salvador <osalvador@suse.de>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Waiman Long <longman@redhat.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/hugetlb.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index be0f935a8b121..13293976e0568 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -7386,6 +7386,15 @@ long hugetlb_reserve_pages(struct inode *inode,
*/
hugetlb_acct_memory(h, -gbl_resv);
}
+ /* Restore used_hpages for pages that failed global reservation */
+ if (gbl_reserve && spool) {
+ unsigned long flags;
+
+ spin_lock_irqsave(&spool->lock, flags);
+ if (spool->max_hpages != -1)
+ spool->used_hpages -= gbl_reserve;
+ unlock_or_release_subpool(spool, flags);
+ }
out_uncharge_cgroup:
hugetlb_cgroup_uncharge_cgroup_rsvd(hstate_index(h),
chg * pages_per_huge_page(h), h_cg);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 706/752] mm/page_alloc: skip debug_check_no_{obj,locks}_freed with FPI_TRYLOCK
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (242 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 705/752] mm/hugetlb: restore failed global reservations to subpool Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 707/752] procfs: fix possible double mmput() in do_procmap_query() Sasha Levin
` (40 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Harry Yoo, Vlastimil Babka, Zi Yan, Alexei Starovoitov,
Brendan Jackman, Johannes Weiner, Michal Hocko,
Sebastian Andrzej Siewior, Shakeel Butt, Suren Baghdasaryan,
stable, Andrew Morton, Sasha Levin
From: Harry Yoo <harry.yoo@oracle.com>
[ Upstream commit 338ad1e84d15078a9ae46d7dd7466329ae0bfa61 ]
When CONFIG_DEBUG_OBJECTS_FREE is enabled,
debug_check_no_{obj,locks}_freed() functions are called.
Since both of them spin on a lock, they are not safe to be called if the
FPI_TRYLOCK flag is specified. This leads to a lockdep splat:
================================
WARNING: inconsistent lock state
6.19.0-rc5-slab-for-next+ #326 Tainted: G N
--------------------------------
inconsistent {INITIAL USE} -> {IN-NMI} usage.
kunit_try_catch/9046 [HC2[2]:SC0[0]:HE0:SE1] takes:
ffffffff84ed6bf8 (&obj_hash[i].lock){-.-.}-{2:2}, at: __debug_check_no_obj_freed+0xe0/0x300
{INITIAL USE} state was registered at:
lock_acquire+0xd9/0x2f0
_raw_spin_lock_irqsave+0x4c/0x80
__debug_object_init+0x9d/0x1f0
debug_object_init+0x34/0x50
__init_work+0x28/0x40
init_cgroup_housekeeping+0x151/0x210
init_cgroup_root+0x3d/0x140
cgroup_init_early+0x30/0x240
start_kernel+0x3e/0xcd0
x86_64_start_reservations+0x18/0x30
x86_64_start_kernel+0xf3/0x140
common_startup_64+0x13e/0x148
irq event stamp: 2998
hardirqs last enabled at (2997): [<ffffffff8298b77a>] exc_nmi+0x11a/0x240
hardirqs last disabled at (2998): [<ffffffff8298b991>] sysvec_irq_work+0x11/0x110
softirqs last enabled at (1416): [<ffffffff813c1f72>] __irq_exit_rcu+0x132/0x1c0
softirqs last disabled at (1303): [<ffffffff813c1f72>] __irq_exit_rcu+0x132/0x1c0
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(&obj_hash[i].lock);
<Interrupt>
lock(&obj_hash[i].lock);
*** DEADLOCK ***
Rename free_pages_prepare() to __free_pages_prepare(), add an fpi_t
parameter, and skip those checks if FPI_TRYLOCK is set. To keep the fpi_t
definition in mm/page_alloc.c, add a wrapper function free_pages_prepare()
that always passes FPI_NONE and use it in mm/compaction.c.
Link: https://lkml.kernel.org/r/20260209062639.16577-1-harry.yoo@oracle.com
Fixes: 8c57b687e833 ("mm, bpf: Introduce free_pages_nolock()")
Signed-off-by: Harry Yoo <harry.yoo@oracle.com>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Acked-by: Zi Yan <ziy@nvidia.com>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 10708f37575d4..f44524e1c92ac 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1339,8 +1339,8 @@ static inline void pgalloc_tag_sub_pages(struct alloc_tag *tag, unsigned int nr)
#endif /* CONFIG_MEM_ALLOC_PROFILING */
-__always_inline bool free_pages_prepare(struct page *page,
- unsigned int order)
+__always_inline bool __free_pages_prepare(struct page *page,
+ unsigned int order, fpi_t fpi_flags)
{
int bad = 0;
bool skip_kasan_poison = should_skip_kasan_poison(page);
@@ -1433,7 +1433,7 @@ __always_inline bool free_pages_prepare(struct page *page,
page_table_check_free(page, order);
pgalloc_tag_sub(page, 1 << order);
- if (!PageHighMem(page)) {
+ if (!PageHighMem(page) && !(fpi_flags & FPI_TRYLOCK)) {
debug_check_no_locks_freed(page_address(page),
PAGE_SIZE << order);
debug_check_no_obj_freed(page_address(page),
@@ -1472,6 +1472,11 @@ __always_inline bool free_pages_prepare(struct page *page,
return true;
}
+bool free_pages_prepare(struct page *page, unsigned int order)
+{
+ return __free_pages_prepare(page, order, FPI_NONE);
+}
+
/*
* Frees a number of pages from the PCP lists
* Assumes all pages on list are in same zone.
@@ -1605,7 +1610,7 @@ static void __free_pages_ok(struct page *page, unsigned int order,
unsigned long pfn = page_to_pfn(page);
struct zone *zone = page_zone(page);
- if (free_pages_prepare(page, order))
+ if (__free_pages_prepare(page, order, fpi_flags))
free_one_page(zone, page, pfn, order, fpi_flags);
}
@@ -2931,7 +2936,7 @@ static void __free_frozen_pages(struct page *page, unsigned int order,
return;
}
- if (!free_pages_prepare(page, order))
+ if (!__free_pages_prepare(page, order, fpi_flags))
return;
/*
@@ -2988,7 +2993,7 @@ void free_unref_folios(struct folio_batch *folios)
unsigned long pfn = folio_pfn(folio);
unsigned int order = folio_order(folio);
- if (!free_pages_prepare(&folio->page, order))
+ if (!__free_pages_prepare(&folio->page, order, FPI_NONE))
continue;
/*
* Free orders not handled on the PCP directly to the
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 707/752] procfs: fix possible double mmput() in do_procmap_query()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (243 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 706/752] mm/page_alloc: skip debug_check_no_{obj,locks}_freed with FPI_TRYLOCK Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 708/752] mm/vmscan: fix demotion targets checks in reclaim/demotion Sasha Levin
` (39 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Andrii Nakryiko, Ruikai Peng, Thomas Gleixner, Shakeel Butt,
syzbot+237b5b985b78c1da9600, stable, Andrew Morton, Sasha Levin
From: Andrii Nakryiko <andrii@kernel.org>
[ Upstream commit 61dc9f776705d6db6847c101b98fa4f0e9eb6fa3 ]
When user provides incorrectly sized buffer for build ID for PROCMAP_QUERY
we return with -ENAMETOOLONG error. After recent changes this condition
happens later, after we unlocked mmap_lock/per-VMA lock and did mmput(),
so original goto out is now wrong and will double-mmput() mm_struct. Fix
by jumping further to clean up only vm_file and name_buf.
Link: https://lkml.kernel.org/r/20260210192738.3041609-1-andrii@kernel.org
Fixes: b5cbacd7f86f ("procfs: avoid fetching build ID while holding VMA lock")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Reported-by: Ruikai Peng <ruikai@pwno.io>
Reported-by: Thomas Gleixner <tglx@kernel.org>
Tested-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Shakeel Butt <shakeel.butt@linux.dev>
Reported-by: syzbot+237b5b985b78c1da9600@syzkaller.appspotmail.com
Cc: Ruikai Peng <ruikai@pwno.io>
Closes: https://lkml.kernel.org/r/CAFD3drOJANTZPuyiqMdqpiRwOKnHwv5QgMNZghCDr-WxdiHvMg@mail.gmail.com
Closes: https://lore.kernel.org/all/698aaf3c.050a0220.3b3015.0088.GAE@google.com/T/#u
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/proc/task_mmu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 2ee152a318f50..b490245ff9be7 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -780,7 +780,7 @@ static int do_procmap_query(struct mm_struct *mm, void __user *uarg)
} else {
if (karg.build_id_size < build_id_sz) {
err = -ENAMETOOLONG;
- goto out;
+ goto out_file;
}
karg.build_id_size = build_id_sz;
}
@@ -808,6 +808,7 @@ static int do_procmap_query(struct mm_struct *mm, void __user *uarg)
out:
query_vma_teardown(&lock_ctx);
mmput(mm);
+out_file:
if (vm_file)
fput(vm_file);
kfree(name_buf);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 708/752] mm/vmscan: fix demotion targets checks in reclaim/demotion
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (244 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 707/752] procfs: fix possible double mmput() in do_procmap_query() Sasha Levin
@ 2026-02-28 17:46 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 709/752] mm/page_alloc: clear page->private in free_pages_prepare() Sasha Levin
` (38 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:46 UTC (permalink / raw)
To: patches
Cc: Bing Jiao, Shakeel Butt, Axel Rasmussen, David Hildenbrand,
Gregory Price, Johannes Weiner, Joshua Hahn, Liam Howlett,
Lorenzo Stoakes, Michal Hocko, Mike Rapoport, Muchun Song,
Qi Zheng, Roman Gushchin, Suren Baghdasaryan, Tejun Heo,
Vlastimil Babka, Waiman Long, Wei Xu, Yuanchu Xie, stable,
Andrew Morton, Sasha Levin
From: Bing Jiao <bingjiao@google.com>
[ Upstream commit 1aceed565ff172fc0331dd1d5e7e65139b711139 ]
Patch series "mm/vmscan: fix demotion targets checks in reclaim/demotion",
v9.
This patch series addresses two issues in demote_folio_list(),
can_demote(), and next_demotion_node() in reclaim/demotion.
1. demote_folio_list() and can_demote() do not correctly check
demotion target against cpuset.mems_effective, which will cause (a)
pages to be demoted to not-allowed nodes and (b) pages fail demotion
even if the system still has allowed demotion nodes.
Patch 1 fixes this bug by updating cpuset_node_allowed() and
mem_cgroup_node_allowed() to return effective_mems, allowing directly
logic-and operation against demotion targets.
2. next_demotion_node() returns a preferred demotion target, but it
does not check the node against allowed nodes.
Patch 2 ensures that next_demotion_node() filters against the allowed
node mask and selects the closest demotion target to the source node.
This patch (of 2):
Fix two bugs in demote_folio_list() and can_demote() due to incorrect
demotion target checks against cpuset.mems_effective in reclaim/demotion.
Commit 7d709f49babc ("vmscan,cgroup: apply mems_effective to reclaim")
introduces the cpuset.mems_effective check and applies it to can_demote().
However:
1. It does not apply this check in demote_folio_list(), which leads
to situations where pages are demoted to nodes that are
explicitly excluded from the task's cpuset.mems.
2. It checks only the nodes in the immediate next demotion hierarchy
and does not check all allowed demotion targets in can_demote().
This can cause pages to never be demoted if the nodes in the next
demotion hierarchy are not set in mems_effective.
These bugs break resource isolation provided by cpuset.mems. This is
visible from userspace because pages can either fail to be demoted
entirely or are demoted to nodes that are not allowed in multi-tier memory
systems.
To address these bugs, update cpuset_node_allowed() and
mem_cgroup_node_allowed() to return effective_mems, allowing directly
logic-and operation against demotion targets. Also update can_demote()
and demote_folio_list() accordingly.
Bug 1 reproduction:
Assume a system with 4 nodes, where nodes 0-1 are top-tier and
nodes 2-3 are far-tier memory. All nodes have equal capacity.
Test script:
echo 1 > /sys/kernel/mm/numa/demotion_enabled
mkdir /sys/fs/cgroup/test
echo +cpuset > /sys/fs/cgroup/cgroup.subtree_control
echo "0-2" > /sys/fs/cgroup/test/cpuset.mems
echo $$ > /sys/fs/cgroup/test/cgroup.procs
swapoff -a
# Expectation: Should respect node 0-2 limit.
# Observation: Node 3 shows significant allocation (MemFree drops)
stress-ng --oomable --vm 1 --vm-bytes 150% --mbind 0,1
Bug 2 reproduction:
Assume a system with 6 nodes, where nodes 0-2 are top-tier,
node 3 is a far-tier node, and nodes 4-5 are the farthest-tier nodes.
All nodes have equal capacity.
Test script:
echo 1 > /sys/kernel/mm/numa/demotion_enabled
mkdir /sys/fs/cgroup/test
echo +cpuset > /sys/fs/cgroup/cgroup.subtree_control
echo "0-2,4-5" > /sys/fs/cgroup/test/cpuset.mems
echo $$ > /sys/fs/cgroup/test/cgroup.procs
swapoff -a
# Expectation: Pages are demoted to Nodes 4-5
# Observation: No pages are demoted before oom.
stress-ng --oomable --vm 1 --vm-bytes 150% --mbind 0,1,2
Link: https://lkml.kernel.org/r/20260114205305.2869796-1-bingjiao@google.com
Link: https://lkml.kernel.org/r/20260114205305.2869796-2-bingjiao@google.com
Fixes: 7d709f49babc ("vmscan,cgroup: apply mems_effective to reclaim")
Signed-off-by: Bing Jiao <bingjiao@google.com>
Acked-by: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Axel Rasmussen <axelrasmussen@google.com>
Cc: David Hildenbrand <david@kernel.org>
Cc: Gregory Price <gourry@gourry.net>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joshua Hahn <joshua.hahnjy@gmail.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Qi Zheng <zhengqi.arch@bytedance.com>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: Waiman Long <longman@redhat.com>
Cc: Wei Xu <weixugc@google.com>
Cc: Yuanchu Xie <yuanchu@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/cpuset.h | 6 ++---
include/linux/memcontrol.h | 6 ++---
kernel/cgroup/cpuset.c | 54 +++++++++++++++++++++++++-------------
mm/memcontrol.c | 16 +++++++++--
mm/vmscan.c | 34 +++++++++++++++---------
5 files changed, 78 insertions(+), 38 deletions(-)
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index 2ddb256187b51..75283991e77ab 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -173,7 +173,7 @@ static inline void set_mems_allowed(nodemask_t nodemask)
task_unlock(current);
}
-extern bool cpuset_node_allowed(struct cgroup *cgroup, int nid);
+extern void cpuset_nodes_allowed(struct cgroup *cgroup, nodemask_t *mask);
#else /* !CONFIG_CPUSETS */
static inline bool cpusets_enabled(void) { return false; }
@@ -294,9 +294,9 @@ static inline bool read_mems_allowed_retry(unsigned int seq)
return false;
}
-static inline bool cpuset_node_allowed(struct cgroup *cgroup, int nid)
+static inline void cpuset_nodes_allowed(struct cgroup *cgroup, nodemask_t *mask)
{
- return true;
+ nodes_copy(*mask, node_states[N_MEMORY]);
}
#endif /* !CONFIG_CPUSETS */
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 873e510d6f8d9..133591199933a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -1789,7 +1789,7 @@ static inline void count_objcg_events(struct obj_cgroup *objcg,
rcu_read_unlock();
}
-bool mem_cgroup_node_allowed(struct mem_cgroup *memcg, int nid);
+void mem_cgroup_node_filter_allowed(struct mem_cgroup *memcg, nodemask_t *mask);
#else
static inline bool mem_cgroup_kmem_disabled(void)
@@ -1853,9 +1853,9 @@ static inline ino_t page_cgroup_ino(struct page *page)
return 0;
}
-static inline bool mem_cgroup_node_allowed(struct mem_cgroup *memcg, int nid)
+static inline void mem_cgroup_node_filter_allowed(struct mem_cgroup *memcg,
+ nodemask_t *mask)
{
- return true;
}
#endif /* CONFIG_MEMCG */
diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c
index d779e29a9302d..abaa54037918a 100644
--- a/kernel/cgroup/cpuset.c
+++ b/kernel/cgroup/cpuset.c
@@ -4358,40 +4358,58 @@ bool cpuset_current_node_allowed(int node, gfp_t gfp_mask)
return allowed;
}
-bool cpuset_node_allowed(struct cgroup *cgroup, int nid)
+/**
+ * cpuset_nodes_allowed - return effective_mems mask from a cgroup cpuset.
+ * @cgroup: pointer to struct cgroup.
+ * @mask: pointer to struct nodemask_t to be returned.
+ *
+ * Returns effective_mems mask from a cgroup cpuset if it is cgroup v2 and
+ * has cpuset subsys. Otherwise, returns node_states[N_MEMORY].
+ *
+ * This function intentionally avoids taking the cpuset_mutex or callback_lock
+ * when accessing effective_mems. This is because the obtained effective_mems
+ * is stale immediately after the query anyway (e.g., effective_mems is updated
+ * immediately after releasing the lock but before returning).
+ *
+ * As a result, returned @mask may be empty because cs->effective_mems can be
+ * rebound during this call. Besides, nodes in @mask are not guaranteed to be
+ * online due to hot plugins. Callers should check the mask for validity on
+ * return based on its subsequent use.
+ **/
+void cpuset_nodes_allowed(struct cgroup *cgroup, nodemask_t *mask)
{
struct cgroup_subsys_state *css;
struct cpuset *cs;
- bool allowed;
/*
* In v1, mem_cgroup and cpuset are unlikely in the same hierarchy
* and mems_allowed is likely to be empty even if we could get to it,
- * so return true to avoid taking a global lock on the empty check.
+ * so return directly to avoid taking a global lock on the empty check.
*/
- if (!cpuset_v2())
- return true;
+ if (!cgroup || !cpuset_v2()) {
+ nodes_copy(*mask, node_states[N_MEMORY]);
+ return;
+ }
css = cgroup_get_e_css(cgroup, &cpuset_cgrp_subsys);
- if (!css)
- return true;
+ if (!css) {
+ nodes_copy(*mask, node_states[N_MEMORY]);
+ return;
+ }
/*
- * Normally, accessing effective_mems would require the cpuset_mutex
- * or callback_lock - but node_isset is atomic and the reference
- * taken via cgroup_get_e_css is sufficient to protect css.
- *
- * Since this interface is intended for use by migration paths, we
- * relax locking here to avoid taking global locks - while accepting
- * there may be rare scenarios where the result may be innaccurate.
+ * The reference taken via cgroup_get_e_css is sufficient to
+ * protect css, but it does not imply safe accesses to effective_mems.
*
- * Reclaim and migration are subject to these same race conditions, and
- * cannot make strong isolation guarantees, so this is acceptable.
+ * Normally, accessing effective_mems would require the cpuset_mutex
+ * or callback_lock - but the correctness of this information is stale
+ * immediately after the query anyway. We do not acquire the lock
+ * during this process to save lock contention in exchange for racing
+ * against mems_allowed rebinds.
*/
cs = container_of(css, struct cpuset, css);
- allowed = node_isset(nid, cs->effective_mems);
+ nodes_copy(*mask, cs->effective_mems);
css_put(css);
- return allowed;
}
/**
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4deda33625f41..ab25d540f0b8f 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5597,7 +5597,19 @@ subsys_initcall(mem_cgroup_swap_init);
#endif /* CONFIG_SWAP */
-bool mem_cgroup_node_allowed(struct mem_cgroup *memcg, int nid)
+void mem_cgroup_node_filter_allowed(struct mem_cgroup *memcg, nodemask_t *mask)
{
- return memcg ? cpuset_node_allowed(memcg->css.cgroup, nid) : true;
+ nodemask_t allowed;
+
+ if (!memcg)
+ return;
+
+ /*
+ * Since this interface is intended for use by migration paths, and
+ * reclaim and migration are subject to race conditions such as changes
+ * in effective_mems and hot-unpluging of nodes, inaccurate allowed
+ * mask is acceptable.
+ */
+ cpuset_nodes_allowed(memcg->css.cgroup, &allowed);
+ nodes_and(*mask, *mask, allowed);
}
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 06071995dacc9..05d9354a59c65 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -344,19 +344,21 @@ static void flush_reclaim_state(struct scan_control *sc)
static bool can_demote(int nid, struct scan_control *sc,
struct mem_cgroup *memcg)
{
- int demotion_nid;
+ struct pglist_data *pgdat = NODE_DATA(nid);
+ nodemask_t allowed_mask;
- if (!numa_demotion_enabled)
+ if (!pgdat || !numa_demotion_enabled)
return false;
if (sc && sc->no_demotion)
return false;
- demotion_nid = next_demotion_node(nid);
- if (demotion_nid == NUMA_NO_NODE)
+ node_get_allowed_targets(pgdat, &allowed_mask);
+ if (nodes_empty(allowed_mask))
return false;
- /* If demotion node isn't in the cgroup's mems_allowed, fall back */
- return mem_cgroup_node_allowed(memcg, demotion_nid);
+ /* Filter out nodes that are not in cgroup's mems_allowed. */
+ mem_cgroup_node_filter_allowed(memcg, &allowed_mask);
+ return !nodes_empty(allowed_mask);
}
static inline bool can_reclaim_anon_pages(struct mem_cgroup *memcg,
@@ -1042,9 +1044,10 @@ static struct folio *alloc_demote_folio(struct folio *src,
* Folios which are not demoted are left on @demote_folios.
*/
static unsigned int demote_folio_list(struct list_head *demote_folios,
- struct pglist_data *pgdat)
+ struct pglist_data *pgdat,
+ struct mem_cgroup *memcg)
{
- int target_nid = next_demotion_node(pgdat->node_id);
+ int target_nid;
unsigned int nr_succeeded;
nodemask_t allowed_mask;
@@ -1056,7 +1059,6 @@ static unsigned int demote_folio_list(struct list_head *demote_folios,
*/
.gfp_mask = (GFP_HIGHUSER_MOVABLE & ~__GFP_RECLAIM) | __GFP_NOWARN |
__GFP_NOMEMALLOC | GFP_NOWAIT,
- .nid = target_nid,
.nmask = &allowed_mask,
.reason = MR_DEMOTION,
};
@@ -1064,10 +1066,18 @@ static unsigned int demote_folio_list(struct list_head *demote_folios,
if (list_empty(demote_folios))
return 0;
- if (target_nid == NUMA_NO_NODE)
+ node_get_allowed_targets(pgdat, &allowed_mask);
+ mem_cgroup_node_filter_allowed(memcg, &allowed_mask);
+ if (nodes_empty(allowed_mask))
return 0;
- node_get_allowed_targets(pgdat, &allowed_mask);
+ target_nid = next_demotion_node(pgdat->node_id);
+ if (target_nid == NUMA_NO_NODE)
+ /* No lower-tier nodes or nodes were hot-unplugged. */
+ return 0;
+ if (!node_isset(target_nid, allowed_mask))
+ target_nid = node_random(&allowed_mask);
+ mtc.nid = target_nid;
/* Demotion ignores all cpuset and mempolicy settings */
migrate_pages(demote_folios, alloc_demote_folio, NULL,
@@ -1601,7 +1611,7 @@ static unsigned int shrink_folio_list(struct list_head *folio_list,
/* 'folio_list' is always empty here */
/* Migrate folios selected for demotion */
- nr_demoted = demote_folio_list(&demote_folios, pgdat);
+ nr_demoted = demote_folio_list(&demote_folios, pgdat, memcg);
nr_reclaimed += nr_demoted;
stat->nr_demoted += nr_demoted;
/* Folios that could not be demoted are still in @demote_folios */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 709/752] mm/page_alloc: clear page->private in free_pages_prepare()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (245 preceding siblings ...)
2026-02-28 17:46 ` [PATCH 6.18 708/752] mm/vmscan: fix demotion targets checks in reclaim/demotion Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 710/752] net: intel: fix PCI device ID conflict between i40e and ipw2200 Sasha Levin
` (37 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Mikhail Gavrilov, Zi Yan, David Hildenbrand (Arm),
Vlastimil Babka, Brendan Jackman, Chris Li, Hugh Dickins,
Johannes Weiner, Kairui Song, Matthew Wilcox (Oracle),
Michal Hocko, Nicholas Piggin, Suren Baghdasaryan, stable,
Andrew Morton, Sasha Levin
From: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
[ Upstream commit ac1ea219590c09572ed5992dc233bbf7bb70fef9 ]
Several subsystems (slub, shmem, ttm, etc.) use page->private but don't
clear it before freeing pages. When these pages are later allocated as
high-order pages and split via split_page(), tail pages retain stale
page->private values.
This causes a use-after-free in the swap subsystem. The swap code uses
page->private to track swap count continuations, assuming freshly
allocated pages have page->private == 0. When stale values are present,
swap_count_continued() incorrectly assumes the continuation list is valid
and iterates over uninitialized page->lru containing LIST_POISON values,
causing a crash:
KASAN: maybe wild-memory-access in range [0xdead000000000100-0xdead000000000107]
RIP: 0010:__do_sys_swapoff+0x1151/0x1860
Fix this by clearing page->private in free_pages_prepare(), ensuring all
freed pages have clean state regardless of previous use.
Link: https://lkml.kernel.org/r/20260207173615.146159-1-mikhail.v.gavrilov@gmail.com
Fixes: 3b8000ae185c ("mm/vmalloc: huge vmalloc backing pages should be split rather than compound")
Signed-off-by: Mikhail Gavrilov <mikhail.v.gavrilov@gmail.com>
Suggested-by: Zi Yan <ziy@nvidia.com>
Acked-by: Zi Yan <ziy@nvidia.com>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Chris Li <chrisl@kernel.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Kairui Song <ryncsn@gmail.com>
Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/page_alloc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index f44524e1c92ac..d76f0f60f080d 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -1429,6 +1429,7 @@ __always_inline bool __free_pages_prepare(struct page *page,
page_cpupid_reset_last(page);
page->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP;
+ page->private = 0;
reset_page_owner(page, order);
page_table_check_free(page, order);
pgalloc_tag_sub(page, 1 << order);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 710/752] net: intel: fix PCI device ID conflict between i40e and ipw2200
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (246 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 709/752] mm/page_alloc: clear page->private in free_pages_prepare() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 712/752] function_graph: Restore direct mode when callbacks drop to one Sasha Levin
` (36 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Ethan Nelson-Moore, stable, Johannes Berg, Aleksandr Loktionov,
Jakub Kicinski, Sasha Levin
From: Ethan Nelson-Moore <enelsonmoore@gmail.com>
[ Upstream commit d03e094473ecdeb68d853752ba467abe13e1de44 ]
The ID 8086:104f is matched by both i40e and ipw2200. The same device
ID should not be in more than one driver, because in that case, which
driver is used is unpredictable. Fix this by taking advantage of the
fact that i40e devices use PCI_CLASS_NETWORK_ETHERNET and ipw2200
devices use PCI_CLASS_NETWORK_OTHER to differentiate the devices.
Fixes: 2e45d3f4677a ("i40e: Add support for X710 B/P & SFP+ cards")
Cc: stable@vger.kernel.org
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Ethan Nelson-Moore <enelsonmoore@gmail.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Link: https://patch.msgid.link/20260210021235.16315-1-enelsonmoore@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/intel/i40e/i40e_main.c | 8 +++++++-
drivers/net/wireless/intel/ipw2x00/ipw2200.c | 8 +++++++-
2 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index d3bc3207054f9..02de186dcc8f5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -75,7 +75,13 @@ static const struct pci_device_id i40e_pci_tbl[] = {
{PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T4), 0},
{PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_BASE_T_BC), 0},
{PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_SFP), 0},
- {PCI_VDEVICE(INTEL, I40E_DEV_ID_10G_B), 0},
+ /*
+ * This ID conflicts with ipw2200, but the devices can be differentiated
+ * because i40e devices use PCI_CLASS_NETWORK_ETHERNET and ipw2200
+ * devices use PCI_CLASS_NETWORK_OTHER.
+ */
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, I40E_DEV_ID_10G_B),
+ PCI_CLASS_NETWORK_ETHERNET << 8, 0xffff00, 0},
{PCI_VDEVICE(INTEL, I40E_DEV_ID_KX_X722), 0},
{PCI_VDEVICE(INTEL, I40E_DEV_ID_QSFP_X722), 0},
{PCI_VDEVICE(INTEL, I40E_DEV_ID_SFP_X722), 0},
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
index 24a5624ef2071..3876010c2ce8f 100644
--- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c
@@ -11387,7 +11387,13 @@ static const struct pci_device_id card_ids[] = {
{PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2754, 0, 0, 0},
{PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2761, 0, 0, 0},
{PCI_VENDOR_ID_INTEL, 0x1043, 0x8086, 0x2762, 0, 0, 0},
- {PCI_VDEVICE(INTEL, 0x104f), 0},
+ /*
+ * This ID conflicts with i40e, but the devices can be differentiated
+ * because i40e devices use PCI_CLASS_NETWORK_ETHERNET and ipw2200
+ * devices use PCI_CLASS_NETWORK_OTHER.
+ */
+ {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x104f),
+ PCI_CLASS_NETWORK_OTHER << 8, 0xffff00, 0},
{PCI_VDEVICE(INTEL, 0x4220), 0}, /* BG */
{PCI_VDEVICE(INTEL, 0x4221), 0}, /* BG */
{PCI_VDEVICE(INTEL, 0x4223), 0}, /* ABG */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 712/752] function_graph: Restore direct mode when callbacks drop to one
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (247 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 710/752] net: intel: fix PCI device ID conflict between i40e and ipw2200 Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 713/752] kbuild: Fix CC_CAN_LINK detection Sasha Levin
` (35 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Shengming Hu, stable, Steven Rostedt (Google), Sasha Levin
From: Shengming Hu <hu.shengming@zte.com.cn>
[ Upstream commit 53b2fae90ff01fede6520ca744ed5e8e366497ba ]
When registering a second fgraph callback, direct path is disabled and
array loop is used instead. When ftrace_graph_active falls back to one,
we try to re-enable direct mode via ftrace_graph_enable_direct(true, ...).
But ftrace_graph_enable_direct() incorrectly disables the static key
rather than enabling it. This leaves fgraph_do_direct permanently off
after first multi-callback transition, so direct fast mode is never
restored.
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260213142932519cuWSpEXeS4-UnCvNXnK2P@zte.com.cn
Fixes: cc60ee813b503 ("function_graph: Use static_call and branch to optimize entry function")
Signed-off-by: Shengming Hu <hu.shengming@zte.com.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/fgraph.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 599f2939cd940..13832ff06c96c 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trace/fgraph.c
@@ -1311,7 +1311,7 @@ static void ftrace_graph_enable_direct(bool enable_branch, struct fgraph_ops *go
static_call_update(fgraph_func, func);
static_call_update(fgraph_retfunc, retfunc);
if (enable_branch)
- static_branch_disable(&fgraph_do_direct);
+ static_branch_enable(&fgraph_do_direct);
}
static void ftrace_graph_disable_direct(bool disable_branch)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 713/752] kbuild: Fix CC_CAN_LINK detection
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (248 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 712/752] function_graph: Restore direct mode when callbacks drop to one Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 714/752] kbuild: rpm-pkg: Restrict manual debug package creation Sasha Levin
` (34 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Mickaël Salaün, stable, Nicolas Schier,
Thomas Weißschuh, Nathan Chancellor, Sasha Levin
From: Mickaël Salaün <mic@digikod.net>
[ Upstream commit be55899b71630c79ad01df54c92e467e47644f87 ]
Most samples cannot be build on some environments because they depend
on CC_CAN_LINK, which is set according to the result of
scripts/cc-can-link.sh called by cc_can_link_user.
Because cc-can-link.sh must now build without warning, it may fail
because it is calling printf() with an empty string:
+ cat
+ gcc -m32 -Werror -Wl,--fatal-warnings -x c - -o /dev/null
<stdin>: In function ‘main’:
<stdin>:4:9: error: zero-length gnu_printf format string [-Werror=format-zero-length]
cc1: all warnings being treated as errors
Fix this warning and the samples build by actually printing something.
Cc: stable@vger.kernel.org
Fixes: d81d9d389b9b ("kbuild: don't enable CC_CAN_LINK if the dummy program generates warnings")
Signed-off-by: Mickaël Salaün <mic@digikod.net>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Reviewed-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Link: https://patch.msgid.link/20260212133544.1331437-1-mic@digikod.net
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/cc-can-link.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/cc-can-link.sh b/scripts/cc-can-link.sh
index e67fd8d7b6841..58dc7dd6d5568 100755
--- a/scripts/cc-can-link.sh
+++ b/scripts/cc-can-link.sh
@@ -5,7 +5,7 @@ cat << "END" | $@ -Werror -Wl,--fatal-warnings -x c - -o /dev/null >/dev/null 2>
#include <stdio.h>
int main(void)
{
- printf("");
+ printf("\n");
return 0;
}
END
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 714/752] kbuild: rpm-pkg: Restrict manual debug package creation
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (249 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 713/752] kbuild: Fix CC_CAN_LINK detection Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 715/752] kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo package Sasha Levin
` (33 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Nathan Chancellor, stable, Steve French, Stefano Garzarella,
Steve French, Juergen Gross, Nicolas Schier, Sasha Levin
From: Nathan Chancellor <nathan@kernel.org>
[ Upstream commit 6d6b8b0e28c468263d7fcb071e5cb284ae343df2 ]
Commit 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package
manually") moved away from the built-in RPM machinery for generating
-debuginfo packages to a more manual way to be compatible with module
signing, as the built-in machinery strips the modules after the
installation process, breaking the signatures.
Unfortunately, prior to rpm 4.20.0, there is a bug where a custom %files
directive is ignored for a -debuginfo subpackage [1], meaning builds
using older versions of RPM (such as on RHEL9 or RHEL10) fail with:
Checking for unpackaged file(s): /usr/lib/rpm/check-files .../rpmbuild/BUILDROOT/kernel-6.19.0_dirty-1.x86_64
error: Installed (but unpackaged) file(s) found:
/debuginfo.list
/usr/lib/debug/.build-id/09/748c214974bfba1522d434a7e0a02e2fd7f29b.debug
/usr/lib/debug/.build-id/0b/b96dd9c7d3689d82e56d2e73b46f53103cc6c7.debug
/usr/lib/debug/.build-id/0e/979a2f34967c7437fd30aabb41de1f0c8b6a66.debug
...
To workaround this, restrict the manual debug info package creation
process to when it is necessary (CONFIG_MODULE_SIG=y) and possible (when
using RPM >= 4.20.0). A follow up change will restore the RPM debuginfo
creation process using a separate internal flag to allow the package to
be built in more situations, as RPM 4.20.0 is a fairly recent version
and the built-in -debuginfo generation works fine when module signing is
disabled.
Cc: stable@vger.kernel.org
Fixes: 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package manually")
Link: https://github.com/rpm-software-management/rpm/commit/49f906998f3cf1f4152162ca61ac0869251c380f [1]
Reported-by: Steve French <smfrench@gmail.com>
Closes: https://lore.kernel.org/CAH2r5mugbrHTwnaQwQiYEUVwbtqmvFYf0WZiLrrJWpgT8iwftw@mail.gmail.com/
Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Tested-by: Steve French <stfrench@microsoft.com>
Tested-by: Juergen Gross <jgross@suse.com>
Acked-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260210-kbuild-fix-debuginfo-rpm-v1-1-0730b92b14bc@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/package/kernel.spec | 9 +++++----
scripts/package/mkspec | 33 ++++++++++++++++++++++++++++++---
2 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index 0f1c8de1bd95f..b7deb159f404d 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -47,12 +47,13 @@ This package provides kernel headers and makefiles sufficient to build modules
against the %{version} kernel package.
%endif
-%if %{with_debuginfo}
+%if %{with_debuginfo_manual}
%package debuginfo
Summary: Debug information package for the Linux kernel
%description debuginfo
This package provides debug information for the kernel image and modules from the
%{version} package.
+%define install_mod_strip 1
%endif
%prep
@@ -67,7 +68,7 @@ patch -p1 < %{SOURCE2}
mkdir -p %{buildroot}/lib/modules/%{KERNELRELEASE}
cp $(%{make} %{makeflags} -s image_name) %{buildroot}/lib/modules/%{KERNELRELEASE}/vmlinuz
# DEPMOD=true makes depmod no-op. We do not package depmod-generated files.
-%{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} INSTALL_MOD_STRIP=1 DEPMOD=true modules_install
+%{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} %{?install_mod_strip:INSTALL_MOD_STRIP=1} DEPMOD=true modules_install
%{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
cp System.map %{buildroot}/lib/modules/%{KERNELRELEASE}
cp .config %{buildroot}/lib/modules/%{KERNELRELEASE}/config
@@ -98,7 +99,7 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA
echo "%exclude /lib/modules/%{KERNELRELEASE}/build"
} > %{buildroot}/kernel.list
-%if %{with_debuginfo}
+%if %{with_debuginfo_manual}
# copying vmlinux directly to the debug directory means it will not get
# stripped (but its source paths will still be collected + fixed up)
mkdir -p %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}
@@ -162,7 +163,7 @@ fi
/lib/modules/%{KERNELRELEASE}/build
%endif
-%if %{with_debuginfo}
+%if %{with_debuginfo_manual}
%files -f %{buildroot}/debuginfo.list debuginfo
%defattr (-, root, root)
%exclude /debuginfo.list
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index c7375bfc25a9a..1080395ca0e16 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -23,15 +23,42 @@ else
echo '%define with_devel 0'
fi
+# manually generate -debuginfo package
+with_debuginfo_manual=0
# debuginfo package generation uses find-debuginfo.sh under the hood,
# which only works on uncompressed modules that contain debuginfo
if grep -q CONFIG_DEBUG_INFO=y include/config/auto.conf &&
(! grep -q CONFIG_MODULE_COMPRESS=y include/config/auto.conf) &&
(! grep -q CONFIG_DEBUG_INFO_SPLIT=y include/config/auto.conf); then
-echo '%define with_debuginfo %{?_without_debuginfo: 0} %{?!_without_debuginfo: 1}'
-else
-echo '%define with_debuginfo 0'
+ # If module signing is enabled (which may be required to boot with
+ # lockdown enabled), the find-debuginfo.sh machinery cannot be used
+ # because the signatures will be stripped off the modules. However, due
+ # to an rpm bug in versions prior to 4.20.0
+ #
+ # https://github.com/rpm-software-management/rpm/issues/3057
+ # https://github.com/rpm-software-management/rpm/commit/49f906998f3cf1f4152162ca61ac0869251c380f
+ #
+ # We cannot provide our own debuginfo package because it does not listen
+ # to our custom files list, failing the build due to unpackaged files.
+ # Manually generate the debug info package if using rpm 4.20.0. If not
+ # using rpm 4.20.0, avoid generating a -debuginfo package altogether,
+ # as it is not safe.
+ if grep -q CONFIG_MODULE_SIG=y include/config/auto.conf; then
+ rpm_ver_str=$(rpm --version 2>/dev/null)
+ # Split the version on spaces
+ IFS=' '
+ set -- $rpm_ver_str
+ if [ "${1:-}" = RPM -a "${2:-}" = version ]; then
+ IFS=.
+ set -- $3
+ rpm_ver=$(( 1000000 * $1 + 10000 * $2 + 100 * $3 + ${4:-0} ))
+ if [ "$rpm_ver" -ge 4200000 ]; then
+ with_debuginfo_manual='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}'
+ fi
+ fi
+ fi
fi
+echo "%define with_debuginfo_manual $with_debuginfo_manual"
cat<<EOF
%define ARCH ${ARCH}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 715/752] kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo package
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (250 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 714/752] kbuild: rpm-pkg: Restrict manual debug package creation Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 716/752] kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm Sasha Levin
` (32 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Nathan Chancellor, stable, Stefano Garzarella, Steve French,
Juergen Gross, Nicolas Schier, Sasha Levin
From: Nathan Chancellor <nathan@kernel.org>
[ Upstream commit ffe9ac1ad56df8f915896b97bd7645f522c47ce9 ]
Commit 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package
manually") effectively reverted commit a7c699d090a1 ("kbuild: rpm-pkg:
build a debuginfo RPM") but the approach it took is not safe for older
RPM releases. Restore commit a7c699d090a1 ("kbuild: rpm-pkg: build a
debuginfo RPM") for the !CONFIG_MODULE_SIG case to allow more
environments and configurations to take advantage of the separate debug
information package process.
Cc: stable@vger.kernel.org
Fixes: 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package manually")
Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Tested-by: Steve French <stfrench@microsoft.com>
Tested-by: Juergen Gross <jgross@suse.com>
Acked-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/20260210-kbuild-fix-debuginfo-rpm-v1-2-0730b92b14bc@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/package/kernel.spec | 50 ++++++++++++++++++++++++++++++++++---
scripts/package/mkspec | 5 ++++
2 files changed, 51 insertions(+), 4 deletions(-)
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index b7deb159f404d..af682a7054779 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -2,8 +2,6 @@
%{!?_arch: %define _arch dummy}
%{!?make: %define make make}
%define makeflags %{?_smp_mflags} ARCH=%{ARCH}
-%define __spec_install_post /usr/lib/rpm/brp-compress || :
-%define debug_package %{nil}
Name: kernel
Summary: The Linux Kernel
@@ -56,6 +54,38 @@ This package provides debug information for the kernel image and modules from th
%define install_mod_strip 1
%endif
+%if %{with_debuginfo_rpm}
+# list of debuginfo-related options taken from distribution kernel.spec
+# files
+%undefine _include_minidebuginfo
+%undefine _find_debuginfo_dwz_opts
+%undefine _unique_build_ids
+%undefine _unique_debug_names
+%undefine _unique_debug_srcs
+%undefine _debugsource_packages
+%undefine _debuginfo_subpackages
+%global _find_debuginfo_opts -r
+%global _missing_build_ids_terminate_build 1
+%global _no_recompute_build_ids 1
+%{debug_package}
+
+# later, we make all modules executable so that find-debuginfo.sh strips
+# them up. but they don't actually need to be executable, so remove the
+# executable bit, taking care to do it _after_ find-debuginfo.sh has run
+%define __spec_install_post \
+ %{?__debug_package:%{__debug_install_post}} \
+ %{__arch_install_post} \
+ %{__os_install_post} \
+ find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \\\
+ | xargs --no-run-if-empty chmod u-x
+%else
+%define __spec_install_post /usr/lib/rpm/brp-compress || :
+%endif
+# some (but not all) versions of rpmbuild emit %%debug_package with
+# %%install. since we've already emitted it manually, that would cause
+# a package redefinition error. ensure that doesn't happen
+%define debug_package %{nil}
+
%prep
%setup -q -n linux
cp %{SOURCE1} .config
@@ -99,14 +129,22 @@ ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEA
echo "%exclude /lib/modules/%{KERNELRELEASE}/build"
} > %{buildroot}/kernel.list
-%if %{with_debuginfo_manual}
+%if 0%{with_debuginfo_manual}%{with_debuginfo_rpm} > 0
# copying vmlinux directly to the debug directory means it will not get
# stripped (but its source paths will still be collected + fixed up)
mkdir -p %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}
cp vmlinux %{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}
+%endif
-echo /usr/lib/debug/lib/modules/%{KERNELRELEASE}/vmlinux > %{buildroot}/debuginfo.list
+%if %{with_debuginfo_rpm}
+# make modules executable so that find-debuginfo.sh strips them. this
+# will be undone later in %%__spec_install_post
+find %{buildroot}/lib/modules/%{KERNELRELEASE} -name "*.ko" -type f \
+ | xargs --no-run-if-empty chmod u+x
+%endif
+%if %{with_debuginfo_manual}
+echo /usr/lib/debug/lib/modules/%{KERNELRELEASE}/vmlinux > %{buildroot}/debuginfo.list
while read -r mod; do
mod="${mod%.o}.ko"
dbg="%{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}/kernel/${mod}"
@@ -124,6 +162,10 @@ done < modules.order
%clean
rm -rf %{buildroot}
+%if %{with_debuginfo_rpm}
+rm -f debugfiles.list debuglinks.list debugsourcefiles.list debugsources.list \
+ elfbins.list
+%endif
%post
if [ -x /usr/bin/kernel-install ]; then
diff --git a/scripts/package/mkspec b/scripts/package/mkspec
index 1080395ca0e16..c604f8c174e2c 100755
--- a/scripts/package/mkspec
+++ b/scripts/package/mkspec
@@ -23,6 +23,8 @@ else
echo '%define with_devel 0'
fi
+# use %{debug_package} machinery to generate -debuginfo
+with_debuginfo_rpm=0
# manually generate -debuginfo package
with_debuginfo_manual=0
# debuginfo package generation uses find-debuginfo.sh under the hood,
@@ -56,9 +58,12 @@ if grep -q CONFIG_DEBUG_INFO=y include/config/auto.conf &&
with_debuginfo_manual='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}'
fi
fi
+ else
+ with_debuginfo_rpm='%{?_without_debuginfo:0}%{?!_without_debuginfo:1}'
fi
fi
echo "%define with_debuginfo_manual $with_debuginfo_manual"
+echo "%define with_debuginfo_rpm $with_debuginfo_rpm"
cat<<EOF
%define ARCH ${ARCH}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 716/752] kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (251 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 715/752] kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo package Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 717/752] ipv6: ioam: fix heap buffer overflow in __ioam6_fill_trace_data() Sasha Levin
` (31 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Nathan Chancellor, stable, Lukas Herbolt, Sasha Levin
From: Nathan Chancellor <nathan@kernel.org>
[ Upstream commit afdfb71c018e9a0aa2e51fb8186d3fb1acdd3f0e ]
Commit 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package
manually") added uses of OBJCOPY and READELF, variables from Kbuild.
These variables are defined and work properly when using the binrpm-pkg
target because rpmbuild is run within Kbuild. However, these variables
are not defined when building from a source RPM package generated with
the srcrpm-pkg target, breaking the build when generating the debug info
subpackage.
Define a default value for these variables so that these commands
respect the value from Kbuild but continue to work when built from a
source RPM package.
Cc: stable@vger.kernel.org
Fixes: 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package manually")
Reported-by: Lukas Herbolt <lukas@herbolt.com>
Closes: https://lore.kernel.org/20260212135855.147906-2-lukas@herbolt.com/
Tested-by: Lukas Herbolt <lukas@herbolt.com>
Link: https://patch.msgid.link/20260213-fix-debuginfo-srcrpm-pkg-v1-1-45cd0c0501b9@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/package/kernel.spec | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index af682a7054779..bccf58bdd45fd 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -148,11 +148,11 @@ echo /usr/lib/debug/lib/modules/%{KERNELRELEASE}/vmlinux > %{buildroot}/debuginf
while read -r mod; do
mod="${mod%.o}.ko"
dbg="%{buildroot}/usr/lib/debug/lib/modules/%{KERNELRELEASE}/kernel/${mod}"
- buildid=$("${READELF}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
+ buildid=$("${READELF:-readelf}" -n "${mod}" | sed -n 's@^.*Build ID: \(..\)\(.*\)@\1/\2@p')
link="%{buildroot}/usr/lib/debug/.build-id/${buildid}.debug"
mkdir -p "${dbg%/*}" "${link%/*}"
- "${OBJCOPY}" --only-keep-debug "${mod}" "${dbg}"
+ "${OBJCOPY:-objcopy}" --only-keep-debug "${mod}" "${dbg}"
ln -sf --relative "${dbg}" "${link}"
echo "${dbg#%{buildroot}}" >> %{buildroot}/debuginfo.list
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 717/752] ipv6: ioam: fix heap buffer overflow in __ioam6_fill_trace_data()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (252 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 716/752] kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 718/752] mm: numa_memblks: Identify the accurate NUMA ID of CFMW Sasha Levin
` (30 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Qanux, stable, Justin Iurman, Jakub Kicinski, Sasha Levin
From: Qanux <qjx1298677004@gmail.com>
[ Upstream commit 6db8b56eed62baacaf37486e83378a72635c04cc ]
On the receive path, __ioam6_fill_trace_data() uses trace->nodelen
to decide how much data to write for each node. It trusts this field
as-is from the incoming packet, with no consistency check against
trace->type (the 24-bit field that tells which data items are
present). A crafted packet can set nodelen=0 while setting type bits
0-21, causing the function to write ~100 bytes past the allocated
region (into skb_shared_info), which corrupts adjacent heap memory
and leads to a kernel panic.
Add a shared helper ioam6_trace_compute_nodelen() in ioam6.c to
derive the expected nodelen from the type field, and use it:
- in ioam6_iptunnel.c (send path, existing validation) to replace
the open-coded computation;
- in exthdrs.c (receive path, ipv6_hop_ioam) to drop packets whose
nodelen is inconsistent with the type field, before any data is
written.
Per RFC 9197, bits 12-21 are each short (4-octet) fields, so they
are included in IOAM6_MASK_SHORT_FIELDS (changed from 0xff100000 to
0xff1ffc00).
Fixes: 9ee11f0fff20 ("ipv6: ioam: Data plane support for Pre-allocated Trace")
Cc: stable@vger.kernel.org
Signed-off-by: Junxi Qian <qjx1298677004@gmail.com>
Reviewed-by: Justin Iurman <justin.iurman@gmail.com>
Link: https://patch.msgid.link/20260211040412.86195-1-qjx1298677004@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/net/ioam6.h | 2 ++
net/ipv6/exthdrs.c | 5 +++++
net/ipv6/ioam6.c | 14 ++++++++++++++
net/ipv6/ioam6_iptunnel.c | 10 +---------
4 files changed, 22 insertions(+), 9 deletions(-)
diff --git a/include/net/ioam6.h b/include/net/ioam6.h
index 2cbbee6e806aa..a75912fe247e6 100644
--- a/include/net/ioam6.h
+++ b/include/net/ioam6.h
@@ -60,6 +60,8 @@ void ioam6_fill_trace_data(struct sk_buff *skb,
struct ioam6_trace_hdr *trace,
bool is_input);
+u8 ioam6_trace_compute_nodelen(u32 trace_type);
+
int ioam6_init(void);
void ioam6_exit(void);
diff --git a/net/ipv6/exthdrs.c b/net/ipv6/exthdrs.c
index 54088fa0c09d0..310836a0cf17b 100644
--- a/net/ipv6/exthdrs.c
+++ b/net/ipv6/exthdrs.c
@@ -931,6 +931,11 @@ static bool ipv6_hop_ioam(struct sk_buff *skb, int optoff)
if (hdr->opt_len < 2 + sizeof(*trace) + trace->remlen * 4)
goto drop;
+ /* Inconsistent Pre-allocated Trace header */
+ if (trace->nodelen !=
+ ioam6_trace_compute_nodelen(be32_to_cpu(trace->type_be32)))
+ goto drop;
+
/* Ignore if the IOAM namespace is unknown */
ns = ioam6_namespace(dev_net(skb->dev), trace->namespace_id);
if (!ns)
diff --git a/net/ipv6/ioam6.c b/net/ipv6/ioam6.c
index 9553a32000813..08b7ac8c99b7e 100644
--- a/net/ipv6/ioam6.c
+++ b/net/ipv6/ioam6.c
@@ -690,6 +690,20 @@ struct ioam6_namespace *ioam6_namespace(struct net *net, __be16 id)
return rhashtable_lookup_fast(&nsdata->namespaces, &id, rht_ns_params);
}
+#define IOAM6_MASK_SHORT_FIELDS 0xff1ffc00
+#define IOAM6_MASK_WIDE_FIELDS 0x00e00000
+
+u8 ioam6_trace_compute_nodelen(u32 trace_type)
+{
+ u8 nodelen = hweight32(trace_type & IOAM6_MASK_SHORT_FIELDS)
+ * (sizeof(__be32) / 4);
+
+ nodelen += hweight32(trace_type & IOAM6_MASK_WIDE_FIELDS)
+ * (sizeof(__be64) / 4);
+
+ return nodelen;
+}
+
static void __ioam6_fill_trace_data(struct sk_buff *skb,
struct ioam6_namespace *ns,
struct ioam6_trace_hdr *trace,
diff --git a/net/ipv6/ioam6_iptunnel.c b/net/ipv6/ioam6_iptunnel.c
index 1fe7894f14dd9..b9f6d892a566c 100644
--- a/net/ipv6/ioam6_iptunnel.c
+++ b/net/ipv6/ioam6_iptunnel.c
@@ -22,9 +22,6 @@
#include <net/ip6_route.h>
#include <net/addrconf.h>
-#define IOAM6_MASK_SHORT_FIELDS 0xff100000
-#define IOAM6_MASK_WIDE_FIELDS 0xe00000
-
struct ioam6_lwt_encap {
struct ipv6_hopopt_hdr eh;
u8 pad[2]; /* 2-octet padding for 4n-alignment */
@@ -93,13 +90,8 @@ static bool ioam6_validate_trace_hdr(struct ioam6_trace_hdr *trace)
trace->type.bit21 | trace->type.bit23)
return false;
- trace->nodelen = 0;
fields = be32_to_cpu(trace->type_be32);
-
- trace->nodelen += hweight32(fields & IOAM6_MASK_SHORT_FIELDS)
- * (sizeof(__be32) / 4);
- trace->nodelen += hweight32(fields & IOAM6_MASK_WIDE_FIELDS)
- * (sizeof(__be64) / 4);
+ trace->nodelen = ioam6_trace_compute_nodelen(fields);
return true;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 718/752] mm: numa_memblks: Identify the accurate NUMA ID of CFMW
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (253 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 717/752] ipv6: ioam: fix heap buffer overflow in __ioam6_fill_trace_data() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 719/752] fbdev: Use device_create_with_groups() to fix sysfs groups registration race Sasha Levin
` (29 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Cui Chao, stable, Jonathan Cameron, Gregory Price, Dan Williams,
Mike Rapoport (Microsoft), Sasha Levin
From: Cui Chao <cuichao1753@phytium.com.cn>
[ Upstream commit f043a93fff9e3e3e648b6525483f59104b0819fa ]
In some physical memory layout designs, the address space of CFMW (CXL
Fixed Memory Window) resides between multiple segments of system memory
belonging to the same NUMA node. In numa_cleanup_meminfo, these multiple
segments of system memory are merged into a larger numa_memblk. When
identifying which NUMA node the CFMW belongs to, it may be incorrectly
assigned to the NUMA node of the merged system memory.
When a CXL RAM region is created in userspace, the memory capacity of
the newly created region is not added to the CFMW-dedicated NUMA node.
Instead, it is accumulated into an existing NUMA node (e.g., NUMA0
containing RAM). This makes it impossible to clearly distinguish
between the two types of memory, which may affect memory-tiering
applications.
Example memory layout:
Physical address space:
0x00000000 - 0x1FFFFFFF System RAM (node0)
0x20000000 - 0x2FFFFFFF CXL CFMW (node2)
0x40000000 - 0x5FFFFFFF System RAM (node0)
0x60000000 - 0x7FFFFFFF System RAM (node1)
After numa_cleanup_meminfo, the two node0 segments are merged into one:
0x00000000 - 0x5FFFFFFF System RAM (node0) // CFMW is inside the range
0x60000000 - 0x7FFFFFFF System RAM (node1)
So the CFMW (0x20000000-0x2FFFFFFF) will be incorrectly assigned to node0.
To address this scenario, accurately identifying the correct NUMA node
can be achieved by checking whether the region belongs to both
numa_meminfo and numa_reserved_meminfo.
While this issue is only observed in a QEMU configuration, and no known
end users are impacted by this problem, it is likely that some firmware
implementation is leaving memory map holes in a CXL Fixed Memory Window.
CXL hotplug depends on mapping free window capacity, and it seems to be
only a coincidence to have not hit this problem yet.
Fixes: 779dd20cfb56 ("cxl/region: Add region creation support")
Signed-off-by: Cui Chao <cuichao1753@phytium.com.cn>
Cc: stable@vger.kernel.org
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Reviewed-by: Gregory Price <gourry@gourry.net>
Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20260213060347.2389818-2-cuichao1753@phytium.com.cn
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
mm/numa_memblks.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/mm/numa_memblks.c b/mm/numa_memblks.c
index 8f5735fda0a21..3f53464240e8d 100644
--- a/mm/numa_memblks.c
+++ b/mm/numa_memblks.c
@@ -570,15 +570,16 @@ static int meminfo_to_nid(struct numa_meminfo *mi, u64 start)
int phys_to_target_node(u64 start)
{
int nid = meminfo_to_nid(&numa_meminfo, start);
+ int reserved_nid = meminfo_to_nid(&numa_reserved_meminfo, start);
/*
- * Prefer online nodes, but if reserved memory might be
- * hot-added continue the search with reserved ranges.
+ * Prefer online nodes unless the address is also described
+ * by reserved ranges, in which case use the reserved nid.
*/
- if (nid != NUMA_NO_NODE)
+ if (nid != NUMA_NO_NODE && reserved_nid == NUMA_NO_NODE)
return nid;
- return meminfo_to_nid(&numa_reserved_meminfo, start);
+ return reserved_nid;
}
EXPORT_SYMBOL_GPL(phys_to_target_node);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 719/752] fbdev: Use device_create_with_groups() to fix sysfs groups registration race
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (254 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 718/752] mm: numa_memblks: Identify the accurate NUMA ID of CFMW Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 720/752] fbcon: check return value of con2fb_acquire_newinfo() Sasha Levin
` (28 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Hans de Goede, stable, Shixiong Ou, Helge Deller, Sasha Levin
From: Hans de Goede <johannes.goede@oss.qualcomm.com>
[ Upstream commit 68eeb0871e986ae5462439dae881e3a27bcef85f ]
The fbdev sysfs attributes are registered after sending the uevent for
the device creation, leaving a race window where e.g. udev rules may
not be able to access the sysfs attributes because the registration is
not done yet.
Fix this by switching to device_create_with_groups(). This also results in
a nice cleanup. After switching to device_create_with_groups() all that
is left of fb_init_device() is setting the drvdata and that can be passed
to device_create[_with_groups]() too. After which fb_init_device() can
be completely removed.
Dropping fb_init_device() + fb_cleanup_device() in turn allows removing
fb_info.class_flag as they were the only user of this field.
Fixes: 5fc830d6aca1 ("fbdev: Register sysfs groups through device_add_group")
Cc: stable@vger.kernel.org
Cc: Shixiong Ou <oushixiong@kylinos.cn>
Signed-off-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/core/fbsysfs.c | 36 +++---------------------------
include/linux/fb.h | 1 -
2 files changed, 3 insertions(+), 34 deletions(-)
diff --git a/drivers/video/fbdev/core/fbsysfs.c b/drivers/video/fbdev/core/fbsysfs.c
index b8344c40073b4..baa2bae0fb5b3 100644
--- a/drivers/video/fbdev/core/fbsysfs.c
+++ b/drivers/video/fbdev/core/fbsysfs.c
@@ -12,8 +12,6 @@
#include "fb_internal.h"
-#define FB_SYSFS_FLAG_ATTR 1
-
static int activate(struct fb_info *fb_info, struct fb_var_screeninfo *var)
{
int err;
@@ -451,33 +449,7 @@ static struct attribute *fb_device_attrs[] = {
NULL,
};
-static const struct attribute_group fb_device_attr_group = {
- .attrs = fb_device_attrs,
-};
-
-static int fb_init_device(struct fb_info *fb_info)
-{
- int ret;
-
- dev_set_drvdata(fb_info->dev, fb_info);
-
- fb_info->class_flag |= FB_SYSFS_FLAG_ATTR;
-
- ret = device_add_group(fb_info->dev, &fb_device_attr_group);
- if (ret)
- fb_info->class_flag &= ~FB_SYSFS_FLAG_ATTR;
-
- return 0;
-}
-
-static void fb_cleanup_device(struct fb_info *fb_info)
-{
- if (fb_info->class_flag & FB_SYSFS_FLAG_ATTR) {
- device_remove_group(fb_info->dev, &fb_device_attr_group);
-
- fb_info->class_flag &= ~FB_SYSFS_FLAG_ATTR;
- }
-}
+ATTRIBUTE_GROUPS(fb_device);
int fb_device_create(struct fb_info *fb_info)
{
@@ -485,14 +457,13 @@ int fb_device_create(struct fb_info *fb_info)
dev_t devt = MKDEV(FB_MAJOR, node);
int ret;
- fb_info->dev = device_create(fb_class, fb_info->device, devt, NULL, "fb%d", node);
+ fb_info->dev = device_create_with_groups(fb_class, fb_info->device, devt, fb_info,
+ fb_device_groups, "fb%d", node);
if (IS_ERR(fb_info->dev)) {
/* Not fatal */
ret = PTR_ERR(fb_info->dev);
pr_warn("Unable to create device for framebuffer %d; error %d\n", node, ret);
fb_info->dev = NULL;
- } else {
- fb_init_device(fb_info);
}
return 0;
@@ -505,7 +476,6 @@ void fb_device_destroy(struct fb_info *fb_info)
if (!fb_info->dev)
return;
- fb_cleanup_device(fb_info);
device_destroy(fb_class, devt);
fb_info->dev = NULL;
}
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 05cc251035da9..c3302d5135466 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -497,7 +497,6 @@ struct fb_info {
#if defined(CONFIG_FB_DEVICE)
struct device *dev; /* This is this fb device */
#endif
- int class_flag; /* private sysfs flags */
#ifdef CONFIG_FB_TILEBLITTING
struct fb_tile_ops *tileops; /* Tile Blitting */
#endif
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 720/752] fbcon: check return value of con2fb_acquire_newinfo()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (255 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 719/752] fbdev: Use device_create_with_groups() to fix sysfs groups registration race Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 721/752] fbdev: vt8500lcdfb: fix missing dma_free_coherent() Sasha Levin
` (27 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Andrey Vatoropin, stable, Helge Deller, Sasha Levin
From: Andrey Vatoropin <a.vatoropin@crpt.ru>
[ Upstream commit 011a0502801c8536f64141a2b61362c14f456544 ]
If fbcon_open() fails when called from con2fb_acquire_newinfo() then
info->fbcon_par pointer remains NULL which is later dereferenced.
Add check for return value of the function con2fb_acquire_newinfo() to
avoid it.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: d1baa4ffa677 ("fbcon: set_con2fb_map fixes")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Vatoropin <a.vatoropin@crpt.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/core/fbcon.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
index e7e07eb2142eb..7453377f34336 100644
--- a/drivers/video/fbdev/core/fbcon.c
+++ b/drivers/video/fbdev/core/fbcon.c
@@ -1047,7 +1047,8 @@ static void fbcon_init(struct vc_data *vc, bool init)
return;
if (!info->fbcon_par)
- con2fb_acquire_newinfo(vc, info, vc->vc_num);
+ if (con2fb_acquire_newinfo(vc, info, vc->vc_num))
+ return;
/* If we are not the first console on this
fb, copy the font from that console */
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 721/752] fbdev: vt8500lcdfb: fix missing dma_free_coherent()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (256 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 720/752] fbcon: check return value of con2fb_acquire_newinfo() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 722/752] fbdev: of: display_timing: fix refcount leak in of_get_display_timings() Sasha Levin
` (26 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Thomas Fourier, stable, Helge Deller, Sasha Levin
From: Thomas Fourier <fourier.thomas@gmail.com>
[ Upstream commit 88b3b9924337336a31cefbe99a22ed09401be74a ]
fbi->fb.screen_buffer is allocated with dma_alloc_coherent() but is not
freed if the error path is reached.
Fixes: e7b995371fe1 ("video: vt8500: Add devicetree support for vt8500-fb and wm8505-fb")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/vt8500lcdfb.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/vt8500lcdfb.c b/drivers/video/fbdev/vt8500lcdfb.c
index b08a6fdc53fd2..85c7a99a7d648 100644
--- a/drivers/video/fbdev/vt8500lcdfb.c
+++ b/drivers/video/fbdev/vt8500lcdfb.c
@@ -369,7 +369,7 @@ static int vt8500lcd_probe(struct platform_device *pdev)
if (fbi->palette_cpu == NULL) {
dev_err(&pdev->dev, "Failed to allocate palette buffer\n");
ret = -ENOMEM;
- goto failed_free_io;
+ goto failed_free_mem_virt;
}
irq = platform_get_irq(pdev, 0);
@@ -432,6 +432,9 @@ static int vt8500lcd_probe(struct platform_device *pdev)
failed_free_palette:
dma_free_coherent(&pdev->dev, fbi->palette_size,
fbi->palette_cpu, fbi->palette_phys);
+failed_free_mem_virt:
+ dma_free_coherent(&pdev->dev, fbi->fb.fix.smem_len,
+ fbi->fb.screen_buffer, fbi->fb.fix.smem_start);
failed_free_io:
iounmap(fbi->regbase);
failed_free_res:
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 722/752] fbdev: of: display_timing: fix refcount leak in of_get_display_timings()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (257 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 721/752] fbdev: vt8500lcdfb: fix missing dma_free_coherent() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 724/752] fbcon: Remove struct fbcon_display.inverse Sasha Levin
` (25 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Weigang He, stable, Helge Deller, Sasha Levin
From: Weigang He <geoffreyhe2@gmail.com>
[ Upstream commit eacf9840ae1285a1ef47eb0ce16d786e542bd4d7 ]
of_parse_phandle() returns a device_node with refcount incremented,
which is stored in 'entry' and then copied to 'native_mode'. When the
error paths at lines 184 or 192 jump to 'entryfail', native_mode's
refcount is not decremented, causing a refcount leak.
Fix this by changing the goto target from 'entryfail' to 'timingfail',
which properly calls of_node_put(native_mode) before cleanup.
Fixes: cc3f414cf2e4 ("video: add of helper for display timings/videomode")
Cc: stable@vger.kernel.org
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/of_display_timing.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c
index a4cd446ac5a59..a6ec392253c3e 100644
--- a/drivers/video/of_display_timing.c
+++ b/drivers/video/of_display_timing.c
@@ -181,7 +181,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
if (disp->num_timings == 0) {
/* should never happen, as entry was already found above */
pr_err("%pOF: no timings specified\n", np);
- goto entryfail;
+ goto timingfail;
}
disp->timings = kcalloc(disp->num_timings,
@@ -189,7 +189,7 @@ struct display_timings *of_get_display_timings(const struct device_node *np)
GFP_KERNEL);
if (!disp->timings) {
pr_err("%pOF: could not allocate timings array\n", np);
- goto entryfail;
+ goto timingfail;
}
disp->num_timings = 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 724/752] fbcon: Remove struct fbcon_display.inverse
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (258 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 722/752] fbdev: of: display_timing: fix refcount leak in of_get_display_timings() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 725/752] io_uring/zcrx: fix sgtable leak on mapping failures Sasha Levin
` (24 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Thomas Zimmermann, stable, Helge Deller, Sasha Levin
From: Thomas Zimmermann <tzimmermann@suse.de>
[ Upstream commit 30baedeeeab524172abc0b58cb101e8df86b5be8 ]
The field inverse in struct fbcon_display is unused. Remove it.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: <stable@vger.kernel.org> # v6.0+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/video/fbdev/core/fbcon.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h
index 4d97e6d8a16a2..7e21c8b336692 100644
--- a/drivers/video/fbdev/core/fbcon.h
+++ b/drivers/video/fbdev/core/fbcon.h
@@ -30,7 +30,6 @@ struct fbcon_display {
#ifdef CONFIG_FRAMEBUFFER_CONSOLE_LEGACY_ACCELERATION
u_short scrollmode; /* Scroll Method, use fb_scrollmode() */
#endif
- u_short inverse; /* != 0 text black on white as default */
short yscroll; /* Hardware scrolling */
int vrows; /* number of virtual rows */
int cursor_shape;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 725/752] io_uring/zcrx: fix sgtable leak on mapping failures
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (259 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 724/752] fbcon: Remove struct fbcon_display.inverse Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 726/752] cifs: some missing initializations on replay Sasha Levin
` (23 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Pavel Begunkov, stable, Jens Axboe, Sasha Levin
From: Pavel Begunkov <asml.silence@gmail.com>
[ Upstream commit a983aae397767e9da931128ff2b5bf9066513ce3 ]
In an unlikely case when io_populate_area_dma() fails, which could only
happen on a PAGE_POOL_32BIT_ARCH_WITH_64BIT_DMA machine,
io_zcrx_map_area() will have an initialised and not freed table. It was
supposed to be cleaned up in the error path, but !is_mapped prevents
that.
Fixes: 439a98b972fbb ("io_uring/zcrx: deduplicate area mapping")
Cc: stable@vger.kernel.org
Reported-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/zcrx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 03396769c775d..030d632d98392 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -287,6 +287,9 @@ static int io_zcrx_map_area(struct io_zcrx_ifq *ifq, struct io_zcrx_area *area)
}
ret = io_populate_area_dma(ifq, area);
+ if (ret && !area->mem.is_dmabuf)
+ dma_unmap_sgtable(ifq->dev, &area->mem.page_sg_table,
+ DMA_FROM_DEVICE, IO_DMA_ATTR);
if (ret == 0)
area->is_mapped = true;
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 726/752] cifs: some missing initializations on replay
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (260 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 725/752] io_uring/zcrx: fix sgtable leak on mapping failures Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 727/752] gpio: nomadik: Add missing IS_ERR() check Sasha Levin
` (22 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Shyam Prasad N, stable, Yuchan Nam, Steve French, Sasha Levin
From: Shyam Prasad N <sprasad@microsoft.com>
[ Upstream commit 14f66f44646333d2bfd7ece36585874fd72f8286 ]
In several places in the code, we have a label to signify
the start of the code where a request can be replayed if
necessary. However, some of these places were missing the
necessary reinitializations of certain local variables
before replay.
This change makes sure that these variables get initialized
after the label.
Cc: stable@vger.kernel.org
Reported-by: Yuchan Nam <entropy1110@gmail.com>
Tested-by: Yuchan Nam <entropy1110@gmail.com>
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
fs/smb/client/smb2ops.c | 2 ++
fs/smb/client/smb2pdu.c | 1 +
2 files changed, 3 insertions(+)
diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 1b404def355e9..9c22daff24970 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -1184,6 +1184,7 @@ smb2_set_ea(const unsigned int xid, struct cifs_tcon *tcon,
replay_again:
/* reinitialize for possible replay */
+ used_len = 0;
flags = CIFS_CP_CREATE_CLOSE_OP;
oplock = SMB2_OPLOCK_LEVEL_NONE;
server = cifs_pick_channel(ses);
@@ -1582,6 +1583,7 @@ smb2_ioctl_query_info(const unsigned int xid,
replay_again:
/* reinitialize for possible replay */
+ buffer = NULL;
flags = CIFS_CP_CREATE_CLOSE_OP;
oplock = SMB2_OPLOCK_LEVEL_NONE;
server = cifs_pick_channel(ses);
diff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c
index 8082507586e81..1ef82408ecad6 100644
--- a/fs/smb/client/smb2pdu.c
+++ b/fs/smb/client/smb2pdu.c
@@ -2845,6 +2845,7 @@ int smb311_posix_mkdir(const unsigned int xid, struct inode *inode,
replay_again:
/* reinitialize for possible replay */
+ pc_buf = NULL;
flags = 0;
n_iov = 2;
server = cifs_pick_channel(ses);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 727/752] gpio: nomadik: Add missing IS_ERR() check
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (261 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 726/752] cifs: some missing initializations on replay Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 728/752] io_uring/cmd_net: fix too strict requirement on ioctl Sasha Levin
` (21 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Ethan Tidmore, stable, Bartosz Golaszewski, Sasha Levin
From: Ethan Tidmore <ethantidmore06@gmail.com>
[ Upstream commit 58433885ee99e8c96757e82ccf6d50646c4dfe09 ]
The function gpio_device_get_desc() can return an error pointer and is
not checked for one. Add check for error pointer.
Fixes: ddeb66d2cb10f ("gpio: nomadik: don't print out global GPIO numbers in debugfs callbacks")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260214044531.43539-1-ethantidmore06@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpio-nomadik.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 97c5cd33279d5..e22b713166d71 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -430,6 +430,9 @@ void nmk_gpio_dbg_show_one(struct seq_file *s, struct pinctrl_dev *pctldev,
#ifdef CONFIG_PINCTRL_NOMADIK
if (mode == NMK_GPIO_ALT_C && pctldev) {
desc = gpio_device_get_desc(chip->gpiodev, offset);
+ if (IS_ERR(desc))
+ return;
+
mode = nmk_prcm_gpiocr_get_mode(pctldev, desc_to_gpio(desc));
}
#endif
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 728/752] io_uring/cmd_net: fix too strict requirement on ioctl
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (262 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 727/752] gpio: nomadik: Add missing IS_ERR() check Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 729/752] ASoC: amd: yc: Add DMI quirk for ASUS Vivobook Pro 15X M6501RR Sasha Levin
` (20 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Asbjørn Sloth Tønnesen, stable, Gabriel Krisman Bertazi,
Jens Axboe, Sasha Levin
From: Asbjørn Sloth Tønnesen <ast@fiberby.net>
[ Upstream commit 600b665b903733bd60334e86031b157cc823ee55 ]
Attempting SOCKET_URING_OP_SETSOCKOPT on an AF_NETLINK socket resulted
in an -EOPNOTSUPP, as AF_NETLINK doesn't have an ioctl in its struct
proto, but only in struct proto_ops.
Prior to the blamed commit, io_uring_cmd_sock() only had two cmd_op
operations, both requiring ioctl, thus the check was warranted.
Since then, 4 new cmd_op operations have been added, none of which
depend on ioctl. This patch moves the ioctl check, so it only applies
to the original operations.
AFAICT, the ioctl requirement was unintentional, and it wasn't
visible in the blamed patch within 3 lines of context.
Cc: stable@vger.kernel.org
Fixes: a5d2f99aff6b ("io_uring/cmd: Introduce SOCKET_URING_OP_GETSOCKOPT")
Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/cmd_net.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/io_uring/cmd_net.c b/io_uring/cmd_net.c
index 3b75931bd5695..54d05a205e623 100644
--- a/io_uring/cmd_net.c
+++ b/io_uring/cmd_net.c
@@ -139,16 +139,19 @@ int io_uring_cmd_sock(struct io_uring_cmd *cmd, unsigned int issue_flags)
struct proto *prot = READ_ONCE(sk->sk_prot);
int ret, arg = 0;
- if (!prot || !prot->ioctl)
- return -EOPNOTSUPP;
-
switch (cmd->cmd_op) {
case SOCKET_URING_OP_SIOCINQ:
+ if (!prot || !prot->ioctl)
+ return -EOPNOTSUPP;
+
ret = prot->ioctl(sk, SIOCINQ, &arg);
if (ret)
return ret;
return arg;
case SOCKET_URING_OP_SIOCOUTQ:
+ if (!prot || !prot->ioctl)
+ return -EOPNOTSUPP;
+
ret = prot->ioctl(sk, SIOCOUTQ, &arg);
if (ret)
return ret;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 729/752] ASoC: amd: yc: Add DMI quirk for ASUS Vivobook Pro 15X M6501RR
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (263 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 728/752] io_uring/cmd_net: fix too strict requirement on ioctl Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 730/752] kbuild: rpm-pkg: Disable automatic requires for manual debuginfo package Sasha Levin
` (19 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Gustavo Salvini, stable, Mark Brown, Sasha Levin
From: Gustavo Salvini <guspatagonico@gmail.com>
[ Upstream commit ff9cadd1a2c0b2665b7377ac79540d66f212e7e3 ]
The ASUS Vivobook Pro 15X (M6501RR) with AMD Ryzen 9 6900HX has an
internal DMIC that is not detected without a DMI quirk entry, as the
BIOS does not set the AcpDmicConnected ACPI _DSD property.
Adding the DMI entry enables the ACP6x DMIC machine driver to probe
successfully.
Cc: stable@vger.kernel.org
Signed-off-by: Gustavo Salvini <guspatagonico@gmail.com>
Link: https://patch.msgid.link/20260210155156.29079-1-guspatagonico@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
sound/soc/amd/yc/acp6x-mach.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/sound/soc/amd/yc/acp6x-mach.c b/sound/soc/amd/yc/acp6x-mach.c
index 67f2fee193980..f1a63475100d1 100644
--- a/sound/soc/amd/yc/acp6x-mach.c
+++ b/sound/soc/amd/yc/acp6x-mach.c
@@ -696,7 +696,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
DMI_MATCH(DMI_BOARD_NAME, "XyloD5_RBU"),
}
},
-
+ {
+ .driver_data = &acp6x_card,
+ .matches = {
+ DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook_ASUSLaptop M6501RR_M6501RR"),
+ }
+ },
{}
};
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 730/752] kbuild: rpm-pkg: Disable automatic requires for manual debuginfo package
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (264 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 729/752] ASoC: amd: yc: Add DMI quirk for ASUS Vivobook Pro 15X M6501RR Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 731/752] drm/xe: Add bounds check on pat_index to prevent OOB kernel read in madvise Sasha Levin
` (18 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Nathan Chancellor, stable, Stefano Garzarella, Sasha Levin
From: Nathan Chancellor <nathan@kernel.org>
[ Upstream commit f94711255a73d8938cf3bb405a0af3a4d2700ed1 ]
Stefano reports that after commit 62089b804895 ("kbuild: rpm-pkg:
Generate debuginfo package manually"), building with an rpm package
using rpm 4.20.0 fails with:
RPM build errors:
Dependency tokens must begin with alpha-numeric, '_' or '/': #�) = 0x0d000002
Dependency tokens must begin with alpha-numeric, '_' or '/': �) = 0x0d000000
Dependency tokens must begin with alpha-numeric, '_' or '/': ) = 0x7c0e000000
Unknown rich dependency op 'Hat': (Red Hat 15.2.1-7)) = 0x3130363230322000
Unknown rich dependency op 'Hat': (Red Hat 15.2.1-7)) = 0x4728203a43434800
Unknown rich dependency op 'Hat': (Red Hat 15.2.1-7)) = 0x3130363230322000
Unknown rich dependency op 'Hat': (Red Hat 15.2.1-7)) = 0x4728203a43434800
This error comes from the automatic requirements feature of rpm. The
-debuginfo subpackage has no dependencies, so disable this feature with
'AutoReq: 0' for this subpackage, avoiding the error. This matches the
official %_debug_template macro that rpm provides. While automatic
provides should be default enabled, be explicit like %_debug_template
does.
Additionally, while in the area, add the manual debug information
package to the Development/Debug group, further aligning with
%_debug_template.
Cc: stable@vger.kernel.org
Fixes: 62089b804895 ("kbuild: rpm-pkg: Generate debuginfo package manually")
Reported-by: Stefano Garzarella <sgarzare@redhat.com>
Closes: https://lore.kernel.org/CAGxU2F7FFNgb781_A7a1oL63n9Oy8wsyWceKhUpeZ6mLk=focw@mail.gmail.com/
Tested-by: Stefano Garzarella <sgarzare@redhat.com>
Link: https://patch.msgid.link/20260216-improve-manual-debuginfo-template-v1-1-e584b3f8d3be@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
scripts/package/kernel.spec | 3 +++
1 file changed, 3 insertions(+)
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index bccf58bdd45fd..b3c956205af00 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -48,6 +48,9 @@ against the %{version} kernel package.
%if %{with_debuginfo_manual}
%package debuginfo
Summary: Debug information package for the Linux kernel
+Group: Development/Debug
+AutoReq: 0
+AutoProv: 1
%description debuginfo
This package provides debug information for the kernel image and modules from the
%{version} package.
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 731/752] drm/xe: Add bounds check on pat_index to prevent OOB kernel read in madvise
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (265 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 730/752] kbuild: rpm-pkg: Disable automatic requires for manual debuginfo package Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 732/752] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle Sasha Levin
` (17 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Jia Yao, Matthew Auld, stable, Matthew Brost, Shuicheng Lin,
Himal Prasad Ghimiray, Thomas Hellström, Rodrigo Vivi,
Sasha Levin
From: Jia Yao <jia.yao@intel.com>
[ Upstream commit fbbe32618e97eff81577a01eb7d9adcd64a216d7 ]
When user provides a bogus pat_index value through the madvise IOCTL, the
xe_pat_index_get_coh_mode() function performs an array access without
validating bounds. This allows a malicious user to trigger an out-of-bounds
kernel read from the xe->pat.table array.
The vulnerability exists because the validation in madvise_args_are_sane()
directly calls xe_pat_index_get_coh_mode(xe, args->pat_index.val) without
first checking if pat_index is within [0, xe->pat.n_entries).
Although xe_pat_index_get_coh_mode() has a WARN_ON to catch this in debug
builds, it still performs the unsafe array access in production kernels.
v2(Matthew Auld)
- Using array_index_nospec() to mitigate spectre attacks when the value
is used
v3(Matthew Auld)
- Put the declarations at the start of the block
Fixes: ada7486c5668 ("drm/xe: Implement madvise ioctl for xe")
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Cc: <stable@vger.kernel.org> # v6.18+
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Shuicheng Lin <shuicheng.lin@intel.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Jia Yao <jia.yao@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patch.msgid.link/20260205161529.1819276-1-jia.yao@intel.com
(cherry picked from commit 944a3329b05510d55c69c2ef455136e2fc02de29)
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/xe/xe_vm_madvise.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_vm_madvise.c b/drivers/gpu/drm/xe/xe_vm_madvise.c
index cad3cf627c3f2..fe7e1b45f5c0c 100644
--- a/drivers/gpu/drm/xe/xe_vm_madvise.c
+++ b/drivers/gpu/drm/xe/xe_vm_madvise.c
@@ -268,8 +268,13 @@ static bool madvise_args_are_sane(struct xe_device *xe, const struct drm_xe_madv
break;
case DRM_XE_MEM_RANGE_ATTR_PAT:
{
- u16 coh_mode = xe_pat_index_get_coh_mode(xe, args->pat_index.val);
+ u16 pat_index, coh_mode;
+ if (XE_IOCTL_DBG(xe, args->pat_index.val >= xe->pat.n_entries))
+ return false;
+
+ pat_index = array_index_nospec(args->pat_index.val, xe->pat.n_entries);
+ coh_mode = xe_pat_index_get_coh_mode(xe, pat_index);
if (XE_IOCTL_DBG(xe, !coh_mode))
return false;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 732/752] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (266 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 731/752] drm/xe: Add bounds check on pat_index to prevent OOB kernel read in madvise Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 733/752] net/sched: act_skbedit: fix divide-by-zero in tcf_skbedit_hash() Sasha Levin
` (16 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Thomas Fourier, stable, Jakub Kicinski, Sasha Levin
From: Thomas Fourier <fourier.thomas@gmail.com>
[ Upstream commit ffe68c3766997d82e9ccaf1cdbd47eba269c4aa2 ]
dma_free_coherent() in error path takes priv->rx_buf.alloc_len as
the dma handle. This would lead to improper unmapping of the buffer.
Change the dma handle to priv->rx_buf.alloc_phys.
Fixes: 6af55ff52b02 ("Driver for Beckhoff CX5020 EtherCAT master module.")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://patch.msgid.link/20260213164340.77272-2-fourier.thomas@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/net/ethernet/ec_bhf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c
index 67275aa4f65b2..0c86cbb0313c3 100644
--- a/drivers/net/ethernet/ec_bhf.c
+++ b/drivers/net/ethernet/ec_bhf.c
@@ -423,7 +423,7 @@ static int ec_bhf_open(struct net_device *net_dev)
error_rx_free:
dma_free_coherent(dev, priv->rx_buf.alloc_len, priv->rx_buf.alloc,
- priv->rx_buf.alloc_len);
+ priv->rx_buf.alloc_phys);
out:
return err;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 733/752] net/sched: act_skbedit: fix divide-by-zero in tcf_skbedit_hash()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (267 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 732/752] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 734/752] gpio: sysfs: fix chip removal with GPIOs exported over sysfs Sasha Levin
` (15 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Ruitong Liu, stable, Jakub Kicinski, Sasha Levin
From: Ruitong Liu <cnitlrt@gmail.com>
[ Upstream commit be054cc66f739a9ba615dba9012a07fab8e7dd6f ]
Commit 38a6f0865796 ("net: sched: support hash selecting tx queue")
added SKBEDIT_F_TXQ_SKBHASH support. The inclusive range size is
computed as:
mapping_mod = queue_mapping_max - queue_mapping + 1;
The range size can be 65536 when the requested range covers all possible
u16 queue IDs (e.g. queue_mapping=0 and queue_mapping_max=U16_MAX).
That value cannot be represented in a u16 and previously wrapped to 0,
so tcf_skbedit_hash() could trigger a divide-by-zero:
queue_mapping += skb_get_hash(skb) % params->mapping_mod;
Compute mapping_mod in a wider type and reject ranges larger than U16_MAX
to prevent params->mapping_mod from becoming 0 and avoid the crash.
Fixes: 38a6f0865796 ("net: sched: support hash selecting tx queue")
Cc: stable@vger.kernel.org # 6.12+
Signed-off-by: Ruitong Liu <cnitlrt@gmail.com>
Link: https://patch.msgid.link/20260213175948.1505257-1-cnitlrt@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/sched/act_skbedit.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
index 8c1d1554f6575..5450c1293eb50 100644
--- a/net/sched/act_skbedit.c
+++ b/net/sched/act_skbedit.c
@@ -126,7 +126,7 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
struct tcf_skbedit *d;
u32 flags = 0, *priority = NULL, *mark = NULL, *mask = NULL;
u16 *queue_mapping = NULL, *ptype = NULL;
- u16 mapping_mod = 1;
+ u32 mapping_mod = 1;
bool exists = false;
int ret = 0, err;
u32 index;
@@ -194,6 +194,10 @@ static int tcf_skbedit_init(struct net *net, struct nlattr *nla,
}
mapping_mod = *queue_mapping_max - *queue_mapping + 1;
+ if (mapping_mod > U16_MAX) {
+ NL_SET_ERR_MSG_MOD(extack, "The range of queue_mapping is invalid.");
+ return -EINVAL;
+ }
flags |= SKBEDIT_F_TXQ_SKBHASH;
}
if (*pure_flags & SKBEDIT_F_INHERITDSFIELD)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 734/752] gpio: sysfs: fix chip removal with GPIOs exported over sysfs
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (268 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 733/752] net/sched: act_skbedit: fix divide-by-zero in tcf_skbedit_hash() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 735/752] x86/kexec: Copy ACPI root pointer address from config table Sasha Levin
` (14 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Bartosz Golaszewski, stable, Sasha Levin
From: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
[ Upstream commit 6766f59012301f1bf3f46c6e7149caca45d92309 ]
Currently if we export a GPIO over sysfs and unbind the parent GPIO
controller, the exported attribute will remain under /sys/class/gpio
because once we remove the parent device, we can no longer associate the
descriptor with it in gpiod_unexport() and never drop the final
reference.
Rework the teardown code: provide an unlocked variant of
gpiod_unexport() and remove all exported GPIOs with the sysfs_lock taken
before unregistering the parent device itself. This is done to prevent
any new exports happening before we unregister the device completely.
Cc: stable@vger.kernel.org
Fixes: 1cd53df733c2 ("gpio: sysfs: don't look up exported lines as class devices")
Link: https://patch.msgid.link/20260212133505.81516-1-bartosz.golaszewski@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpio/gpiolib-sysfs.c | 106 ++++++++++++++++++-----------------
1 file changed, 55 insertions(+), 51 deletions(-)
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c
index 7d5fc1ea2aa54..e044690ad412b 100644
--- a/drivers/gpio/gpiolib-sysfs.c
+++ b/drivers/gpio/gpiolib-sysfs.c
@@ -919,63 +919,68 @@ int gpiod_export_link(struct device *dev, const char *name,
}
EXPORT_SYMBOL_GPL(gpiod_export_link);
-/**
- * gpiod_unexport - reverse effect of gpiod_export()
- * @desc: GPIO to make unavailable
- *
- * This is implicit on gpiod_free().
- */
-void gpiod_unexport(struct gpio_desc *desc)
+static void gpiod_unexport_unlocked(struct gpio_desc *desc)
{
struct gpiod_data *tmp, *desc_data = NULL;
struct gpiodev_data *gdev_data;
struct gpio_device *gdev;
- if (!desc) {
- pr_warn("%s: invalid GPIO\n", __func__);
+ if (!test_bit(GPIOD_FLAG_EXPORT, &desc->flags))
return;
- }
- scoped_guard(mutex, &sysfs_lock) {
- if (!test_bit(GPIOD_FLAG_EXPORT, &desc->flags))
- return;
-
- gdev = gpiod_to_gpio_device(desc);
- gdev_data = gdev_get_data(gdev);
- if (!gdev_data)
- return;
+ gdev = gpiod_to_gpio_device(desc);
+ gdev_data = gdev_get_data(gdev);
+ if (!gdev_data)
+ return;
- list_for_each_entry(tmp, &gdev_data->exported_lines, list) {
- if (gpiod_is_equal(desc, tmp->desc)) {
- desc_data = tmp;
- break;
- }
+ list_for_each_entry(tmp, &gdev_data->exported_lines, list) {
+ if (gpiod_is_equal(desc, tmp->desc)) {
+ desc_data = tmp;
+ break;
}
+ }
- if (!desc_data)
- return;
+ if (!desc_data)
+ return;
- list_del(&desc_data->list);
- clear_bit(GPIOD_FLAG_EXPORT, &desc->flags);
+ list_del(&desc_data->list);
+ clear_bit(GPIOD_FLAG_EXPORT, &desc->flags);
#if IS_ENABLED(CONFIG_GPIO_SYSFS_LEGACY)
- sysfs_put(desc_data->value_kn);
- device_unregister(desc_data->dev);
-
- /*
- * Release irq after deregistration to prevent race with
- * edge_store.
- */
- if (desc_data->irq_flags)
- gpio_sysfs_free_irq(desc_data);
+ sysfs_put(desc_data->value_kn);
+ device_unregister(desc_data->dev);
+
+ /*
+ * Release irq after deregistration to prevent race with
+ * edge_store.
+ */
+ if (desc_data->irq_flags)
+ gpio_sysfs_free_irq(desc_data);
#endif /* CONFIG_GPIO_SYSFS_LEGACY */
- sysfs_remove_groups(desc_data->parent,
- desc_data->chip_attr_groups);
- }
+ sysfs_remove_groups(desc_data->parent,
+ desc_data->chip_attr_groups);
mutex_destroy(&desc_data->mutex);
kfree(desc_data);
}
+
+/**
+ * gpiod_unexport - reverse effect of gpiod_export()
+ * @desc: GPIO to make unavailable
+ *
+ * This is implicit on gpiod_free().
+ */
+void gpiod_unexport(struct gpio_desc *desc)
+{
+ if (!desc) {
+ pr_warn("%s: invalid GPIO\n", __func__);
+ return;
+ }
+
+ guard(mutex)(&sysfs_lock);
+
+ gpiod_unexport_unlocked(desc);
+}
EXPORT_SYMBOL_GPL(gpiod_unexport);
int gpiochip_sysfs_register(struct gpio_device *gdev)
@@ -1054,29 +1059,28 @@ void gpiochip_sysfs_unregister(struct gpio_device *gdev)
struct gpio_desc *desc;
struct gpio_chip *chip;
- scoped_guard(mutex, &sysfs_lock) {
- data = gdev_get_data(gdev);
- if (!data)
- return;
+ guard(mutex)(&sysfs_lock);
-#if IS_ENABLED(CONFIG_GPIO_SYSFS_LEGACY)
- device_unregister(data->cdev_base);
-#endif /* CONFIG_GPIO_SYSFS_LEGACY */
- device_unregister(data->cdev_id);
- kfree(data);
- }
+ data = gdev_get_data(gdev);
+ if (!data)
+ return;
guard(srcu)(&gdev->srcu);
-
chip = srcu_dereference(gdev->chip, &gdev->srcu);
if (!chip)
return;
/* unregister gpiod class devices owned by sysfs */
for_each_gpio_desc_with_flag(chip, desc, GPIOD_FLAG_SYSFS) {
- gpiod_unexport(desc);
+ gpiod_unexport_unlocked(desc);
gpiod_free(desc);
}
+
+#if IS_ENABLED(CONFIG_GPIO_SYSFS_LEGACY)
+ device_unregister(data->cdev_base);
+#endif /* CONFIG_GPIO_SYSFS_LEGACY */
+ device_unregister(data->cdev_id);
+ kfree(data);
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 735/752] x86/kexec: Copy ACPI root pointer address from config table
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (269 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 734/752] gpio: sysfs: fix chip removal with GPIOs exported over sysfs Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 736/752] io_uring/zcrx: fix user_ref race between scrub and refill paths Sasha Levin
` (13 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Ard Biesheuvel, stable, Dave Young, Sasha Levin
From: Ard Biesheuvel <ardb@kernel.org>
[ Upstream commit e00ac9e5afb5d80c0168ec88d8e8662a54af8249 ]
Dave reports that kexec may fail when the first kernel boots via the EFI
stub but without EFI runtime services, as in that case, the RSDP address
field in struct bootparams is never assigned. Kexec copies this value
into the version of struct bootparams that it provides to the incoming
kernel, which may have no other means to locate the ACPI root pointer.
So take the value from the EFI config tables if no root pointer has been
set in the first kernel's struct bootparams.
Fixes: a1b87d54f4e4 ("x86/efistub: Avoid legacy decompressor when doing EFI boot")
Cc: <stable@vger.kernel.org> # v6.1
Reported-by: Dave Young <dyoung@redhat.com>
Tested-by: Dave Young <dyoung@redhat.com>
Link: https://lore.kernel.org/linux-efi/aZQg_tRQmdKNadCg@darkstar.users.ipa.redhat.com/
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/x86/kernel/kexec-bzimage64.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index c3244ac680d14..f3b451eb49be1 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -192,6 +192,13 @@ setup_efi_state(struct boot_params *params, unsigned long params_load_addr,
struct efi_info *current_ei = &boot_params.efi_info;
struct efi_info *ei = ¶ms->efi_info;
+ if (!params->acpi_rsdp_addr) {
+ if (efi.acpi20 != EFI_INVALID_TABLE_ADDR)
+ params->acpi_rsdp_addr = efi.acpi20;
+ else if (efi.acpi != EFI_INVALID_TABLE_ADDR)
+ params->acpi_rsdp_addr = efi.acpi;
+ }
+
if (!efi_enabled(EFI_RUNTIME_SERVICES))
return 0;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 736/752] io_uring/zcrx: fix user_ref race between scrub and refill paths
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (270 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 735/752] x86/kexec: Copy ACPI root pointer address from config table Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 737/752] rust: irq: add `'static` bounds to irq callbacks Sasha Levin
` (12 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Kai Aizen, stable, Pavel Begunkov, Jens Axboe, Sasha Levin
From: Kai Aizen <kai@snailsploit.com>
[ Upstream commit 003049b1c4fb8aabb93febb7d1e49004f6ad653b ]
The io_zcrx_put_niov_uref() function uses a non-atomic
check-then-decrement pattern (atomic_read followed by separate
atomic_dec) to manipulate user_refs. This is serialized against other
callers by rq_lock, but io_zcrx_scrub() modifies the same counter with
atomic_xchg() WITHOUT holding rq_lock.
On SMP systems, the following race exists:
CPU0 (refill, holds rq_lock) CPU1 (scrub, no rq_lock)
put_niov_uref:
atomic_read(uref) - 1
// window opens
atomic_xchg(uref, 0) - 1
return_niov_freelist(niov) [PUSH #1]
// window closes
atomic_dec(uref) - wraps to -1
returns true
return_niov(niov)
return_niov_freelist(niov) [PUSH #2: DOUBLE-FREE]
The same niov is pushed to the freelist twice, causing free_count to
exceed nr_iovs. Subsequent freelist pushes then perform an out-of-bounds
write (a u32 value) past the kvmalloc'd freelist array into the adjacent
slab object.
Fix this by replacing the non-atomic read-then-dec in
io_zcrx_put_niov_uref() with an atomic_try_cmpxchg loop that atomically
tests and decrements user_refs. This makes the operation safe against
concurrent atomic_xchg from scrub without requiring scrub to acquire
rq_lock.
Fixes: 34a3e60821ab ("io_uring/zcrx: implement zerocopy receive pp memory provider")
Cc: stable@vger.kernel.org
Signed-off-by: Kai Aizen <kai@snailsploit.com>
[pavel: removed a warning and a comment]
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
io_uring/zcrx.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/io_uring/zcrx.c b/io_uring/zcrx.c
index 030d632d98392..c524be7109c29 100644
--- a/io_uring/zcrx.c
+++ b/io_uring/zcrx.c
@@ -336,10 +336,14 @@ static inline atomic_t *io_get_user_counter(struct net_iov *niov)
static bool io_zcrx_put_niov_uref(struct net_iov *niov)
{
atomic_t *uref = io_get_user_counter(niov);
+ int old;
+
+ old = atomic_read(uref);
+ do {
+ if (unlikely(old == 0))
+ return false;
+ } while (!atomic_try_cmpxchg(uref, &old, old - 1));
- if (unlikely(!atomic_read(uref)))
- return false;
- atomic_dec(uref);
return true;
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 737/752] rust: irq: add `'static` bounds to irq callbacks
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (271 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 736/752] io_uring/zcrx: fix user_ref race between scrub and refill paths Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 738/752] rust: pin-init: replace clippy `expect` with `allow` Sasha Levin
` (11 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Benno Lossin, stable, Gary Guo, Daniel Almeida, Danilo Krummrich,
Miguel Ojeda, Sasha Levin
From: Benno Lossin <lossin@kernel.org>
[ Upstream commit 621609f1e5ca43a75edd497dd1c28bd84aa66433 ]
These callback functions take a generic `T` that is used in the body as
the generic argument in `Registration` and `ThreadedRegistration`. Those
types require `T: 'static`, but due to a compiler bug this requirement
isn't propagated to the function. Thus add the bound. This was caught in
the upstream Rust CI [1].
[ The three errors looked similar and will start appearing with Rust
1.95.0 (expected 2026-04-16). The first one was:
error[E0310]: the parameter type `T` may not live long enough
Error: --> rust/kernel/irq/request.rs:266:43
|
266 | let registration = unsafe { &*(ptr as *const Registration<T>) };
| ^^^^^^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
264 | unsafe extern "C" fn handle_irq_callback<T: Handler + 'static>(_irq: i32, ptr: *mut c_void) -> c_uint {
| +++++++++
- Miguel ]
Link: https://github.com/rust-lang/rust/pull/149389 [1]
Signed-off-by: Benno Lossin <lossin@kernel.org>
Cc: stable@vger.kernel.org
Fixes: 29e16fcd67ee ("rust: irq: add &Device<Bound> argument to irq callbacks")
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: https://lore.kernel.org/rust-for-linux/20260217222425.8755-1-cole@unwrap.rs/
Link: https://patch.msgid.link/20260214092740.3201946-1-lossin@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
rust/kernel/irq/request.rs | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/rust/kernel/irq/request.rs b/rust/kernel/irq/request.rs
index b150563fdef80..2ceeaeb0543a4 100644
--- a/rust/kernel/irq/request.rs
+++ b/rust/kernel/irq/request.rs
@@ -261,7 +261,10 @@ impl<T: Handler + 'static> Registration<T> {
/// # Safety
///
/// This function should be only used as the callback in `request_irq`.
-unsafe extern "C" fn handle_irq_callback<T: Handler>(_irq: i32, ptr: *mut c_void) -> c_uint {
+unsafe extern "C" fn handle_irq_callback<T: Handler + 'static>(
+ _irq: i32,
+ ptr: *mut c_void,
+) -> c_uint {
// SAFETY: `ptr` is a pointer to `Registration<T>` set in `Registration::new`
let registration = unsafe { &*(ptr as *const Registration<T>) };
// SAFETY: The irq callback is removed before the device is unbound, so the fact that the irq
@@ -480,7 +483,7 @@ impl<T: ThreadedHandler + 'static> ThreadedRegistration<T> {
/// # Safety
///
/// This function should be only used as the callback in `request_threaded_irq`.
-unsafe extern "C" fn handle_threaded_irq_callback<T: ThreadedHandler>(
+unsafe extern "C" fn handle_threaded_irq_callback<T: ThreadedHandler + 'static>(
_irq: i32,
ptr: *mut c_void,
) -> c_uint {
@@ -496,7 +499,10 @@ unsafe extern "C" fn handle_threaded_irq_callback<T: ThreadedHandler>(
/// # Safety
///
/// This function should be only used as the callback in `request_threaded_irq`.
-unsafe extern "C" fn thread_fn_callback<T: ThreadedHandler>(_irq: i32, ptr: *mut c_void) -> c_uint {
+unsafe extern "C" fn thread_fn_callback<T: ThreadedHandler + 'static>(
+ _irq: i32,
+ ptr: *mut c_void,
+) -> c_uint {
// SAFETY: `ptr` is a pointer to `ThreadedRegistration<T>` set in `ThreadedRegistration::new`
let registration = unsafe { &*(ptr as *const ThreadedRegistration<T>) };
// SAFETY: The irq callback is removed before the device is unbound, so the fact that the irq
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 738/752] rust: pin-init: replace clippy `expect` with `allow`
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (272 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 737/752] rust: irq: add `'static` bounds to irq callbacks Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 739/752] arm64: Force the use of CNTVCT_EL0 in __delay() Sasha Levin
` (10 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Benno Lossin, stable, Miguel Ojeda, Sasha Levin
From: Benno Lossin <lossin@kernel.org>
[ Upstream commit a58b8764aed9648357b1c5b6368c9943ba33b7f9 ]
`clippy` has changed behavior in [1] (Rust 1.95) where it no longer
warns about the `let_and_return` lint when a comment is placed between
the let binding and the return expression. Nightly thus fails to build,
because the expectation is no longer fulfilled.
Thus replace the expectation with an `allow`.
[ The errors were:
error: this lint expectation is unfulfilled
--> rust/pin-init/src/lib.rs:1279:10
|
1279 | #[expect(clippy::let_and_return)]
| ^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D unfulfilled-lint-expectations` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(unfulfilled_lint_expectations)]`
error: this lint expectation is unfulfilled
--> rust/pin-init/src/lib.rs:1295:10
|
1295 | #[expect(clippy::let_and_return)]
| ^^^^^^^^^^^^^^^^^^^^^^
- Miguel ]
Link: https://github.com/rust-lang/rust-clippy/pull/16461 [1]
Signed-off-by: Benno Lossin <lossin@kernel.org>
Cc: stable@vger.kernel.org # Needed in 6.18.y and later.
Link: https://patch.msgid.link/20260215132232.1549861-1-lossin@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
rust/pin-init/src/lib.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rust/pin-init/src/lib.rs b/rust/pin-init/src/lib.rs
index dd553212836e0..0128808579973 100644
--- a/rust/pin-init/src/lib.rs
+++ b/rust/pin-init/src/lib.rs
@@ -1276,13 +1276,13 @@ pub const unsafe fn init_from_closure<T: ?Sized, E>(
///
/// - `*mut U` must be castable to `*mut T` and any value of type `T` written through such a
/// pointer must result in a valid `U`.
-#[expect(clippy::let_and_return)]
pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl PinInit<U, E> {
// SAFETY: initialization delegated to a valid initializer. Cast is valid by function safety
// requirements.
let res = unsafe { pin_init_from_closure(|ptr: *mut U| init.__pinned_init(ptr.cast::<T>())) };
// FIXME: remove the let statement once the nightly-MSRV allows it (1.78 otherwise encounters a
// cycle when computing the type returned by this function)
+ #[allow(clippy::let_and_return)]
res
}
@@ -1292,13 +1292,13 @@ pub const unsafe fn cast_pin_init<T, U, E>(init: impl PinInit<T, E>) -> impl Pin
///
/// - `*mut U` must be castable to `*mut T` and any value of type `T` written through such a
/// pointer must result in a valid `U`.
-#[expect(clippy::let_and_return)]
pub const unsafe fn cast_init<T, U, E>(init: impl Init<T, E>) -> impl Init<U, E> {
// SAFETY: initialization delegated to a valid initializer. Cast is valid by function safety
// requirements.
let res = unsafe { init_from_closure(|ptr: *mut U| init.__init(ptr.cast::<T>())) };
// FIXME: remove the let statement once the nightly-MSRV allows it (1.78 otherwise encounters a
// cycle when computing the type returned by this function)
+ #[allow(clippy::let_and_return)]
res
}
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 739/752] arm64: Force the use of CNTVCT_EL0 in __delay()
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (273 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 738/752] rust: pin-init: replace clippy `expect` with `allow` Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 740/752] drm/amd/display: Correct logic check error for fastboot Sasha Levin
` (9 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Marc Zyngier, Hyesoo Yu, Quentin Perret, stable, Will Deacon,
Sasha Levin
From: Marc Zyngier <maz@kernel.org>
[ Upstream commit 29cc0f3aa7c64d3b3cb9d94c0a0984ba6717bf72 ]
Quentin forwards a report from Hyesoo Yu, describing an interesting
problem with the use of WFxT in __delay() when a vcpu is loaded and
that KVM is *not* in VHE mode (either nVHE or hVHE).
In this case, CNTVOFF_EL2 is set to a non-zero value to reflect the
state of the guest virtual counter. At the same time, __delay() is
using get_cycles() to read the counter value, which is indirected to
reading CNTPCT_EL0.
The core of the issue is that WFxT is using the *virtual* counter,
while the kernel is using the physical counter, and that the offset
introduces a really bad discrepancy between the two.
Fix this by forcing the use of CNTVCT_EL0, making __delay() consistent
irrespective of the value of CNTVOFF_EL2.
Reported-by: Hyesoo Yu <hyesoo.yu@samsung.com>
Reported-by: Quentin Perret <qperret@google.com>
Reviewed-by: Quentin Perret <qperret@google.com>
Fixes: 7d26b0516a0d ("arm64: Use WFxT for __delay() when possible")
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/ktosachvft2cgqd5qkukn275ugmhy6xrhxur4zqpdxlfr3qh5h@o3zrfnsq63od
Cc: stable@vger.kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
arch/arm64/lib/delay.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/lib/delay.c b/arch/arm64/lib/delay.c
index cb2062e7e2340..d02341303899e 100644
--- a/arch/arm64/lib/delay.c
+++ b/arch/arm64/lib/delay.c
@@ -23,9 +23,20 @@ static inline unsigned long xloops_to_cycles(unsigned long xloops)
return (xloops * loops_per_jiffy * HZ) >> 32;
}
+/*
+ * Force the use of CNTVCT_EL0 in order to have the same base as WFxT.
+ * This avoids some annoying issues when CNTVOFF_EL2 is not reset 0 on a
+ * KVM host running at EL1 until we do a vcpu_put() on the vcpu. When
+ * running at EL2, the effective offset is always 0.
+ *
+ * Note that userspace cannot change the offset behind our back either,
+ * as the vcpu mutex is held as long as KVM_RUN is in progress.
+ */
+#define __delay_cycles() __arch_counter_get_cntvct_stable()
+
void __delay(unsigned long cycles)
{
- cycles_t start = get_cycles();
+ cycles_t start = __delay_cycles();
if (alternative_has_cap_unlikely(ARM64_HAS_WFXT)) {
u64 end = start + cycles;
@@ -35,17 +46,17 @@ void __delay(unsigned long cycles)
* early, use a WFET loop to complete the delay.
*/
wfit(end);
- while ((get_cycles() - start) < cycles)
+ while ((__delay_cycles() - start) < cycles)
wfet(end);
} else if (arch_timer_evtstrm_available()) {
const cycles_t timer_evt_period =
USECS_TO_CYCLES(ARCH_TIMER_EVT_STREAM_PERIOD_US);
- while ((get_cycles() - start + timer_evt_period) < cycles)
+ while ((__delay_cycles() - start + timer_evt_period) < cycles)
wfe();
}
- while ((get_cycles() - start) < cycles)
+ while ((__delay_cycles() - start) < cycles)
cpu_relax();
}
EXPORT_SYMBOL(__delay);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 740/752] drm/amd/display: Correct logic check error for fastboot
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (274 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 739/752] arm64: Force the use of CNTVCT_EL0 in __delay() Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 741/752] drm/amdgpu: keep vga memory on MacBooks with switchable graphics Sasha Levin
` (8 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Charlene Liu, stable, Mario Limonciello, Ovidiu Bunea, Ray Wu,
Daniel Wheeler, Alex Deucher, Sasha Levin
From: Charlene Liu <Charlene.Liu@amd.com>
[ Upstream commit b6a65009e7ce3f0cc72da18f186adb60717b51a0 ]
[Why]
Fix fastboot broken in driver.
This is caused by an open source backport change 7495962c.
from the comment, the intended check is to disable fastboot
for pre-DCN10. but the logic check is reversed, and causes
fastboot to be disabled on all DCN10 and after.
fastboot is for driver trying to pick up bios used hw setting
and bypass reprogramming the hw if dc_validate_boot_timing()
condition meets.
Fixes: 7495962cbceb ("drm/amd/display: Disable fastboot on DCE 6 too")
Cc: stable@vger.kernel.org
Reviewed-by: Mario Limonciello <Mario.Limonciello@amd.com>
Reviewed-by: Ovidiu Bunea <ovidiu.bunea@amd.com>
Signed-off-by: Charlene Liu <Charlene.Liu@amd.com>
Signed-off-by: Ray Wu <ray.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
index 65e66bfc4161c..8f86177de48dc 100644
--- a/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
+++ b/drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
@@ -1933,8 +1933,8 @@ void dce110_enable_accelerated_mode(struct dc *dc, struct dc_state *context)
get_edp_streams(context, edp_streams, &edp_stream_num);
- /* Check fastboot support, disable on DCE 6-8 because of blank screens */
- if (edp_num && edp_stream_num && dc->ctx->dce_version < DCE_VERSION_10_0) {
+ /* Check fastboot support, disable on DCE 6-8-10 because of blank screens */
+ if (edp_num && edp_stream_num && dc->ctx->dce_version > DCE_VERSION_10_0) {
for (i = 0; i < edp_num; i++) {
edp_link = edp_links[i];
if (edp_link != edp_streams[0]->link)
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 741/752] drm/amdgpu: keep vga memory on MacBooks with switchable graphics
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (275 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 740/752] drm/amd/display: Correct logic check error for fastboot Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 742/752] net: nfc: nci: Fix parameter validation for packet data Sasha Levin
` (7 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Alex Deucher, Mario Kleiner, stable, Sasha Levin
From: Alex Deucher <alexander.deucher@amd.com>
[ Upstream commit 096bb75e13cc508d3915b7604e356bcb12b17766 ]
On Intel MacBookPros with switchable graphics, when the iGPU
is enabled, the address of VRAM gets put at 0 in the dGPU's
virtual address space. This is non-standard and seems to cause
issues with the cursor if it ends up at 0. We have the framework
to reserve memory at 0 in the address space, so enable it here if
the vram start address is 0.
Reviewed-and-tested-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4302
Cc: stable@vger.kernel.org
Cc: Mario Kleiner <mario.kleiner.de@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
index 01ad5cc008a96..1e3b8a506d1b9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
@@ -1013,6 +1013,16 @@ void amdgpu_gmc_get_vbios_allocations(struct amdgpu_device *adev)
case CHIP_RENOIR:
adev->mman.keep_stolen_vga_memory = true;
break;
+ case CHIP_POLARIS10:
+ case CHIP_POLARIS11:
+ case CHIP_POLARIS12:
+ /* MacBookPros with switchable graphics put VRAM at 0 when
+ * the iGPU is enabled which results in cursor issues if
+ * the cursor ends up at 0. Reserve vram at 0 in that case.
+ */
+ if (adev->gmc.vram_start == 0)
+ adev->mman.keep_stolen_vga_memory = true;
+ break;
default:
adev->mman.keep_stolen_vga_memory = false;
break;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 742/752] net: nfc: nci: Fix parameter validation for packet data
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (276 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 741/752] drm/amdgpu: keep vga memory on MacBooks with switchable graphics Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 743/752] ring-buffer: Fix possible dereference of uninitialized pointer Sasha Levin
` (6 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Michael Thalmeier, stable, syzbot+740e04c2a93467a0f8c8,
Jakub Kicinski, Sasha Levin
From: Michael Thalmeier <michael.thalmeier@hale.at>
[ Upstream commit 571dcbeb8e635182bb825ae758399831805693c2 ]
Since commit 9c328f54741b ("net: nfc: nci: Add parameter validation for
packet data") communication with nci nfc chips is not working any more.
The mentioned commit tries to fix access of uninitialized data, but
failed to understand that in some cases the data packet is of variable
length and can therefore not be compared to the maximum packet length
given by the sizeof(struct).
Fixes: 9c328f54741b ("net: nfc: nci: Add parameter validation for packet data")
Cc: stable@vger.kernel.org
Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
Reported-by: syzbot+740e04c2a93467a0f8c8@syzkaller.appspotmail.com
Link: https://patch.msgid.link/20260218083000.301354-1-michael.thalmeier@hale.at
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
net/nfc/nci/ntf.c | 159 ++++++++++++++++++++++++++++++++++++++++------
1 file changed, 141 insertions(+), 18 deletions(-)
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 418b84e2b2605..c96512bb86531 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -58,7 +58,7 @@ static int nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
struct nci_conn_info *conn_info;
int i;
- if (skb->len < sizeof(struct nci_core_conn_credit_ntf))
+ if (skb->len < offsetofend(struct nci_core_conn_credit_ntf, num_entries))
return -EINVAL;
ntf = (struct nci_core_conn_credit_ntf *)skb->data;
@@ -68,6 +68,10 @@ static int nci_core_conn_credits_ntf_packet(struct nci_dev *ndev,
if (ntf->num_entries > NCI_MAX_NUM_CONN)
ntf->num_entries = NCI_MAX_NUM_CONN;
+ if (skb->len < offsetofend(struct nci_core_conn_credit_ntf, num_entries) +
+ ntf->num_entries * sizeof(struct conn_credit_entry))
+ return -EINVAL;
+
/* update the credits */
for (i = 0; i < ntf->num_entries; i++) {
ntf->conn_entries[i].conn_id =
@@ -138,23 +142,48 @@ static int nci_core_conn_intf_error_ntf_packet(struct nci_dev *ndev,
static const __u8 *
nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
struct rf_tech_specific_params_nfca_poll *nfca_poll,
- const __u8 *data)
+ const __u8 *data, ssize_t data_len)
{
+ /* Check if we have enough data for sens_res (2 bytes) */
+ if (data_len < 2)
+ return ERR_PTR(-EINVAL);
+
nfca_poll->sens_res = __le16_to_cpu(*((__le16 *)data));
data += 2;
+ data_len -= 2;
+
+ /* Check if we have enough data for nfcid1_len (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
nfca_poll->nfcid1_len = min_t(__u8, *data++, NFC_NFCID1_MAXSIZE);
+ data_len--;
pr_debug("sens_res 0x%x, nfcid1_len %d\n",
nfca_poll->sens_res, nfca_poll->nfcid1_len);
+ /* Check if we have enough data for nfcid1 */
+ if (data_len < nfca_poll->nfcid1_len)
+ return ERR_PTR(-EINVAL);
+
memcpy(nfca_poll->nfcid1, data, nfca_poll->nfcid1_len);
data += nfca_poll->nfcid1_len;
+ data_len -= nfca_poll->nfcid1_len;
+
+ /* Check if we have enough data for sel_res_len (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
nfca_poll->sel_res_len = *data++;
+ data_len--;
+
+ if (nfca_poll->sel_res_len != 0) {
+ /* Check if we have enough data for sel_res (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
- if (nfca_poll->sel_res_len != 0)
nfca_poll->sel_res = *data++;
+ }
pr_debug("sel_res_len %d, sel_res 0x%x\n",
nfca_poll->sel_res_len,
@@ -166,12 +195,21 @@ nci_extract_rf_params_nfca_passive_poll(struct nci_dev *ndev,
static const __u8 *
nci_extract_rf_params_nfcb_passive_poll(struct nci_dev *ndev,
struct rf_tech_specific_params_nfcb_poll *nfcb_poll,
- const __u8 *data)
+ const __u8 *data, ssize_t data_len)
{
+ /* Check if we have enough data for sensb_res_len (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
+
nfcb_poll->sensb_res_len = min_t(__u8, *data++, NFC_SENSB_RES_MAXSIZE);
+ data_len--;
pr_debug("sensb_res_len %d\n", nfcb_poll->sensb_res_len);
+ /* Check if we have enough data for sensb_res */
+ if (data_len < nfcb_poll->sensb_res_len)
+ return ERR_PTR(-EINVAL);
+
memcpy(nfcb_poll->sensb_res, data, nfcb_poll->sensb_res_len);
data += nfcb_poll->sensb_res_len;
@@ -181,14 +219,29 @@ nci_extract_rf_params_nfcb_passive_poll(struct nci_dev *ndev,
static const __u8 *
nci_extract_rf_params_nfcf_passive_poll(struct nci_dev *ndev,
struct rf_tech_specific_params_nfcf_poll *nfcf_poll,
- const __u8 *data)
+ const __u8 *data, ssize_t data_len)
{
+ /* Check if we have enough data for bit_rate (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
+
nfcf_poll->bit_rate = *data++;
+ data_len--;
+
+ /* Check if we have enough data for sensf_res_len (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
+
nfcf_poll->sensf_res_len = min_t(__u8, *data++, NFC_SENSF_RES_MAXSIZE);
+ data_len--;
pr_debug("bit_rate %d, sensf_res_len %d\n",
nfcf_poll->bit_rate, nfcf_poll->sensf_res_len);
+ /* Check if we have enough data for sensf_res */
+ if (data_len < nfcf_poll->sensf_res_len)
+ return ERR_PTR(-EINVAL);
+
memcpy(nfcf_poll->sensf_res, data, nfcf_poll->sensf_res_len);
data += nfcf_poll->sensf_res_len;
@@ -198,22 +251,49 @@ nci_extract_rf_params_nfcf_passive_poll(struct nci_dev *ndev,
static const __u8 *
nci_extract_rf_params_nfcv_passive_poll(struct nci_dev *ndev,
struct rf_tech_specific_params_nfcv_poll *nfcv_poll,
- const __u8 *data)
+ const __u8 *data, ssize_t data_len)
{
+ /* Skip 1 byte (reserved) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
+
++data;
+ data_len--;
+
+ /* Check if we have enough data for dsfid (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
+
nfcv_poll->dsfid = *data++;
+ data_len--;
+
+ /* Check if we have enough data for uid (8 bytes) */
+ if (data_len < NFC_ISO15693_UID_MAXSIZE)
+ return ERR_PTR(-EINVAL);
+
memcpy(nfcv_poll->uid, data, NFC_ISO15693_UID_MAXSIZE);
data += NFC_ISO15693_UID_MAXSIZE;
+
return data;
}
static const __u8 *
nci_extract_rf_params_nfcf_passive_listen(struct nci_dev *ndev,
struct rf_tech_specific_params_nfcf_listen *nfcf_listen,
- const __u8 *data)
+ const __u8 *data, ssize_t data_len)
{
+ /* Check if we have enough data for local_nfcid2_len (1 byte) */
+ if (data_len < 1)
+ return ERR_PTR(-EINVAL);
+
nfcf_listen->local_nfcid2_len = min_t(__u8, *data++,
NFC_NFCID2_MAXSIZE);
+ data_len--;
+
+ /* Check if we have enough data for local_nfcid2 */
+ if (data_len < nfcf_listen->local_nfcid2_len)
+ return ERR_PTR(-EINVAL);
+
memcpy(nfcf_listen->local_nfcid2, data, nfcf_listen->local_nfcid2_len);
data += nfcf_listen->local_nfcid2_len;
@@ -364,7 +444,7 @@ static int nci_rf_discover_ntf_packet(struct nci_dev *ndev,
const __u8 *data;
bool add_target = true;
- if (skb->len < sizeof(struct nci_rf_discover_ntf))
+ if (skb->len < offsetofend(struct nci_rf_discover_ntf, rf_tech_specific_params_len))
return -EINVAL;
data = skb->data;
@@ -380,26 +460,42 @@ static int nci_rf_discover_ntf_packet(struct nci_dev *ndev,
pr_debug("rf_tech_specific_params_len %d\n",
ntf.rf_tech_specific_params_len);
+ if (skb->len < (data - skb->data) +
+ ntf.rf_tech_specific_params_len + sizeof(ntf.ntf_type))
+ return -EINVAL;
+
if (ntf.rf_tech_specific_params_len > 0) {
switch (ntf.rf_tech_and_mode) {
case NCI_NFC_A_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfca_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfca_poll), data);
+ &(ntf.rf_tech_specific_params.nfca_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return PTR_ERR(data);
break;
case NCI_NFC_B_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfcb_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfcb_poll), data);
+ &(ntf.rf_tech_specific_params.nfcb_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return PTR_ERR(data);
break;
case NCI_NFC_F_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfcf_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfcf_poll), data);
+ &(ntf.rf_tech_specific_params.nfcf_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return PTR_ERR(data);
break;
case NCI_NFC_V_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfcv_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfcv_poll), data);
+ &(ntf.rf_tech_specific_params.nfcv_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return PTR_ERR(data);
break;
default:
@@ -596,7 +692,7 @@ static int nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
const __u8 *data;
int err = NCI_STATUS_OK;
- if (skb->len < sizeof(struct nci_rf_intf_activated_ntf))
+ if (skb->len < offsetofend(struct nci_rf_intf_activated_ntf, rf_tech_specific_params_len))
return -EINVAL;
data = skb->data;
@@ -628,26 +724,41 @@ static int nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
if (ntf.rf_interface == NCI_RF_INTERFACE_NFCEE_DIRECT)
goto listen;
+ if (skb->len < (data - skb->data) + ntf.rf_tech_specific_params_len)
+ return -EINVAL;
+
if (ntf.rf_tech_specific_params_len > 0) {
switch (ntf.activation_rf_tech_and_mode) {
case NCI_NFC_A_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfca_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfca_poll), data);
+ &(ntf.rf_tech_specific_params.nfca_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return -EINVAL;
break;
case NCI_NFC_B_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfcb_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfcb_poll), data);
+ &(ntf.rf_tech_specific_params.nfcb_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return -EINVAL;
break;
case NCI_NFC_F_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfcf_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfcf_poll), data);
+ &(ntf.rf_tech_specific_params.nfcf_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return -EINVAL;
break;
case NCI_NFC_V_PASSIVE_POLL_MODE:
data = nci_extract_rf_params_nfcv_passive_poll(ndev,
- &(ntf.rf_tech_specific_params.nfcv_poll), data);
+ &(ntf.rf_tech_specific_params.nfcv_poll), data,
+ ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return -EINVAL;
break;
case NCI_NFC_A_PASSIVE_LISTEN_MODE:
@@ -657,7 +768,9 @@ static int nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
case NCI_NFC_F_PASSIVE_LISTEN_MODE:
data = nci_extract_rf_params_nfcf_passive_listen(ndev,
&(ntf.rf_tech_specific_params.nfcf_listen),
- data);
+ data, ntf.rf_tech_specific_params_len);
+ if (IS_ERR(data))
+ return -EINVAL;
break;
default:
@@ -668,6 +781,13 @@ static int nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
}
}
+ if (skb->len < (data - skb->data) +
+ sizeof(ntf.data_exch_rf_tech_and_mode) +
+ sizeof(ntf.data_exch_tx_bit_rate) +
+ sizeof(ntf.data_exch_rx_bit_rate) +
+ sizeof(ntf.activation_params_len))
+ return -EINVAL;
+
ntf.data_exch_rf_tech_and_mode = *data++;
ntf.data_exch_tx_bit_rate = *data++;
ntf.data_exch_rx_bit_rate = *data++;
@@ -679,6 +799,9 @@ static int nci_rf_intf_activated_ntf_packet(struct nci_dev *ndev,
pr_debug("data_exch_rx_bit_rate 0x%x\n", ntf.data_exch_rx_bit_rate);
pr_debug("activation_params_len %d\n", ntf.activation_params_len);
+ if (skb->len < (data - skb->data) + ntf.activation_params_len)
+ return -EINVAL;
+
if (ntf.activation_params_len > 0) {
switch (ntf.rf_interface) {
case NCI_RF_INTERFACE_ISO_DEP:
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 743/752] ring-buffer: Fix possible dereference of uninitialized pointer
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (277 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 742/752] net: nfc: nci: Fix parameter validation for packet data Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 744/752] tracing: ring-buffer: Fix to check event length before using Sasha Levin
` (5 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Daniil Dulov, stable, kernel test robot, Dan Carpenter,
Masami Hiramatsu (Google), Steven Rostedt (Google), Sasha Levin
From: Daniil Dulov <d.dulov@aladdin.ru>
[ Upstream commit f1547779402c4cd67755c33616b7203baa88420b ]
There is a pointer head_page in rb_meta_validate_events() which is not
initialized at the beginning of a function. This pointer can be dereferenced
if there is a failure during reader page validation. In this case the control
is passed to "invalid" label where the pointer is dereferenced in a loop.
To fix the issue initialize orig_head and head_page before calling
rb_validate_buffer.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://patch.msgid.link/20260213100130.2013839-1-d.dulov@aladdin.ru
Closes: https://lore.kernel.org/r/202406130130.JtTGRf7W-lkp@intel.com/
Fixes: 5f3b6e839f3c ("ring-buffer: Validate boot range memory events")
Signed-off-by: Daniil Dulov <d.dulov@aladdin.ru>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/ring_buffer.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index 3ba08fc1b7d05..fdb3153bbf487 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1883,6 +1883,8 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer)
if (!meta || !meta->head_buffer)
return;
+ orig_head = head_page = cpu_buffer->head_page;
+
/* Do the reader page first */
ret = rb_validate_buffer(cpu_buffer->reader_page->page, cpu_buffer->cpu);
if (ret < 0) {
@@ -1893,7 +1895,6 @@ static void rb_meta_validate_events(struct ring_buffer_per_cpu *cpu_buffer)
entry_bytes += local_read(&cpu_buffer->reader_page->page->commit);
local_set(&cpu_buffer->reader_page->entries, ret);
- orig_head = head_page = cpu_buffer->head_page;
ts = head_page->page->time_stamp;
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 744/752] tracing: ring-buffer: Fix to check event length before using
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (278 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 743/752] ring-buffer: Fix possible dereference of uninitialized pointer Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 745/752] fgraph: Do not call handlers direct when not using ftrace_ops Sasha Levin
` (4 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Masami Hiramatsu (Google), stable, Mathieu Desnoyers,
Steven Rostedt (Google), Sasha Levin
From: "Masami Hiramatsu (Google)" <mhiramat@kernel.org>
[ Upstream commit 912b0ee248c529a4f45d1e7f568dc1adddbf2a4a ]
Check the event length before adding it for accessing next index in
rb_read_data_buffer(). Since this function is used for validating
possibly broken ring buffers, the length of the event could be broken.
In that case, the new event (e + len) can point a wrong address.
To avoid invalid memory access at boot, check whether the length of
each event is in the possible range before using it.
Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fixes: 5f3b6e839f3c ("ring-buffer: Validate boot range memory events")
Link: https://patch.msgid.link/177123421541.142205.9414352170164678966.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/ring_buffer.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
index fdb3153bbf487..54d70bd0a3cb9 100644
--- a/kernel/trace/ring_buffer.c
+++ b/kernel/trace/ring_buffer.c
@@ -1813,6 +1813,7 @@ static int rb_read_data_buffer(struct buffer_data_page *dpage, int tail, int cpu
struct ring_buffer_event *event;
u64 ts, delta;
int events = 0;
+ int len;
int e;
*delta_ptr = 0;
@@ -1820,9 +1821,12 @@ static int rb_read_data_buffer(struct buffer_data_page *dpage, int tail, int cpu
ts = dpage->time_stamp;
- for (e = 0; e < tail; e += rb_event_length(event)) {
+ for (e = 0; e < tail; e += len) {
event = (struct ring_buffer_event *)(dpage->data + e);
+ len = rb_event_length(event);
+ if (len <= 0 || len > tail - e)
+ return -1;
switch (event->type_len) {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 745/752] fgraph: Do not call handlers direct when not using ftrace_ops
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (279 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 744/752] tracing: ring-buffer: Fix to check event length before using Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 746/752] tracing: Fix checking of freed trace_event_file for hist files Sasha Levin
` (3 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Steven Rostedt, stable, Masami Hiramatsu, Mathieu Desnoyers,
Mark Rutland, Sasha Levin
From: Steven Rostedt <rostedt@goodmis.org>
[ Upstream commit f4ff9f646a4d373f9e895c2f0073305da288bc0a ]
The function graph tracer was modified to us the ftrace_ops of the
function tracer. This simplified the code as well as allowed more features
of the function graph tracer.
Not all architectures were converted over as it required the
implementation of HAVE_DYNAMIC_FTRACE_WITH_ARGS to implement. For those
architectures, it still did it the old way where the function graph tracer
handle was called by the function tracer trampoline. The handler then had
to check the hash to see if the registered handlers wanted to be called by
that function or not.
In order to speed up the function graph tracer that used ftrace_ops, if
only one callback was registered with function graph, it would call its
function directly via a static call.
Now, if the architecture does not support the use of using ftrace_ops and
still has the ftrace function trampoline calling the function graph
handler, then by doing a direct call it removes the check against the
handler's hash (list of functions it wants callbacks to), and it may call
that handler for functions that the handler did not request calls for.
On 32bit x86, which does not support the ftrace_ops use with function
graph tracer, it shows the issue:
~# trace-cmd start -p function -l schedule
~# trace-cmd show
# tracer: function_graph
#
# CPU DURATION FUNCTION CALLS
# | | | | | | |
2) * 11898.94 us | schedule();
3) # 1783.041 us | schedule();
1) | schedule() {
------------------------------------------
1) bash-8369 => kworker-7669
------------------------------------------
1) | schedule() {
------------------------------------------
1) kworker-7669 => bash-8369
------------------------------------------
1) + 97.004 us | }
1) | schedule() {
[..]
Now by starting the function tracer is another instance:
~# trace-cmd start -B foo -p function
This causes the function graph tracer to trace all functions (because the
function trace calls the function graph tracer for each on, and the
function graph trace is doing a direct call):
~# trace-cmd show
# tracer: function_graph
#
# CPU DURATION FUNCTION CALLS
# | | | | | | |
1) 1.669 us | } /* preempt_count_sub */
1) + 10.443 us | } /* _raw_spin_unlock_irqrestore */
1) | tick_program_event() {
1) | clockevents_program_event() {
1) 1.044 us | ktime_get();
1) 6.481 us | lapic_next_event();
1) + 10.114 us | }
1) + 11.790 us | }
1) ! 181.223 us | } /* hrtimer_interrupt */
1) ! 184.624 us | } /* __sysvec_apic_timer_interrupt */
1) | irq_exit_rcu() {
1) 0.678 us | preempt_count_sub();
When it should still only be tracing the schedule() function.
To fix this, add a macro FGRAPH_NO_DIRECT to be set to 0 when the
architecture does not support function graph use of ftrace_ops, and set to
1 otherwise. Then use this macro to know to allow function graph tracer to
call the handlers directly or not.
Cc: stable@vger.kernel.org
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Link: https://patch.msgid.link/20260218104244.5f14dade@gandalf.local.home
Fixes: cc60ee813b503 ("function_graph: Use static_call and branch to optimize entry function")
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/ftrace.h | 13 ++++++++++---
kernel/trace/fgraph.c | 12 +++++++++++-
2 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9cc60e2506af1..c3b1c74bdd7a4 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -1032,10 +1032,17 @@ static inline bool is_ftrace_trampoline(unsigned long addr)
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#ifndef ftrace_graph_func
-#define ftrace_graph_func ftrace_stub
-#define FTRACE_OPS_GRAPH_STUB FTRACE_OPS_FL_STUB
+# define ftrace_graph_func ftrace_stub
+# define FTRACE_OPS_GRAPH_STUB FTRACE_OPS_FL_STUB
+/*
+ * The function graph is called every time the function tracer is called.
+ * It must always test the ops hash and cannot just directly call
+ * the handler.
+ */
+# define FGRAPH_NO_DIRECT 1
#else
-#define FTRACE_OPS_GRAPH_STUB 0
+# define FTRACE_OPS_GRAPH_STUB 0
+# define FGRAPH_NO_DIRECT 0
#endif
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
diff --git a/kernel/trace/fgraph.c b/kernel/trace/fgraph.c
index 13832ff06c96c..234fd9d45b56e 100644
--- a/kernel/trace/fgraph.c
+++ b/kernel/trace/fgraph.c
@@ -542,7 +542,11 @@ static struct fgraph_ops fgraph_stub = {
static struct fgraph_ops *fgraph_direct_gops = &fgraph_stub;
DEFINE_STATIC_CALL(fgraph_func, ftrace_graph_entry_stub);
DEFINE_STATIC_CALL(fgraph_retfunc, ftrace_graph_ret_stub);
+#if FGRAPH_NO_DIRECT
+static DEFINE_STATIC_KEY_FALSE(fgraph_do_direct);
+#else
static DEFINE_STATIC_KEY_TRUE(fgraph_do_direct);
+#endif
/**
* ftrace_graph_stop - set to permanently disable function graph tracing
@@ -846,7 +850,7 @@ __ftrace_return_to_handler(struct ftrace_regs *fregs, unsigned long frame_pointe
bitmap = get_bitmap_bits(current, offset);
#ifdef CONFIG_HAVE_STATIC_CALL
- if (static_branch_likely(&fgraph_do_direct)) {
+ if (!FGRAPH_NO_DIRECT && static_branch_likely(&fgraph_do_direct)) {
if (test_bit(fgraph_direct_gops->idx, &bitmap))
static_call(fgraph_retfunc)(&trace, fgraph_direct_gops, fregs);
} else
@@ -1293,6 +1297,9 @@ static void ftrace_graph_enable_direct(bool enable_branch, struct fgraph_ops *go
trace_func_graph_ret_t retfunc = NULL;
int i;
+ if (FGRAPH_NO_DIRECT)
+ return;
+
if (gops) {
func = gops->entryfunc;
retfunc = gops->retfunc;
@@ -1316,6 +1323,9 @@ static void ftrace_graph_enable_direct(bool enable_branch, struct fgraph_ops *go
static void ftrace_graph_disable_direct(bool disable_branch)
{
+ if (FGRAPH_NO_DIRECT)
+ return;
+
if (disable_branch)
static_branch_disable(&fgraph_do_direct);
static_call_update(fgraph_func, ftrace_graph_entry_stub);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 746/752] tracing: Fix checking of freed trace_event_file for hist files
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (280 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 745/752] fgraph: Do not call handlers direct when not using ftrace_ops Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 747/752] tracing: Wake up poll waiters for hist files when removing an event Sasha Levin
` (2 subsequent siblings)
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Petr Pavlu, stable, Mathieu Desnoyers, Tom Zanussi,
Masami Hiramatsu (Google), Steven Rostedt (Google), Sasha Levin
From: Petr Pavlu <petr.pavlu@suse.com>
[ Upstream commit f0a0da1f907e8488826d91c465f7967a56a95aca ]
The event_hist_open() and event_hist_poll() functions currently retrieve
a trace_event_file pointer from a file struct by invoking
event_file_data(), which simply returns file->f_inode->i_private. The
functions then check if the pointer is NULL to determine whether the event
is still valid. This approach is flawed because i_private is assigned when
an eventfs inode is allocated and remains set throughout its lifetime.
Instead, the code should call event_file_file(), which checks for
EVENT_FILE_FL_FREED. Using the incorrect access function may result in the
code potentially opening a hist file for an event that is being removed or
becoming stuck while polling on this file.
Correct the access method to event_file_file() in both functions.
Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Link: https://patch.msgid.link/20260219162737.314231-2-petr.pavlu@suse.com
Fixes: 1bd13edbbed6 ("tracing/hist: Add poll(POLLIN) support on hist file")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
kernel/trace/trace_events_hist.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c
index 45727c4cf9545..2a0726e1bc97f 100644
--- a/kernel/trace/trace_events_hist.c
+++ b/kernel/trace/trace_events_hist.c
@@ -5778,7 +5778,7 @@ static __poll_t event_hist_poll(struct file *file, struct poll_table_struct *wai
guard(mutex)(&event_mutex);
- event_file = event_file_data(file);
+ event_file = event_file_file(file);
if (!event_file)
return EPOLLERR;
@@ -5816,7 +5816,7 @@ static int event_hist_open(struct inode *inode, struct file *file)
guard(mutex)(&event_mutex);
- event_file = event_file_data(file);
+ event_file = event_file_file(file);
if (!event_file) {
ret = -ENODEV;
goto err;
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 747/752] tracing: Wake up poll waiters for hist files when removing an event
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (281 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 746/752] tracing: Fix checking of freed trace_event_file for hist files Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 748/752] rust: list: Add unsafe blocks for container_of and safety comments Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 749/752] NTB: ntb_transport: Fix too small buffer for debugfs_name Sasha Levin
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Petr Pavlu, stable, Mathieu Desnoyers, Tom Zanussi,
Masami Hiramatsu (Google), Steven Rostedt (Google), Sasha Levin
From: Petr Pavlu <petr.pavlu@suse.com>
[ Upstream commit 9678e53179aa7e907360f5b5b275769008a69b80 ]
The event_hist_poll() function attempts to verify whether an event file is
being removed, but this check may not occur or could be unnecessarily
delayed. This happens because hist_poll_wakeup() is currently invoked only
from event_hist_trigger() when a hist command is triggered. If the event
file is being removed, no associated hist command will be triggered and a
waiter will be woken up only after an unrelated hist command is triggered.
Fix the issue by adding a call to hist_poll_wakeup() in
remove_event_file_dir() after setting the EVENT_FILE_FL_FREED flag. This
ensures that a task polling on a hist file is woken up and receives
EPOLLERR.
Cc: stable@vger.kernel.org
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Tom Zanussi <zanussi@kernel.org>
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Link: https://patch.msgid.link/20260219162737.314231-3-petr.pavlu@suse.com
Fixes: 1bd13edbbed6 ("tracing/hist: Add poll(POLLIN) support on hist file")
Signed-off-by: Petr Pavlu <petr.pavlu@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
include/linux/trace_events.h | 5 +++++
kernel/trace/trace_events.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/include/linux/trace_events.h b/include/linux/trace_events.h
index 04307a19cde30..64ada9cc38864 100644
--- a/include/linux/trace_events.h
+++ b/include/linux/trace_events.h
@@ -682,6 +682,11 @@ static inline void hist_poll_wakeup(void)
#define hist_poll_wait(file, wait) \
poll_wait(file, &hist_poll_wq, wait)
+
+#else
+static inline void hist_poll_wakeup(void)
+{
+}
#endif
#define __TRACE_EVENT_FLAGS(name, value) \
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 5cf55a9c6fad4..e4ce7f856f630 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1296,6 +1296,9 @@ static void remove_event_file_dir(struct trace_event_file *file)
free_event_filter(file->filter);
file->flags |= EVENT_FILE_FL_FREED;
event_file_put(file);
+
+ /* Wake up hist poll waiters to notice the EVENT_FILE_FL_FREED flag. */
+ hist_poll_wakeup();
}
/*
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 748/752] rust: list: Add unsafe blocks for container_of and safety comments
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (282 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 747/752] tracing: Wake up poll waiters for hist files when removing an event Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 749/752] NTB: ntb_transport: Fix too small buffer for debugfs_name Sasha Levin
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches
Cc: Philipp Stanner, stable, Alice Ryhl, Gary Guo, Miguel Ojeda,
Sasha Levin
From: Philipp Stanner <phasta@kernel.org>
[ Upstream commit 97b281d7edb2ae662365be2809cd728470119720 ]
impl_list_item_mod.rs calls container_of! without unsafe blocks at a
couple of places. Since container_of! is unsafe, the blocks are strictly
necessary.
The problem was so far not visible because the "unsafe-op-in-unsafe-fn"
check is a lint rather than a hard compiler error, and Rust suppresses
lints triggered inside of a macro from another crate.
Thus, the error becomes only visible once someone from within the kernel
crate tries to use linked lists:
error[E0133]: call to unsafe function `core::ptr::mut_ptr::<impl *mut T>::byte_sub`
is unsafe and requires unsafe block
--> rust/kernel/lib.rs:252:29
|
252 | let container_ptr = field_ptr.byte_sub(offset).cast::<$Container>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ call to unsafe function
|
::: rust/kernel/drm/jq.rs:98:1
|
98 | / impl_list_item! {
99 | | impl ListItem<0> for BasicItem { using ListLinks { self.links }; }
100 | | }
| |_- in this macro invocation
|
note: an unsafe function restricts its caller, but its body is safe by default
--> rust/kernel/list/impl_list_item_mod.rs:216:13
|
216 | unsafe fn view_value(me: *mut $crate::list::ListLinks<$num>) -> *const Self {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
::: rust/kernel/drm/jq.rs:98:1
|
98 | / impl_list_item! {
99 | | impl ListItem<0> for BasicItem { using ListLinks { self.links }; }
100 | | }
| |_- in this macro invocation
= note: requested on the command line with `-D unsafe-op-in-unsafe-fn`
= note: this error originates in the macro `$crate::container_of` which comes
from the expansion of the macro `impl_list_item`
Therefore, add unsafe blocks to container_of! calls to fix the issue.
[ As discussed, let's fix the build for those that want to use the
macro within the `kernel` crate now and we can discuss the proper
safety comments afterwards. Thus I removed the ones from the patch.
However, we cannot just avoid the comments with `CLIPPY=1`, so I
provided placeholders for now, like we did in the past. They were
also needed for an `unsafe impl`.
While I am not happy about it, it isn't worse than the current
status (the comments were meant to be there), and at least this
shows what is missing -- our pre-existing "good first issue" [1]
may motivate new contributors to complete them properly.
Finally, I moved one of the existing safety comments one line down
so that Clippy could locate it.
Link: https://github.com/Rust-for-Linux/linux/issues/351 [1]
- Miguel ]
Cc: stable@vger.kernel.org
Fixes: c77f85b347dd ("rust: list: remove OFFSET constants")
Suggested-by: Alice Ryhl <aliceryhl@google.com>
Signed-off-by: Philipp Stanner <phasta@kernel.org>
Reviewed-by: Gary Guo <gary@garyguo.net>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260216131613.45344-3-phasta@kernel.org
[ Fixed formatting. Reworded to fix the lint suppression
explanation. Indent build error. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
rust/kernel/list/impl_list_item_mod.rs | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/rust/kernel/list/impl_list_item_mod.rs b/rust/kernel/list/impl_list_item_mod.rs
index 202bc6f97c132..ee53d0387e63d 100644
--- a/rust/kernel/list/impl_list_item_mod.rs
+++ b/rust/kernel/list/impl_list_item_mod.rs
@@ -84,11 +84,12 @@ macro_rules! impl_has_list_links_self_ptr {
// right type.
unsafe impl$(<$($generics)*>)? $crate::list::HasSelfPtr<$item_type $(, $id)?> for $self {}
+ // SAFETY: TODO.
unsafe impl$(<$($generics)*>)? $crate::list::HasListLinks$(<$id>)? for $self {
#[inline]
unsafe fn raw_get_list_links(ptr: *mut Self) -> *mut $crate::list::ListLinks$(<$id>)? {
- // SAFETY: The caller promises that the pointer is not dangling.
let ptr: *mut $crate::list::ListLinksSelfPtr<$item_type $(, $id)?> =
+ // SAFETY: The caller promises that the pointer is not dangling.
unsafe { ::core::ptr::addr_of_mut!((*ptr)$(.$field)*) };
ptr.cast()
}
@@ -217,7 +218,7 @@ macro_rules! impl_list_item {
// SAFETY: `me` originates from the most recent call to `prepare_to_insert`, so it
// points at the field `$field` in a value of type `Self`. Thus, reversing that
// operation is still in-bounds of the allocation.
- $crate::container_of!(me, Self, $($field).*)
+ unsafe { $crate::container_of!(me, Self, $($field).*) }
}
// GUARANTEES:
@@ -242,7 +243,7 @@ macro_rules! impl_list_item {
// SAFETY: `me` originates from the most recent call to `prepare_to_insert`, so it
// points at the field `$field` in a value of type `Self`. Thus, reversing that
// operation is still in-bounds of the allocation.
- $crate::container_of!(me, Self, $($field).*)
+ unsafe { $crate::container_of!(me, Self, $($field).*) }
}
}
)*};
@@ -270,9 +271,12 @@ macro_rules! impl_list_item {
// SAFETY: The caller promises that `me` points at a valid value of type `Self`.
let links_field = unsafe { <Self as $crate::list::ListItem<$num>>::view_links(me) };
- let container = $crate::container_of!(
- links_field, $crate::list::ListLinksSelfPtr<Self, $num>, inner
- );
+ // SAFETY: TODO.
+ let container = unsafe {
+ $crate::container_of!(
+ links_field, $crate::list::ListLinksSelfPtr<Self, $num>, inner
+ )
+ };
// SAFETY: By the same reasoning above, `links_field` is a valid pointer.
let self_ptr = unsafe {
@@ -319,9 +323,12 @@ macro_rules! impl_list_item {
// `ListArc` containing `Self` until the next call to `post_remove`. The value cannot
// be destroyed while a `ListArc` reference exists.
unsafe fn view_value(links_field: *mut $crate::list::ListLinks<$num>) -> *const Self {
- let container = $crate::container_of!(
- links_field, $crate::list::ListLinksSelfPtr<Self, $num>, inner
- );
+ // SAFETY: TODO.
+ let container = unsafe {
+ $crate::container_of!(
+ links_field, $crate::list::ListLinksSelfPtr<Self, $num>, inner
+ )
+ };
// SAFETY: By the same reasoning above, `links_field` is a valid pointer.
let self_ptr = unsafe {
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
* [PATCH 6.18 749/752] NTB: ntb_transport: Fix too small buffer for debugfs_name
[not found] <20260228174750.1542406-1-sashal@kernel.org>
` (283 preceding siblings ...)
2026-02-28 17:47 ` [PATCH 6.18 748/752] rust: list: Add unsafe blocks for container_of and safety comments Sasha Levin
@ 2026-02-28 17:47 ` Sasha Levin
284 siblings, 0 replies; 285+ messages in thread
From: Sasha Levin @ 2026-02-28 17:47 UTC (permalink / raw)
To: patches; +Cc: Koichiro Den, stable, Frank Li, Dave Jiang, Jon Mason,
Sasha Levin
From: Koichiro Den <den@valinux.co.jp>
[ Upstream commit 6a4b50585d74fe45d3ade1e3e86ba8aae79761a5 ]
The buffer used for "qp%d" was only 4 bytes, which truncates names like
"qp10" to "qp1" and causes multiple queues to share the same directory.
Enlarge the buffer and use sizeof() to avoid truncation.
Fixes: fce8a7bb5b4b ("PCI-Express Non-Transparent Bridge Support")
Cc: <stable@vger.kernel.org> # v3.9+
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Koichiro Den <den@valinux.co.jp>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/ntb/ntb_transport.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
index 71d4bb25f7fdd..4d00263ebc934 100644
--- a/drivers/ntb/ntb_transport.c
+++ b/drivers/ntb/ntb_transport.c
@@ -1236,9 +1236,9 @@ static int ntb_transport_init_queue(struct ntb_transport_ctx *nt,
qp->tx_max_entry = tx_size / qp->tx_max_frame;
if (nt->debugfs_node_dir) {
- char debugfs_name[4];
+ char debugfs_name[8];
- snprintf(debugfs_name, 4, "qp%d", qp_num);
+ snprintf(debugfs_name, sizeof(debugfs_name), "qp%d", qp_num);
qp->debugfs_dir = debugfs_create_dir(debugfs_name,
nt->debugfs_node_dir);
--
2.51.0
^ permalink raw reply related [flat|nested] 285+ messages in thread
end of thread, other threads:[~2026-02-28 17:59 UTC | newest]
Thread overview: 285+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260228174750.1542406-1-sashal@kernel.org>
2026-02-28 17:42 ` [PATCH 6.18 455/752] rpmsg: core: fix race in driver_override_show() and use core helper Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 456/752] clk: renesas: rzg2l: Fix intin variable size Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 458/752] hfsplus: ensure sb->s_fs_info is always cleaned up Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 459/752] arm64: dts: ti: am62p-verdin: Fix SD regulator startup delay Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 460/752] drm/panthor: fix for dma-fence safe access rules Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 461/752] ASoC: SOF: ipc4-control: If there is no data do not send bytes update Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 462/752] ASoC: SOF: ipc4-topology: Correct the allocation size for bytes controls Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 463/752] ASoC: SOF: ipc4-control: Use the correct size for scontrol->ipc_control_data Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 464/752] ASoC: SOF: ipc4-control: Keep the payload size up to date Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 465/752] fpga: dfl: use subsys_initcall to allow built-in drivers to be added Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 466/752] drm/tests: shmem: Swap names of export tests Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 467/752] drm/tests: shmem: Add clean-up action to unpin pages Sasha Levin
2026-02-28 17:42 ` [PATCH 6.18 468/752] drm/tests: shmem: Hold reservation lock around vmap/vunmap Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 469/752] drm/tests: shmem: Hold reservation lock around madvise Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 470/752] drm/tests: shmem: Hold reservation lock around purge Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 471/752] drm/xe: Fix ggtt fb alignment Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 472/752] Revert "PCI: dw-rockchip: Don't wait for link since we can detect Link Up" Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 473/752] Revert "PCI: qcom: Don't wait for link if " Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 474/752] Revert "PCI: qcom: Enable MSI interrupts together with Link up if 'Global IRQ' is supported" Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 475/752] Revert "PCI: qcom: Enumerate endpoints based on Link up event in 'global_irq' interrupt" Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 476/752] Revert "PCI: dwc: Don't wait for link up if driver can detect Link Up event" Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 477/752] PCI: Use resource_set_range() that correctly sets ->end Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 478/752] phy: qcom: edp: Make the number of clocks flexible Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 479/752] arm64: dts: qcom: sdm630: Add missing MDSS reset Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 480/752] dm-verity: correctly handle dm_bufio_client_create() failure Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 481/752] media: uvcvideo: Fix support for V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 482/752] media: mediatek: encoder: Fix uninitialized scalar variable issue Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 483/752] media: mtk-mdp: Fix error handling in probe function Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 484/752] media: mtk-mdp: Fix a reference leak bug in mtk_mdp_remove() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 485/752] media: chips-media: wave5: Fix PM runtime usage count underflow Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 486/752] media: chips-media: wave5: Fix kthread worker destruction in polling mode Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 487/752] media: chips-media: wave5: Fix device cleanup order to prevent kernel panic Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 488/752] media: chips-media: wave5: Fix SError of kernel panic when closed Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 489/752] media: chips-media: wave5: Fix Null reference while testing fluster Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 490/752] media: verisilicon: AV1: Fix enable cdef computation Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 491/752] media: verisilicon: AV1: Fix tx mode bit setting Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 492/752] arm64: dts: qcom: x1e80100: Add missing TCSR ref clock to the DP PHYs Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 493/752] arm64: dts: qcom: sm8750: Fix BAM DMA probing Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 494/752] ARM: omap2: Fix reference count leaks in omap_control_init() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 495/752] arm64: kernel: initialize missing kexec_buf->random field Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 496/752] powerpc/pseries: Fix MSI-X allocation failure when quota is exceeded Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 497/752] KVM: x86: Return "unsupported" instead of "invalid" on access to unsupported PV MSR Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 498/752] KVM: nSVM: Remove a user-triggerable WARN on nested_svm_load_cr3() succeeding Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 499/752] arm64: Disable branch profiling for all arm64 code Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 500/752] pinctrl: meson: amlogic-a4: mark the GPIO controller as sleeping Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 501/752] HID: hid-pl: handle probe errors Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 502/752] HID: magicmouse: Do not crash on missing msc->input Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 503/752] HID: prodikeys: Check presence of pm->input_ep82 Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 504/752] HID: logitech-hidpp: Check maxfield in hidpp_get_report_length() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 505/752] fs: ensure that internal tmpfs mount gets mount id zero Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 506/752] arm64: dts: apple: t8112-j473: Keep the HDMI port powered on Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 507/752] media: amphion: Drop min_queued_buffers assignment Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 508/752] media: rockchip: rga: Fix possible ERR_PTR dereference in rga_buf_init() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 509/752] media: verisilicon: AV1: Set IDR flag for intra_only frame type Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 510/752] media: radio-keene: fix memory leak in error path Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 511/752] media: cx88: Add missing unmap in snd_cx88_hw_params() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 512/752] media: cx23885: Add missing unmap in snd_cx23885_hw_params() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 513/752] media: cx25821: Add missing unmap in snd_cx25821_hw_params() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 514/752] media: i2c/tw9903: Fix potential memory leak in tw9903_probe() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 515/752] media: i2c/tw9906: Fix potential memory leak in tw9906_probe() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 516/752] media: i2c: ov01a10: Fix the horizontal flip control Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 517/752] media: i2c: ov01a10: Fix reported pixel-rate value Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 518/752] media: i2c: ov01a10: Fix analogue gain range Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 519/752] media: i2c: ov01a10: Add missing v4l2_subdev_cleanup() calls Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 520/752] media: i2c: ov01a10: Fix passing stream instead of pad to v4l2_subdev_state_get_format() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 521/752] media: i2c: ov01a10: Fix test-pattern disabling Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 522/752] media: qcom: camss: vfe: Fix out-of-bounds access in vfe_isr_reg_update() Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 523/752] media: ccs: Avoid possible division by zero Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 524/752] media: i2c: ov5647: Initialize subdev before controls Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 525/752] media: i2c: ov5647: Correct pixel array offset Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 526/752] media: i2c: ov5647: Correct minimum VBLANK value Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 527/752] media: i2c: ov5647: Sensor should report RAW color space Sasha Levin
2026-02-28 17:43 ` [PATCH 6.18 528/752] media: i2c: ov5647: Fix PIXEL_RATE value for VGA mode Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 529/752] media: ccs: Fix setting initial sub-device state Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 530/752] media: i2c: ov5647: use our own mutex for the ctrl lock Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 531/752] media: dw9714: Fix powerup sequence Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 532/752] media: ipu6: Fix typo and wrong constant in ipu6-mmu.c Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 533/752] media: ipu6: Fix RPM reference leak in probe error paths Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 534/752] media: staging/ipu7: Ignore interrupts when device is suspended Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 535/752] media: staging/ipu7: Call synchronous RPM suspend in probe failure Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 536/752] media: staging/ipu7: Update CDPHY register settings Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 537/752] media: staging/ipu7: Fix the loop bound in l2 table alloc Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 538/752] platform/x86: ISST: Add missing write block check Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 539/752] platform/x86: ISST: Store and restore all domains data Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 540/752] dm-integrity: fix a typo in the code for write/discard race Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 541/752] dm: clear cloned request bio pointer when last clone bio completes Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 542/752] soc: ti: k3-socinfo: Fix regmap leak on probe failure Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 543/752] soc: ti: pruss: Fix double free in pruss_clk_mux_setup() Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 544/752] KVM: nSVM: Always use vmcb01 in VMLOAD/VMSAVE emulation Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 545/752] bus: omap-ocp2scp: fix OF populate on driver rebind Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 546/752] clk: clk-apple-nco: Add "apple,t8103-nco" compatible Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 547/752] soc: rockchip: grf: Fix wrong RK3576_IOCGRF_MISC_CON definition Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 548/752] soc: rockchip: grf: Support multiple grf to be handled Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 549/752] media: stm32: dcmipp: avoid naming clock if only one is needed Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 550/752] media: stm32: dcmipp: bytecap: clear all interrupts upon stream stop Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 551/752] media: stm32: dcmipp: byteproc: disable compose for all bayers Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 552/752] media: i2c: ov01a10: Fix digital gain range Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 553/752] arm64: dts: rockchip: Fix SD card support for RK3576 EVB1 Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 554/752] clk: tegra: tegra124-emc: Fix potential memory leak in tegra124_clk_register_emc() Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 555/752] s390/pci: Handle futile config accesses of disabled devices directly Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 556/752] mailbox: Prevent out-of-bounds access in fw_mbox_index_xlate() Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 557/752] drm/i915/psr: Don't enable Panel Replay on sink if globally disabled Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 558/752] reset: gpio: suppress bind attributes in sysfs Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 559/752] dm-integrity: fix recalculation in bitmap mode Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 560/752] dm-unstripe: fix mapping bug when there are multiple targets in a table Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 561/752] rtc: pcf8563: use correct of_node for output clock Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 562/752] drm/tyr: fix register name in error print Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 563/752] arm64: dts: rockchip: Do not enable hdmi_sound node on Pinebook Pro Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 564/752] media: venus: vdec: fix error state assignment for zero bytesused Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 565/752] media: venus: vdec: restrict EOS addr quirk to IRIS2 only Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 566/752] Revert "media: iris: Add sanity check for stop streaming" Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 567/752] media: iris: Fix ffmpeg corrupted frame error Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 568/752] media: iris: Fix fps calculation Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 569/752] media: iris: use fallback size when S_FMT is called without width/height Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 570/752] media: iris: Add buffer to list only after successful allocation Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 571/752] media: iris: Skip resolution set on first IPSC Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 572/752] media: iris: gen1: Destroy internal buffers after FW releases Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 573/752] media: iris: gen2: Add sanity check for session stop Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 574/752] media: iris: Prevent output buffer queuing before stream-on completes Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 575/752] drm: of: drm_of_panel_bridge_remove(): fix device_node leak Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 576/752] docs: kdoc: avoid error_count overflows Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 577/752] mm, page_alloc, thp: prevent reclaim for __GFP_THISNODE THP allocations Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 578/752] selftests/mm/charge_reserved_hugetlb: drop mount size for hugetlbfs Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 579/752] drm/buddy: Prevent BUG_ON by validating rounded allocation Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 581/752] phy: fsl-imx8mq-usb: set platform driver data Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 582/752] PCI: dwc: Skip waiting for L2/L3 Ready if dw_pcie_rp::skip_l23_wait is true Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 583/752] xfs: mark data structures corrupt on EIO and ENODATA Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 584/752] xfs: remove xfs_attr_leaf_hasname Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 585/752] media: verisilicon: AV1: Fix tile info buffer size Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 586/752] dm: fix excessive blk-crypto operations for invalid keys Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 587/752] media: uvcvideo: Return queued buffers on start_streaming() failure Sasha Levin
2026-02-28 17:44 ` [PATCH 6.18 588/752] iommu/vt-d: Flush dev-IOTLB only when PCIe device is accessible in scalable mode Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 589/752] iommu/vt-d: Flush piotlb for SVM and Nested domain Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 590/752] KVM: arm64: nv: Return correct RES0 bits for FGT registers Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 591/752] mfd: core: Add locking around 'mfd_of_node_list' Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 592/752] mfd: tps65219: Implement LOCK register handling for TPS65214 Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 593/752] mfd: macsmc: Initialize mutex Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 594/752] mfd: qcom-pm8xxx: Fix OF populate on driver rebind Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 595/752] mfd: omap-usb-host: " Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 598/752] arm64: dts: rockchip: Explicitly request UFS reset pin on RK3576 Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 599/752] PCI/PM: Prevent runtime suspend until devices are fully initialized Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 600/752] iio: accel: adxl380: Avoid reading more entries than present in FIFO Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 601/752] iommu/arm-smmu-v3: Add update_safe bits to fix STE update sequence Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 602/752] iommu/arm-smmu-v3: Mark STE MEV safe when computing the " Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 603/752] iommu/arm-smmu-v3: Mark EATS_TRANS " Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 604/752] iommu/arm-smmu-v3: Do not set disable_ats unless vSTE is Translate Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 605/752] usb: host: tegra: Remove manual wake IRQ disposal Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 606/752] xfs: delete attr leaf freemap entries when empty Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 607/752] xfs: fix freemap adjustments when adding xattrs to leaf blocks Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 608/752] xfs: fix the xattr scrub to detect freemap/entries array collisions Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 609/752] xfs: fix remote xattr valuelblk check Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 610/752] xfs: get rid of the xchk_xfile_*_descr calls Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 611/752] spmi: apple: Add "apple,t8103-spmi" compatible Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 612/752] rust/drm: Fix Registration::{new,new_foreign_owned}() docs Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 613/752] KVM: x86: Add SRCU protection for reading PDPTRs in __get_sregs2() Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 614/752] PCI: endpoint: Fix swapped parameters in pci_{primary/secondary}_epc_epf_unlink() functions Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 615/752] pinctrl: intel: Add code name documentation Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 616/752] xfs: only call xf{array,blob}_destroy if we have a valid pointer Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 617/752] xfs: check return value of xchk_scrub_create_subord Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 618/752] xfs: check for deleted cursors when revalidating two btrees Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 619/752] md/bitmap: fix GPF in write_page caused by resize race Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 620/752] NFSD: fix setting FMODE_NOCMTIME in nfs4_open_delegation Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 621/752] nfsd: fix return error code for nfsd_map_name_to_[ug]id Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 622/752] nvmem: Drop OF node reference on nvmem_add_one_cell() failure Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 623/752] PCI: Fix bridge window alignment with optional resources Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 624/752] ima: verify the previous kernel's IMA buffer lies in addressable RAM Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 625/752] of/kexec: refactor ima_get_kexec_buffer() to use ima_validate_range() Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 626/752] x86/kexec: add a sanity check on previous kernel's ima kexec buffer Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 627/752] mm/vmalloc: prevent RCU stalls in kasan_release_vmalloc_node Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 629/752] mm/slab: add rcu_barrier() to kvfree_rcu_barrier_on_cache() Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 630/752] io_uring/net: don't continue send bundle if poll was required for retry Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 631/752] bus: fsl-mc: fix an error handling in fsl_mc_device_add() Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 632/752] dm mpath: make pg_init_delay_msecs settable Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 633/752] arm64: poe: fix stale POR_EL0 values for ptrace Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 634/752] tools: Fix bitfield dependency failure Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 635/752] vhost: move vdpa group bound check to vhost_vdpa Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 636/752] powerpc/smp: Add check for kcalloc() failure in parse_thread_groups() Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 637/752] iio: gyro: itg3200: Fix unchecked return value in read_raw Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 638/752] mtd: spinand: Disable continuous read during probe Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 639/752] power: reset: tdx-ec-poweroff: fix restart Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 640/752] mm/highmem: fix __kmap_to_page() build error Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 641/752] compiler-clang.h: require LLVM 19.1.0 or higher for __typeof_unqual__ Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 642/752] rapidio: replace rio_free_net() with kfree() in rio_scan_alloc_net() Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 643/752] ocfs2: fix reflink preserve cleanup issue Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 644/752] kexec: derive purgatory entry from symbol Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 645/752] crash_dump: fix dm_crypt keys locking and ref leak Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 646/752] kho: skip memoryless NUMA nodes when reserving scratch areas Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 647/752] Revert "PCI/IOV: Add PCI rescan-remove locking when enabling/disabling SR-IOV" Sasha Levin
2026-02-28 17:45 ` [PATCH 6.18 648/752] PCI/IOV: Fix race between SR-IOV enable/disable and hotplug Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 649/752] arm64: Fix non-atomic __READ_ONCE() with CONFIG_LTO=y Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 650/752] uprobes: Fix incorrect lockdep condition in filter_chain() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 651/752] clk: rs9: Reserve 8 struct clk_hw slots for for 9FGV0841 Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 652/752] btrfs: fix periodic reclaim condition Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 653/752] btrfs: zoned: fixup last alloc pointer after extent removal for RAID1 Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 654/752] btrfs: zoned: fixup last alloc pointer after extent removal for DUP Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 655/752] btrfs: continue trimming remaining devices on failure Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 656/752] remoteproc: imx_rproc: Fix invalid loaded resource table detection Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 657/752] perf/arm-cmn: Reject unsupported hardware configurations Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 658/752] scsi: ufs: core: Flush exception handling work when RPM level is zero Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 659/752] mm/slab: avoid allocating slabobj_ext array from its own slab Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 660/752] mm/slab: use unsigned long for orig_size to ensure proper metadata align Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 661/752] MIPS: Loongson2ef: Register PCI controller in early stage Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 662/752] MIPS: Loongson2ef: Use pcibios_align_resource() to block io range Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 663/752] PCI: dwc: Fix msg_atu_index assignment Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 664/752] mux: mmio: fix regmap leak on probe failure Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 668/752] tipc: fix RCU dereference race in tipc_aead_users_dec() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 669/752] drm/amdkfd: Fix out-of-bounds write in kfd_event_page_set() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 670/752] drm/amdgpu: Protect GPU register accesses in powergated state in some paths Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 671/752] net: cpsw_new: Fix unnecessary netdev unregistration in cpsw_probe() error path Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 672/752] net: cpsw_new: Fix potential unregister of netdev that has not been registered yet Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 673/752] PCI: Don't claim disabled bridge windows Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 674/752] PCI: Fix pci_slot_trylock() error handling Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 675/752] parisc: kernel: replace kfree() with put_device() in create_tree_node() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 676/752] mptcp: pm: in-kernel: always set ID as avail when rm endp Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 677/752] staging: rtl8723bs: fix null dereference in find_network Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 678/752] kcsan, compiler_types: avoid duplicate type issues in BPF Type Format Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 679/752] watchdog/softlockup: fix sample ring index wrap in need_counting_irqs() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 680/752] i2c: imx-lpi2c: fix SMBus block read NACK after byte count Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 681/752] cifs: Fix locking usage for tcon fields Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 682/752] MIPS: rb532: Fix MMIO UART resource registration Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 683/752] ceph: supply snapshot context in ceph_zero_partial_object() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 684/752] drm/i915/quirks: Fix device id for QUIRK_EDP_LIMIT_RATE_HBR2 entry Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 685/752] rust: kbuild: pass `-Zunstable-options` for Rust 1.95.0 Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 686/752] mm/slab: do not access current->mems_allowed_seq if !allow_spin Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 687/752] LoongArch: Make cpumask_of_node() robust against NUMA_NO_NODE Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 688/752] LoongArch: Prefer top-down allocation after arch_mem_init() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 689/752] LoongArch: Use %px to print unmodified unwinding address Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 690/752] LoongArch: Guard percpu handler under !CONFIG_PREEMPT_RT Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 691/752] LoongArch: Disable instrumentation for setup_ptwalker() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 692/752] net: ethernet: marvell: skge: remove incorrect conflicting PCI ID Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 693/752] net: wan/fsl_ucc_hdlc: Fix dma_free_coherent() in uhdlc_memclean() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 694/752] octeontx2-af: CGX: fix bitmap leaks Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 695/752] net: ti: icssg-prueth: Add optional dependency on HSR Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 696/752] net: macb: Fix tx/rx malfunction after phy link down and up Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 697/752] tracing: Fix to set write permission to per-cpu buffer_size_kb Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 698/752] tracing: Reset last_boot_info if ring buffer is reset Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 699/752] ceph: do not propagate page array emplacement errors as batch errors Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 700/752] ceph: fix write storm on fscrypted files Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 701/752] io_uring/filetable: clamp alloc_hint to the configured alloc range Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 702/752] io_uring/openclose: fix io_pipe_fixed() slot tracking for specific slots Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 703/752] drm/amd/display: Increase DCN35 SR enter/exit latency Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 704/752] drm/amdgpu: fix sync handling in amdgpu_dma_buf_move_notify Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 705/752] mm/hugetlb: restore failed global reservations to subpool Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 706/752] mm/page_alloc: skip debug_check_no_{obj,locks}_freed with FPI_TRYLOCK Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 707/752] procfs: fix possible double mmput() in do_procmap_query() Sasha Levin
2026-02-28 17:46 ` [PATCH 6.18 708/752] mm/vmscan: fix demotion targets checks in reclaim/demotion Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 709/752] mm/page_alloc: clear page->private in free_pages_prepare() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 710/752] net: intel: fix PCI device ID conflict between i40e and ipw2200 Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 712/752] function_graph: Restore direct mode when callbacks drop to one Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 713/752] kbuild: Fix CC_CAN_LINK detection Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 714/752] kbuild: rpm-pkg: Restrict manual debug package creation Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 715/752] kernel: rpm-pkg: Restore find-debuginfo.sh approach to -debuginfo package Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 716/752] kbuild: rpm-pkg: Fix manual debuginfo generation when using .src.rpm Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 717/752] ipv6: ioam: fix heap buffer overflow in __ioam6_fill_trace_data() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 718/752] mm: numa_memblks: Identify the accurate NUMA ID of CFMW Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 719/752] fbdev: Use device_create_with_groups() to fix sysfs groups registration race Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 720/752] fbcon: check return value of con2fb_acquire_newinfo() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 721/752] fbdev: vt8500lcdfb: fix missing dma_free_coherent() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 722/752] fbdev: of: display_timing: fix refcount leak in of_get_display_timings() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 724/752] fbcon: Remove struct fbcon_display.inverse Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 725/752] io_uring/zcrx: fix sgtable leak on mapping failures Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 726/752] cifs: some missing initializations on replay Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 727/752] gpio: nomadik: Add missing IS_ERR() check Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 728/752] io_uring/cmd_net: fix too strict requirement on ioctl Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 729/752] ASoC: amd: yc: Add DMI quirk for ASUS Vivobook Pro 15X M6501RR Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 730/752] kbuild: rpm-pkg: Disable automatic requires for manual debuginfo package Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 731/752] drm/xe: Add bounds check on pat_index to prevent OOB kernel read in madvise Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 732/752] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 733/752] net/sched: act_skbedit: fix divide-by-zero in tcf_skbedit_hash() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 734/752] gpio: sysfs: fix chip removal with GPIOs exported over sysfs Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 735/752] x86/kexec: Copy ACPI root pointer address from config table Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 736/752] io_uring/zcrx: fix user_ref race between scrub and refill paths Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 737/752] rust: irq: add `'static` bounds to irq callbacks Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 738/752] rust: pin-init: replace clippy `expect` with `allow` Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 739/752] arm64: Force the use of CNTVCT_EL0 in __delay() Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 740/752] drm/amd/display: Correct logic check error for fastboot Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 741/752] drm/amdgpu: keep vga memory on MacBooks with switchable graphics Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 742/752] net: nfc: nci: Fix parameter validation for packet data Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 743/752] ring-buffer: Fix possible dereference of uninitialized pointer Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 744/752] tracing: ring-buffer: Fix to check event length before using Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 745/752] fgraph: Do not call handlers direct when not using ftrace_ops Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 746/752] tracing: Fix checking of freed trace_event_file for hist files Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 747/752] tracing: Wake up poll waiters for hist files when removing an event Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 748/752] rust: list: Add unsafe blocks for container_of and safety comments Sasha Levin
2026-02-28 17:47 ` [PATCH 6.18 749/752] NTB: ntb_transport: Fix too small buffer for debugfs_name Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox