From: Greg Kroah-Hartman Date: Tue, 18 Jun 2024 14:21:23 +0000 (+0200) Subject: 6.9-stable patches X-Git-Tag: v6.1.95~72 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d5973fc00936f466d8ff33c1d8ba78402f1270ec;p=thirdparty%2Fkernel%2Fstable-queue.git 6.9-stable patches added patches: dm-integrity-set-discard_granularity-to-logical-block-size.patch dmaengine-axi-dmac-fix-possible-race-in-remove.patch drm-bridge-aux-hpd-bridge-correct-devm_drm_dp_hpd_bridge_add-stub.patch drm-mst-fix-null-pointer-dereference-at-drm_dp_add_payload_part2.patch fs-proc-fix-softlockup-in-__read_vmcore.patch iio-adc-axi-adc-make-sure-axi-clock-is-enabled.patch iio-invensense-fix-interrupt-timestamp-alignment.patch iio-temperature-mcp9600-fix-temperature-reading-for-negative-values.patch kexec-fix-the-unexpected-kexec_dprintk-macro.patch knfsd-lookup-can-return-an-illegal-error-value.patch ocfs2-fix-races-between-hole-punching-and-aio-dio.patch ocfs2-update-inode-fsync-transaction-id-in-ocfs2_unlink-and-ocfs2_link.patch ocfs2-use-coarse-time-for-new-created-files.patch pci-rockchip-ep-remove-wrong-mask-on-subsys_vendor_id.patch remoteproc-k3-r5-do-not-allow-core1-to-power-up-before-core0-via-sysfs.patch remoteproc-k3-r5-wait-for-core0-power-up-before-powering-up-core1.patch --- diff --git a/queue-6.9/dm-integrity-set-discard_granularity-to-logical-block-size.patch b/queue-6.9/dm-integrity-set-discard_granularity-to-logical-block-size.patch new file mode 100644 index 00000000000..999616676b1 --- /dev/null +++ b/queue-6.9/dm-integrity-set-discard_granularity-to-logical-block-size.patch @@ -0,0 +1,39 @@ +From 69381cf88a8dfa0ab27fb801b78be813e7e8fb80 Mon Sep 17 00:00:00 2001 +From: Mikulas Patocka +Date: Mon, 20 May 2024 16:48:31 +0200 +Subject: dm-integrity: set discard_granularity to logical block size + +From: Mikulas Patocka + +commit 69381cf88a8dfa0ab27fb801b78be813e7e8fb80 upstream. + +dm-integrity could set discard_granularity lower than the logical block +size. This could result in failures when sending discard requests to +dm-integrity. + +This fix is needed for kernels prior to 6.10. + +Signed-off-by: Mikulas Patocka +Reported-by: Eric Wheeler +Cc: stable@vger.kernel.org # <= 6.9 +Signed-off-by: Mike Snitzer +Signed-off-by: Greg Kroah-Hartman +--- + drivers/md/dm-integrity.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/drivers/md/dm-integrity.c b/drivers/md/dm-integrity.c +index 7f3dc8ee6ab8..417fddebe367 100644 +--- a/drivers/md/dm-integrity.c ++++ b/drivers/md/dm-integrity.c +@@ -3492,6 +3492,7 @@ static void dm_integrity_io_hints(struct dm_target *ti, struct queue_limits *lim + limits->physical_block_size = ic->sectors_per_block << SECTOR_SHIFT; + blk_limits_io_min(limits, ic->sectors_per_block << SECTOR_SHIFT); + limits->dma_alignment = limits->logical_block_size - 1; ++ limits->discard_granularity = ic->sectors_per_block << SECTOR_SHIFT; + } + limits->max_integrity_segments = USHRT_MAX; + } +-- +2.45.2 + diff --git a/queue-6.9/dmaengine-axi-dmac-fix-possible-race-in-remove.patch b/queue-6.9/dmaengine-axi-dmac-fix-possible-race-in-remove.patch new file mode 100644 index 00000000000..64bb3de420f --- /dev/null +++ b/queue-6.9/dmaengine-axi-dmac-fix-possible-race-in-remove.patch @@ -0,0 +1,35 @@ +From 1bc31444209c8efae98cb78818131950d9a6f4d6 Mon Sep 17 00:00:00 2001 +From: Nuno Sa +Date: Thu, 28 Mar 2024 14:58:50 +0100 +Subject: dmaengine: axi-dmac: fix possible race in remove() + +From: Nuno Sa + +commit 1bc31444209c8efae98cb78818131950d9a6f4d6 upstream. + +We need to first free the IRQ before calling of_dma_controller_free(). +Otherwise we could get an interrupt and schedule a tasklet while +removing the DMA controller. + +Fixes: 0e3b67b348b8 ("dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller") +Cc: stable@kernel.org +Signed-off-by: Nuno Sa +Link: https://lore.kernel.org/r/20240328-axi-dmac-devm-probe-v3-1-523c0176df70@analog.com +Signed-off-by: Vinod Koul +Signed-off-by: Greg Kroah-Hartman +--- + drivers/dma/dma-axi-dmac.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/dma/dma-axi-dmac.c ++++ b/drivers/dma/dma-axi-dmac.c +@@ -1134,8 +1134,8 @@ static void axi_dmac_remove(struct platf + { + struct axi_dmac *dmac = platform_get_drvdata(pdev); + +- of_dma_controller_free(pdev->dev.of_node); + free_irq(dmac->irq, dmac); ++ of_dma_controller_free(pdev->dev.of_node); + tasklet_kill(&dmac->chan.vchan.task); + dma_async_device_unregister(&dmac->dma_dev); + clk_disable_unprepare(dmac->clk); diff --git a/queue-6.9/drm-bridge-aux-hpd-bridge-correct-devm_drm_dp_hpd_bridge_add-stub.patch b/queue-6.9/drm-bridge-aux-hpd-bridge-correct-devm_drm_dp_hpd_bridge_add-stub.patch new file mode 100644 index 00000000000..e1b3709e525 --- /dev/null +++ b/queue-6.9/drm-bridge-aux-hpd-bridge-correct-devm_drm_dp_hpd_bridge_add-stub.patch @@ -0,0 +1,39 @@ +From 51474ab44abf907023a8a875e799b07de461e466 Mon Sep 17 00:00:00 2001 +From: Dmitry Baryshkov +Date: Sat, 11 May 2024 11:54:30 +0300 +Subject: drm/bridge: aux-hpd-bridge: correct devm_drm_dp_hpd_bridge_add() stub + +From: Dmitry Baryshkov + +commit 51474ab44abf907023a8a875e799b07de461e466 upstream. + +If CONFIG_DRM_AUX_HPD_BRIDGE is not enabled, the aux-bridge.h header +provides a stub for the bridge's functions. Correct the arguments list +of one of those stubs to match the argument list of the non-stubbed +function. + +Fixes: e5ca263508f7 ("drm/bridge: aux-hpd: separate allocation and registration") +Reported-by: kernel test robot +Cc: stable +Closes: https://lore.kernel.org/oe-kbuild-all/202405110428.TMCfb1Ut-lkp@intel.com/ +Cc: Johan Hovold +Signed-off-by: Dmitry Baryshkov +Reviewed-by: Johan Hovold +Link: https://lore.kernel.org/r/20240511-fix-aux-hpd-stubs-v1-1-98dae71dfaec@linaro.org +Signed-off-by: Greg Kroah-Hartman +Signed-off-by: Greg Kroah-Hartman +--- + include/drm/bridge/aux-bridge.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/include/drm/bridge/aux-bridge.h ++++ b/include/drm/bridge/aux-bridge.h +@@ -33,7 +33,7 @@ static inline struct auxiliary_device *d + return NULL; + } + +-static inline int devm_drm_dp_hpd_bridge_add(struct auxiliary_device *adev) ++static inline int devm_drm_dp_hpd_bridge_add(struct device *dev, struct auxiliary_device *adev) + { + return 0; + } diff --git a/queue-6.9/drm-mst-fix-null-pointer-dereference-at-drm_dp_add_payload_part2.patch b/queue-6.9/drm-mst-fix-null-pointer-dereference-at-drm_dp_add_payload_part2.patch new file mode 100644 index 00000000000..8a91a34ea6b --- /dev/null +++ b/queue-6.9/drm-mst-fix-null-pointer-dereference-at-drm_dp_add_payload_part2.patch @@ -0,0 +1,114 @@ +From 5a507b7d2be15fddb95bf8dee01110b723e2bcd9 Mon Sep 17 00:00:00 2001 +From: Wayne Lin +Date: Thu, 7 Mar 2024 14:29:57 +0800 +Subject: drm/mst: Fix NULL pointer dereference at drm_dp_add_payload_part2 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Wayne Lin + +commit 5a507b7d2be15fddb95bf8dee01110b723e2bcd9 upstream. + +[Why] +Commit: +- commit 5aa1dfcdf0a4 ("drm/mst: Refactor the flow for payload allocation/removement") +accidently overwrite the commit +- commit 54d217406afe ("drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2") +which cause regression. + +[How] +Recover the original NULL fix and remove the unnecessary input parameter 'state' for +drm_dp_add_payload_part2(). + +Fixes: 5aa1dfcdf0a4 ("drm/mst: Refactor the flow for payload allocation/removement") +Reported-by: Leon Weiß +Link: https://lore.kernel.org/r/38c253ea42072cc825dc969ac4e6b9b600371cc8.camel@ruhr-uni-bochum.de/ +Cc: lyude@redhat.com +Cc: imre.deak@intel.com +Cc: stable@vger.kernel.org +Cc: regressions@lists.linux.dev +Reviewed-by: Harry Wentland +Acked-by: Jani Nikula +Signed-off-by: Wayne Lin +Signed-off-by: Alex Deucher +Link: https://patchwork.freedesktop.org/patch/msgid/20240307062957.2323620-1-Wayne.Lin@amd.com +(cherry picked from commit 4545614c1d8da603e57b60dd66224d81b6ffc305) +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- + drivers/gpu/drm/display/drm_dp_mst_topology.c | 4 +--- + drivers/gpu/drm/i915/display/intel_dp_mst.c | 2 +- + drivers/gpu/drm/nouveau/dispnv50/disp.c | 2 +- + include/drm/display/drm_dp_mst_helper.h | 1 - + 5 files changed, 4 insertions(+), 7 deletions(-) + +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +@@ -363,7 +363,7 @@ void dm_helpers_dp_mst_send_payload_allo + mst_state = to_drm_dp_mst_topology_state(mst_mgr->base.state); + new_payload = drm_atomic_get_mst_payload_state(mst_state, aconnector->mst_output_port); + +- ret = drm_dp_add_payload_part2(mst_mgr, mst_state->base.state, new_payload); ++ ret = drm_dp_add_payload_part2(mst_mgr, new_payload); + + if (ret) { + amdgpu_dm_set_mst_status(&aconnector->mst_status, +--- a/drivers/gpu/drm/display/drm_dp_mst_topology.c ++++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c +@@ -3421,7 +3421,6 @@ EXPORT_SYMBOL(drm_dp_remove_payload_part + /** + * drm_dp_add_payload_part2() - Execute payload update part 2 + * @mgr: Manager to use. +- * @state: The global atomic state + * @payload: The payload to update + * + * If @payload was successfully assigned a starting time slot by drm_dp_add_payload_part1(), this +@@ -3430,14 +3429,13 @@ EXPORT_SYMBOL(drm_dp_remove_payload_part + * Returns: 0 on success, negative error code on failure. + */ + int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, +- struct drm_atomic_state *state, + struct drm_dp_mst_atomic_payload *payload) + { + int ret = 0; + + /* Skip failed payloads */ + if (payload->payload_allocation_status != DRM_DP_MST_PAYLOAD_ALLOCATION_DFP) { +- drm_dbg_kms(state->dev, "Part 1 of payload creation for %s failed, skipping part 2\n", ++ drm_dbg_kms(mgr->dev, "Part 1 of payload creation for %s failed, skipping part 2\n", + payload->port->connector->name); + return -EIO; + } +--- a/drivers/gpu/drm/i915/display/intel_dp_mst.c ++++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c +@@ -1160,7 +1160,7 @@ static void intel_mst_enable_dp(struct i + if (first_mst_stream) + intel_ddi_wait_for_fec_status(encoder, pipe_config, true); + +- drm_dp_add_payload_part2(&intel_dp->mst_mgr, &state->base, ++ drm_dp_add_payload_part2(&intel_dp->mst_mgr, + drm_atomic_get_mst_payload_state(mst_state, connector->port)); + + if (DISPLAY_VER(dev_priv) >= 12) +--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c ++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c +@@ -915,7 +915,7 @@ nv50_msto_cleanup(struct drm_atomic_stat + msto->disabled = false; + drm_dp_remove_payload_part2(mgr, new_mst_state, old_payload, new_payload); + } else if (msto->enabled) { +- drm_dp_add_payload_part2(mgr, state, new_payload); ++ drm_dp_add_payload_part2(mgr, new_payload); + msto->enabled = false; + } + } +--- a/include/drm/display/drm_dp_mst_helper.h ++++ b/include/drm/display/drm_dp_mst_helper.h +@@ -851,7 +851,6 @@ int drm_dp_add_payload_part1(struct drm_ + struct drm_dp_mst_topology_state *mst_state, + struct drm_dp_mst_atomic_payload *payload); + int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr, +- struct drm_atomic_state *state, + struct drm_dp_mst_atomic_payload *payload); + void drm_dp_remove_payload_part1(struct drm_dp_mst_topology_mgr *mgr, + struct drm_dp_mst_topology_state *mst_state, diff --git a/queue-6.9/fs-proc-fix-softlockup-in-__read_vmcore.patch b/queue-6.9/fs-proc-fix-softlockup-in-__read_vmcore.patch new file mode 100644 index 00000000000..b4bfe48bfd6 --- /dev/null +++ b/queue-6.9/fs-proc-fix-softlockup-in-__read_vmcore.patch @@ -0,0 +1,42 @@ +From 5cbcb62dddf5346077feb82b7b0c9254222d3445 Mon Sep 17 00:00:00 2001 +From: Rik van Riel +Date: Tue, 7 May 2024 09:18:58 -0400 +Subject: fs/proc: fix softlockup in __read_vmcore + +From: Rik van Riel + +commit 5cbcb62dddf5346077feb82b7b0c9254222d3445 upstream. + +While taking a kernel core dump with makedumpfile on a larger system, +softlockup messages often appear. + +While softlockup warnings can be harmless, they can also interfere with +things like RCU freeing memory, which can be problematic when the kdump +kexec image is configured with as little memory as possible. + +Avoid the softlockup, and give things like work items and RCU a chance to +do their thing during __read_vmcore by adding a cond_resched. + +Link: https://lkml.kernel.org/r/20240507091858.36ff767f@imladris.surriel.com +Signed-off-by: Rik van Riel +Acked-by: Baoquan He +Cc: Dave Young +Cc: Vivek Goyal +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + fs/proc/vmcore.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/proc/vmcore.c ++++ b/fs/proc/vmcore.c +@@ -383,6 +383,8 @@ static ssize_t __read_vmcore(struct iov_ + /* leave now if filled buffer already */ + if (!iov_iter_count(iter)) + return acc; ++ ++ cond_resched(); + } + + list_for_each_entry(m, &vmcore_list, list) { diff --git a/queue-6.9/iio-adc-axi-adc-make-sure-axi-clock-is-enabled.patch b/queue-6.9/iio-adc-axi-adc-make-sure-axi-clock-is-enabled.patch new file mode 100644 index 00000000000..ba450707000 --- /dev/null +++ b/queue-6.9/iio-adc-axi-adc-make-sure-axi-clock-is-enabled.patch @@ -0,0 +1,47 @@ +From 80721776c5af6f6dce7d84ba8df063957aa425a2 Mon Sep 17 00:00:00 2001 +From: Nuno Sa +Date: Fri, 26 Apr 2024 17:42:13 +0200 +Subject: iio: adc: axi-adc: make sure AXI clock is enabled + +From: Nuno Sa + +commit 80721776c5af6f6dce7d84ba8df063957aa425a2 upstream. + +We can only access the IP core registers if the bus clock is enabled. As +such we need to get and enable it and not rely on anyone else to do it. + +Note this clock is a very fundamental one that is typically enabled +pretty early during boot. Independently of that, we should really rely on +it to be enabled. + +Fixes: ef04070692a2 ("iio: adc: adi-axi-adc: add support for AXI ADC IP core") +Signed-off-by: Nuno Sa +Link: https://lore.kernel.org/r/20240426-ad9467-new-features-v2-4-6361fc3ba1cc@analog.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/adc/adi-axi-adc.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/iio/adc/adi-axi-adc.c ++++ b/drivers/iio/adc/adi-axi-adc.c +@@ -175,6 +175,7 @@ static int adi_axi_adc_probe(struct plat + struct adi_axi_adc_state *st; + void __iomem *base; + unsigned int ver; ++ struct clk *clk; + int ret; + + st = devm_kzalloc(&pdev->dev, sizeof(*st), GFP_KERNEL); +@@ -195,6 +196,10 @@ static int adi_axi_adc_probe(struct plat + if (!expected_ver) + return -ENODEV; + ++ clk = devm_clk_get_enabled(&pdev->dev, NULL); ++ if (IS_ERR(clk)) ++ return PTR_ERR(clk); ++ + /* + * Force disable the core. Up to the frontend to enable us. And we can + * still read/write registers... diff --git a/queue-6.9/iio-invensense-fix-interrupt-timestamp-alignment.patch b/queue-6.9/iio-invensense-fix-interrupt-timestamp-alignment.patch new file mode 100644 index 00000000000..8dc1f212b55 --- /dev/null +++ b/queue-6.9/iio-invensense-fix-interrupt-timestamp-alignment.patch @@ -0,0 +1,50 @@ +From 0340dc4c82590d8735c58cf904a8aa1173273ab5 Mon Sep 17 00:00:00 2001 +From: Jean-Baptiste Maneyrol +Date: Fri, 26 Apr 2024 13:58:14 +0000 +Subject: iio: invensense: fix interrupt timestamp alignment + +From: Jean-Baptiste Maneyrol + +commit 0340dc4c82590d8735c58cf904a8aa1173273ab5 upstream. + +Restrict interrupt timestamp alignment for not overflowing max/min +period thresholds. + +Fixes: 0ecc363ccea7 ("iio: make invensense timestamp module generic") +Cc: stable@vger.kernel.org +Signed-off-by: Jean-Baptiste Maneyrol +Link: https://lore.kernel.org/r/20240426135814.141837-1-inv.git-commit@tdk.com +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/common/inv_sensors/inv_sensors_timestamp.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +--- a/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c ++++ b/drivers/iio/common/inv_sensors/inv_sensors_timestamp.c +@@ -105,6 +105,9 @@ static bool inv_update_chip_period(struc + + static void inv_align_timestamp_it(struct inv_sensors_timestamp *ts) + { ++ const int64_t period_min = ts->min_period * ts->mult; ++ const int64_t period_max = ts->max_period * ts->mult; ++ int64_t add_max, sub_max; + int64_t delta, jitter; + int64_t adjust; + +@@ -112,11 +115,13 @@ static void inv_align_timestamp_it(struc + delta = ts->it.lo - ts->timestamp; + + /* adjust timestamp while respecting jitter */ ++ add_max = period_max - (int64_t)ts->period; ++ sub_max = period_min - (int64_t)ts->period; + jitter = INV_SENSORS_TIMESTAMP_JITTER((int64_t)ts->period, ts->chip.jitter); + if (delta > jitter) +- adjust = jitter; ++ adjust = add_max; + else if (delta < -jitter) +- adjust = -jitter; ++ adjust = sub_max; + else + adjust = 0; + diff --git a/queue-6.9/iio-temperature-mcp9600-fix-temperature-reading-for-negative-values.patch b/queue-6.9/iio-temperature-mcp9600-fix-temperature-reading-for-negative-values.patch new file mode 100644 index 00000000000..69908b80b75 --- /dev/null +++ b/queue-6.9/iio-temperature-mcp9600-fix-temperature-reading-for-negative-values.patch @@ -0,0 +1,42 @@ +From 827dca3129708a8465bde90c86c2e3c38e62dd4f Mon Sep 17 00:00:00 2001 +From: Dimitri Fedrau +Date: Wed, 24 Apr 2024 20:59:10 +0200 +Subject: iio: temperature: mcp9600: Fix temperature reading for negative values + +From: Dimitri Fedrau + +commit 827dca3129708a8465bde90c86c2e3c38e62dd4f upstream. + +Temperature is stored as 16bit value in two's complement format. Current +implementation ignores the sign bit. Make it aware of the sign bit by +using sign_extend32. + +Fixes: 3f6b9598b6df ("iio: temperature: Add MCP9600 thermocouple EMF converter") +Signed-off-by: Dimitri Fedrau +Reviewed-by: Marcelo Schmitt +Tested-by: Andrew Hepp +Link: https://lore.kernel.org/r/20240424185913.1177127-1-dima.fedrau@gmail.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/temperature/mcp9600.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/drivers/iio/temperature/mcp9600.c b/drivers/iio/temperature/mcp9600.c +index 46845804292b..7a3eef5d5e75 100644 +--- a/drivers/iio/temperature/mcp9600.c ++++ b/drivers/iio/temperature/mcp9600.c +@@ -52,7 +52,8 @@ static int mcp9600_read(struct mcp9600_data *data, + + if (ret < 0) + return ret; +- *val = ret; ++ ++ *val = sign_extend32(ret, 15); + + return 0; + } +-- +2.45.2 + diff --git a/queue-6.9/kexec-fix-the-unexpected-kexec_dprintk-macro.patch b/queue-6.9/kexec-fix-the-unexpected-kexec_dprintk-macro.patch new file mode 100644 index 00000000000..4b41b72ee5e --- /dev/null +++ b/queue-6.9/kexec-fix-the-unexpected-kexec_dprintk-macro.patch @@ -0,0 +1,60 @@ +From f4af41bf177add167e39e4b0203460b1d0b531f6 Mon Sep 17 00:00:00 2001 +From: Baoquan He +Date: Tue, 9 Apr 2024 12:22:38 +0800 +Subject: kexec: fix the unexpected kexec_dprintk() macro + +From: Baoquan He + +commit f4af41bf177add167e39e4b0203460b1d0b531f6 upstream. + +Jiri reported that the current kexec_dprintk() always prints out debugging +message whenever kexec/kdmmp loading is triggered. That is not wanted. +The debugging message is supposed to be printed out when 'kexec -s -d' is +specified for kexec/kdump loading. + +After investigating, the reason is the current kexec_dprintk() takes +printk(KERN_INFO) or printk(KERN_DEBUG) depending on whether '-d' is +specified. However, distros usually have defaulg log level like below: + + [~]# cat /proc/sys/kernel/printk + 7 4 1 7 + +So, even though '-d' is not specified, printk(KERN_DEBUG) also always +prints out. I thought printk(KERN_DEBUG) is equal to pr_debug(), it's +not. + +Fix it by changing to use pr_info() instead which are expected to work. + +Link: https://lkml.kernel.org/r/20240409042238.1240462-1-bhe@redhat.com +Fixes: cbc2fe9d9cb2 ("kexec_file: add kexec_file flag to control debug printing") +Signed-off-by: Baoquan He +Reported-by: Jiri Slaby +Closes: https://lore.kernel.org/all/4c775fca-5def-4a2d-8437-7130b02722a2@kernel.org +Reviewed-by: Dave Young +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/kexec.h | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/include/linux/kexec.h b/include/linux/kexec.h +index 060835bb82d5..f31bd304df45 100644 +--- a/include/linux/kexec.h ++++ b/include/linux/kexec.h +@@ -461,10 +461,8 @@ static inline void arch_kexec_pre_free_pages(void *vaddr, unsigned int pages) { + + extern bool kexec_file_dbg_print; + +-#define kexec_dprintk(fmt, ...) \ +- printk("%s" fmt, \ +- kexec_file_dbg_print ? KERN_INFO : KERN_DEBUG, \ +- ##__VA_ARGS__) ++#define kexec_dprintk(fmt, arg...) \ ++ do { if (kexec_file_dbg_print) pr_info(fmt, ##arg); } while (0) + + #else /* !CONFIG_KEXEC_CORE */ + struct pt_regs; +-- +2.45.2 + diff --git a/queue-6.9/knfsd-lookup-can-return-an-illegal-error-value.patch b/queue-6.9/knfsd-lookup-can-return-an-illegal-error-value.patch new file mode 100644 index 00000000000..548128350d0 --- /dev/null +++ b/queue-6.9/knfsd-lookup-can-return-an-illegal-error-value.patch @@ -0,0 +1,47 @@ +From e221c45da3770962418fb30c27d941bbc70d595a Mon Sep 17 00:00:00 2001 +From: Trond Myklebust +Date: Mon, 6 May 2024 12:30:04 -0400 +Subject: knfsd: LOOKUP can return an illegal error value + +From: Trond Myklebust + +commit e221c45da3770962418fb30c27d941bbc70d595a upstream. + +The 'NFS error' NFSERR_OPNOTSUPP is not described by any of the official +NFS related RFCs, but appears to have snuck into some older .x files for +NFSv2. +Either way, it is not in RFC1094, RFC1813 or any of the NFSv4 RFCs, so +should not be returned by the knfsd server, and particularly not by the +"LOOKUP" operation. + +Instead, let's return NFSERR_STALE, which is more appropriate if the +filesystem encodes the filehandle as FILEID_INVALID. + +Cc: stable@vger.kernel.org +Signed-off-by: Trond Myklebust +Signed-off-by: Chuck Lever +Signed-off-by: Greg Kroah-Hartman +--- + fs/nfsd/nfsfh.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/fs/nfsd/nfsfh.c ++++ b/fs/nfsd/nfsfh.c +@@ -573,7 +573,7 @@ fh_compose(struct svc_fh *fhp, struct sv + _fh_update(fhp, exp, dentry); + if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) { + fh_put(fhp); +- return nfserr_opnotsupp; ++ return nfserr_stale; + } + + return 0; +@@ -599,7 +599,7 @@ fh_update(struct svc_fh *fhp) + + _fh_update(fhp, fhp->fh_export, dentry); + if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) +- return nfserr_opnotsupp; ++ return nfserr_stale; + return 0; + out_bad: + printk(KERN_ERR "fh_update: fh not verified!\n"); diff --git a/queue-6.9/ocfs2-fix-races-between-hole-punching-and-aio-dio.patch b/queue-6.9/ocfs2-fix-races-between-hole-punching-and-aio-dio.patch new file mode 100644 index 00000000000..f063c4a57f8 --- /dev/null +++ b/queue-6.9/ocfs2-fix-races-between-hole-punching-and-aio-dio.patch @@ -0,0 +1,91 @@ +From 952b023f06a24b2ad6ba67304c4c84d45bea2f18 Mon Sep 17 00:00:00 2001 +From: Su Yue +Date: Mon, 8 Apr 2024 16:20:39 +0800 +Subject: ocfs2: fix races between hole punching and AIO+DIO + +From: Su Yue + +commit 952b023f06a24b2ad6ba67304c4c84d45bea2f18 upstream. + +After commit "ocfs2: return real error code in ocfs2_dio_wr_get_block", +fstests/generic/300 become from always failed to sometimes failed: + +======================================================================== +[ 473.293420 ] run fstests generic/300 + +[ 475.296983 ] JBD2: Ignoring recovery information on journal +[ 475.302473 ] ocfs2: Mounting device (253,1) on (node local, slot 0) with ordered data mode. +[ 494.290998 ] OCFS2: ERROR (device dm-1): ocfs2_change_extent_flag: Owner 5668 has an extent at cpos 78723 which can no longer be found +[ 494.291609 ] On-disk corruption discovered. Please run fsck.ocfs2 once the filesystem is unmounted. +[ 494.292018 ] OCFS2: File system is now read-only. +[ 494.292224 ] (kworker/19:11,2628,19):ocfs2_mark_extent_written:5272 ERROR: status = -30 +[ 494.292602 ] (kworker/19:11,2628,19):ocfs2_dio_end_io_write:2374 ERROR: status = -3 +fio: io_u error on file /mnt/scratch/racer: Read-only file system: write offset=460849152, buflen=131072 +========================================================================= + +In __blockdev_direct_IO, ocfs2_dio_wr_get_block is called to add unwritten +extents to a list. extents are also inserted into extent tree in +ocfs2_write_begin_nolock. Then another thread call fallocate to puch a +hole at one of the unwritten extent. The extent at cpos was removed by +ocfs2_remove_extent(). At end io worker thread, ocfs2_search_extent_list +found there is no such extent at the cpos. + + T1 T2 T3 + inode lock + ... + insert extents + ... + inode unlock +ocfs2_fallocate + __ocfs2_change_file_space + inode lock + lock ip_alloc_sem + ocfs2_remove_inode_range inode + ocfs2_remove_btree_range + ocfs2_remove_extent + ^---remove the extent at cpos 78723 + ... + unlock ip_alloc_sem + inode unlock + ocfs2_dio_end_io + ocfs2_dio_end_io_write + lock ip_alloc_sem + ocfs2_mark_extent_written + ocfs2_change_extent_flag + ocfs2_search_extent_list + ^---failed to find extent + ... + unlock ip_alloc_sem + +In most filesystems, fallocate is not compatible with racing with AIO+DIO, +so fix it by adding to wait for all dio before fallocate/punch_hole like +ext4. + +Link: https://lkml.kernel.org/r/20240408082041.20925-3-glass.su@suse.com +Fixes: b25801038da5 ("ocfs2: Support xfs style space reservation ioctls") +Signed-off-by: Su Yue +Reviewed-by: Joseph Qi +Cc: Changwei Ge +Cc: Gang He +Cc: Joel Becker +Cc: Jun Piao +Cc: Junxiao Bi +Cc: Mark Fasheh +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + fs/ocfs2/file.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/ocfs2/file.c ++++ b/fs/ocfs2/file.c +@@ -1936,6 +1936,8 @@ static int __ocfs2_change_file_space(str + + inode_lock(inode); + ++ /* Wait all existing dio workers, newcomers will block on i_rwsem */ ++ inode_dio_wait(inode); + /* + * This prevents concurrent writes on other nodes + */ diff --git a/queue-6.9/ocfs2-update-inode-fsync-transaction-id-in-ocfs2_unlink-and-ocfs2_link.patch b/queue-6.9/ocfs2-update-inode-fsync-transaction-id-in-ocfs2_unlink-and-ocfs2_link.patch new file mode 100644 index 00000000000..c5b56edf570 --- /dev/null +++ b/queue-6.9/ocfs2-update-inode-fsync-transaction-id-in-ocfs2_unlink-and-ocfs2_link.patch @@ -0,0 +1,57 @@ +From 8c40984eeb8804cffcd28640f427f4fe829243fc Mon Sep 17 00:00:00 2001 +From: Su Yue +Date: Mon, 8 Apr 2024 16:20:40 +0800 +Subject: ocfs2: update inode fsync transaction id in ocfs2_unlink and ocfs2_link + +From: Su Yue + +commit 8c40984eeb8804cffcd28640f427f4fe829243fc upstream. + +transaction id should be updated in ocfs2_unlink and ocfs2_link. +Otherwise, inode link will be wrong after journal replay even fsync was +called before power failure: +======================================================================= +$ touch testdir/bar +$ ln testdir/bar testdir/bar_link +$ fsync testdir/bar +$ stat -c %h $SCRATCH_MNT/testdir/bar +1 +$ stat -c %h $SCRATCH_MNT/testdir/bar +1 +======================================================================= + +Link: https://lkml.kernel.org/r/20240408082041.20925-4-glass.su@suse.com +Fixes: ccd979bdbce9 ("[PATCH] OCFS2: The Second Oracle Cluster Filesystem") +Signed-off-by: Su Yue +Reviewed-by: Joseph Qi +Cc: Changwei Ge +Cc: Gang He +Cc: Joel Becker +Cc: Jun Piao +Cc: Junxiao Bi +Cc: Mark Fasheh +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + fs/ocfs2/namei.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/ocfs2/namei.c ++++ b/fs/ocfs2/namei.c +@@ -797,6 +797,7 @@ static int ocfs2_link(struct dentry *old + ocfs2_set_links_count(fe, inode->i_nlink); + fe->i_ctime = cpu_to_le64(inode_get_ctime_sec(inode)); + fe->i_ctime_nsec = cpu_to_le32(inode_get_ctime_nsec(inode)); ++ ocfs2_update_inode_fsync_trans(handle, inode, 0); + ocfs2_journal_dirty(handle, fe_bh); + + err = ocfs2_add_entry(handle, dentry, inode, +@@ -993,6 +994,7 @@ static int ocfs2_unlink(struct inode *di + drop_nlink(inode); + drop_nlink(inode); + ocfs2_set_links_count(fe, inode->i_nlink); ++ ocfs2_update_inode_fsync_trans(handle, inode, 0); + ocfs2_journal_dirty(handle, fe_bh); + + inode_set_mtime_to_ts(dir, inode_set_ctime_current(dir)); diff --git a/queue-6.9/ocfs2-use-coarse-time-for-new-created-files.patch b/queue-6.9/ocfs2-use-coarse-time-for-new-created-files.patch new file mode 100644 index 00000000000..4750c183220 --- /dev/null +++ b/queue-6.9/ocfs2-use-coarse-time-for-new-created-files.patch @@ -0,0 +1,87 @@ +From b8cb324277ee16f3eca3055b96fce4735a5a41c6 Mon Sep 17 00:00:00 2001 +From: Su Yue +Date: Mon, 8 Apr 2024 16:20:41 +0800 +Subject: ocfs2: use coarse time for new created files + +From: Su Yue + +commit b8cb324277ee16f3eca3055b96fce4735a5a41c6 upstream. + +The default atime related mount option is '-o realtime' which means file +atime should be updated if atime <= ctime or atime <= mtime. atime should +be updated in the following scenario, but it is not: +========================================================== +$ rm /mnt/testfile; +$ echo test > /mnt/testfile +$ stat -c "%X %Y %Z" /mnt/testfile +1711881646 1711881646 1711881646 +$ sleep 5 +$ cat /mnt/testfile > /dev/null +$ stat -c "%X %Y %Z" /mnt/testfile +1711881646 1711881646 1711881646 +========================================================== + +And the reason the atime in the test is not updated is that ocfs2 calls +ktime_get_real_ts64() in __ocfs2_mknod_locked during file creation. Then +inode_set_ctime_current() is called in inode_set_ctime_current() calls +ktime_get_coarse_real_ts64() to get current time. + +ktime_get_real_ts64() is more accurate than ktime_get_coarse_real_ts64(). +In my test box, I saw ctime set by ktime_get_coarse_real_ts64() is less +than ktime_get_real_ts64() even ctime is set later. The ctime of the new +inode is smaller than atime. + +The call trace is like: + +ocfs2_create + ocfs2_mknod + __ocfs2_mknod_locked + .... + + ktime_get_real_ts64 <------- set atime,ctime,mtime, more accurate + ocfs2_populate_inode + ... + ocfs2_init_acl + ocfs2_acl_set_mode + inode_set_ctime_current + current_time + ktime_get_coarse_real_ts64 <-------less accurate + +ocfs2_file_read_iter + ocfs2_inode_lock_atime + ocfs2_should_update_atime + atime <= ctime ? <-------- false, ctime < atime due to accuracy + +So here call ktime_get_coarse_real_ts64 to set inode time coarser while +creating new files. It may lower the accuracy of file times. But it's +not a big deal since we already use coarse time in other places like +ocfs2_update_inode_atime and inode_set_ctime_current. + +Link: https://lkml.kernel.org/r/20240408082041.20925-5-glass.su@suse.com +Fixes: c62c38f6b91b ("ocfs2: replace CURRENT_TIME macro") +Signed-off-by: Su Yue +Reviewed-by: Joseph Qi +Cc: Mark Fasheh +Cc: Joel Becker +Cc: Junxiao Bi +Cc: Changwei Ge +Cc: Gang He +Cc: Jun Piao +Cc: +Signed-off-by: Andrew Morton +Signed-off-by: Greg Kroah-Hartman +--- + fs/ocfs2/namei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/fs/ocfs2/namei.c ++++ b/fs/ocfs2/namei.c +@@ -566,7 +566,7 @@ static int __ocfs2_mknod_locked(struct i + fe->i_last_eb_blk = 0; + strcpy(fe->i_signature, OCFS2_INODE_SIGNATURE); + fe->i_flags |= cpu_to_le32(OCFS2_VALID_FL); +- ktime_get_real_ts64(&ts); ++ ktime_get_coarse_real_ts64(&ts); + fe->i_atime = fe->i_ctime = fe->i_mtime = + cpu_to_le64(ts.tv_sec); + fe->i_mtime_nsec = fe->i_ctime_nsec = fe->i_atime_nsec = diff --git a/queue-6.9/pci-rockchip-ep-remove-wrong-mask-on-subsys_vendor_id.patch b/queue-6.9/pci-rockchip-ep-remove-wrong-mask-on-subsys_vendor_id.patch new file mode 100644 index 00000000000..a777454ee64 --- /dev/null +++ b/queue-6.9/pci-rockchip-ep-remove-wrong-mask-on-subsys_vendor_id.patch @@ -0,0 +1,52 @@ +From 2dba285caba53f309d6060fca911b43d63f41697 Mon Sep 17 00:00:00 2001 +From: Rick Wertenbroek +Date: Wed, 3 Apr 2024 16:45:08 +0200 +Subject: PCI: rockchip-ep: Remove wrong mask on subsys_vendor_id +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Rick Wertenbroek + +commit 2dba285caba53f309d6060fca911b43d63f41697 upstream. + +Remove wrong mask on subsys_vendor_id. Both the Vendor ID and Subsystem +Vendor ID are u16 variables and are written to a u32 register of the +controller. The Subsystem Vendor ID was always 0 because the u16 value +was masked incorrectly with GENMASK(31,16) resulting in all lower 16 +bits being set to 0 prior to the shift. + +Remove both masks as they are unnecessary and set the register correctly +i.e., the lower 16-bits are the Vendor ID and the upper 16-bits are the +Subsystem Vendor ID. + +This is documented in the RK3399 TRM section 17.6.7.1.17 + +[kwilczynski: removed unnecesary newline] +Fixes: cf590b078391 ("PCI: rockchip: Add EP driver for Rockchip PCIe controller") +Link: https://lore.kernel.org/linux-pci/20240403144508.489835-1-rick.wertenbroek@gmail.com +Signed-off-by: Rick Wertenbroek +Signed-off-by: Krzysztof Wilczyński +Signed-off-by: Bjorn Helgaas +Reviewed-by: Damien Le Moal +Cc: stable@vger.kernel.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/pci/controller/pcie-rockchip-ep.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +--- a/drivers/pci/controller/pcie-rockchip-ep.c ++++ b/drivers/pci/controller/pcie-rockchip-ep.c +@@ -98,10 +98,8 @@ static int rockchip_pcie_ep_write_header + + /* All functions share the same vendor ID with function 0 */ + if (fn == 0) { +- u32 vid_regs = (hdr->vendorid & GENMASK(15, 0)) | +- (hdr->subsys_vendor_id & GENMASK(31, 16)) << 16; +- +- rockchip_pcie_write(rockchip, vid_regs, ++ rockchip_pcie_write(rockchip, ++ hdr->vendorid | hdr->subsys_vendor_id << 16, + PCIE_CORE_CONFIG_VENDOR); + } + diff --git a/queue-6.9/remoteproc-k3-r5-do-not-allow-core1-to-power-up-before-core0-via-sysfs.patch b/queue-6.9/remoteproc-k3-r5-do-not-allow-core1-to-power-up-before-core0-via-sysfs.patch new file mode 100644 index 00000000000..047117cc39f --- /dev/null +++ b/queue-6.9/remoteproc-k3-r5-do-not-allow-core1-to-power-up-before-core0-via-sysfs.patch @@ -0,0 +1,80 @@ +From 3c8a9066d584f5010b6f4ba03bf6b19d28973d52 Mon Sep 17 00:00:00 2001 +From: Beleswar Padhi +Date: Tue, 30 Apr 2024 16:23:07 +0530 +Subject: remoteproc: k3-r5: Do not allow core1 to power up before core0 via sysfs + +From: Beleswar Padhi + +commit 3c8a9066d584f5010b6f4ba03bf6b19d28973d52 upstream. + +PSC controller has a limitation that it can only power-up the second +core when the first core is in ON state. Power-state for core0 should be +equal to or higher than core1. + +Therefore, prevent core1 from powering up before core0 during the start +process from sysfs. Similarly, prevent core0 from shutting down before +core1 has been shut down from sysfs. + +Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem") +Signed-off-by: Beleswar Padhi +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240430105307.1190615-3-b-padhi@ti.com +Signed-off-by: Mathieu Poirier +Signed-off-by: Greg Kroah-Hartman +--- + drivers/remoteproc/ti_k3_r5_remoteproc.c | 23 +++++++++++++++++++++-- + 1 file changed, 21 insertions(+), 2 deletions(-) + +--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c ++++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c +@@ -548,7 +548,7 @@ static int k3_r5_rproc_start(struct rpro + struct k3_r5_rproc *kproc = rproc->priv; + struct k3_r5_cluster *cluster = kproc->cluster; + struct device *dev = kproc->dev; +- struct k3_r5_core *core; ++ struct k3_r5_core *core0, *core; + u32 boot_addr; + int ret; + +@@ -574,6 +574,15 @@ static int k3_r5_rproc_start(struct rpro + goto unroll_core_run; + } + } else { ++ /* do not allow core 1 to start before core 0 */ ++ core0 = list_first_entry(&cluster->cores, struct k3_r5_core, ++ elem); ++ if (core != core0 && core0->rproc->state == RPROC_OFFLINE) { ++ dev_err(dev, "%s: can not start core 1 before core 0\n", ++ __func__); ++ return -EPERM; ++ } ++ + ret = k3_r5_core_run(core); + if (ret) + goto put_mbox; +@@ -619,7 +628,8 @@ static int k3_r5_rproc_stop(struct rproc + { + struct k3_r5_rproc *kproc = rproc->priv; + struct k3_r5_cluster *cluster = kproc->cluster; +- struct k3_r5_core *core = kproc->core; ++ struct device *dev = kproc->dev; ++ struct k3_r5_core *core1, *core = kproc->core; + int ret; + + /* halt all applicable cores */ +@@ -632,6 +642,15 @@ static int k3_r5_rproc_stop(struct rproc + } + } + } else { ++ /* do not allow core 0 to stop before core 1 */ ++ core1 = list_last_entry(&cluster->cores, struct k3_r5_core, ++ elem); ++ if (core != core1 && core1->rproc->state != RPROC_OFFLINE) { ++ dev_err(dev, "%s: can not stop core 0 before core 1\n", ++ __func__); ++ return -EPERM; ++ } ++ + ret = k3_r5_core_halt(core); + if (ret) + goto out; diff --git a/queue-6.9/remoteproc-k3-r5-wait-for-core0-power-up-before-powering-up-core1.patch b/queue-6.9/remoteproc-k3-r5-wait-for-core0-power-up-before-powering-up-core1.patch new file mode 100644 index 00000000000..7676ce813bc --- /dev/null +++ b/queue-6.9/remoteproc-k3-r5-wait-for-core0-power-up-before-powering-up-core1.patch @@ -0,0 +1,121 @@ +From 61f6f68447aba08aeaa97593af3a7d85a114891f Mon Sep 17 00:00:00 2001 +From: Apurva Nandan +Date: Tue, 30 Apr 2024 16:23:06 +0530 +Subject: remoteproc: k3-r5: Wait for core0 power-up before powering up core1 + +From: Apurva Nandan + +commit 61f6f68447aba08aeaa97593af3a7d85a114891f upstream. + +PSC controller has a limitation that it can only power-up the second core +when the first core is in ON state. Power-state for core0 should be equal +to or higher than core1, else the kernel is seen hanging during rproc +loading. + +Make the powering up of cores sequential, by waiting for the current core +to power-up before proceeding to the next core, with a timeout of 2sec. +Add a wait queue event in k3_r5_cluster_rproc_init call, that will wait +for the current core to be released from reset before proceeding with the +next core. + +Fixes: 6dedbd1d5443 ("remoteproc: k3-r5: Add a remoteproc driver for R5F subsystem") +Signed-off-by: Apurva Nandan +Signed-off-by: Beleswar Padhi +Cc: stable@vger.kernel.org +Link: https://lore.kernel.org/r/20240430105307.1190615-2-b-padhi@ti.com +Signed-off-by: Mathieu Poirier +Signed-off-by: Greg Kroah-Hartman +--- + drivers/remoteproc/ti_k3_r5_remoteproc.c | 33 +++++++++++++++++++++++++++++++ + 1 file changed, 33 insertions(+) + +--- a/drivers/remoteproc/ti_k3_r5_remoteproc.c ++++ b/drivers/remoteproc/ti_k3_r5_remoteproc.c +@@ -103,12 +103,14 @@ struct k3_r5_soc_data { + * @dev: cached device pointer + * @mode: Mode to configure the Cluster - Split or LockStep + * @cores: list of R5 cores within the cluster ++ * @core_transition: wait queue to sync core state changes + * @soc_data: SoC-specific feature data for a R5FSS + */ + struct k3_r5_cluster { + struct device *dev; + enum cluster_mode mode; + struct list_head cores; ++ wait_queue_head_t core_transition; + const struct k3_r5_soc_data *soc_data; + }; + +@@ -128,6 +130,7 @@ struct k3_r5_cluster { + * @atcm_enable: flag to control ATCM enablement + * @btcm_enable: flag to control BTCM enablement + * @loczrama: flag to dictate which TCM is at device address 0x0 ++ * @released_from_reset: flag to signal when core is out of reset + */ + struct k3_r5_core { + struct list_head elem; +@@ -144,6 +147,7 @@ struct k3_r5_core { + u32 atcm_enable; + u32 btcm_enable; + u32 loczrama; ++ bool released_from_reset; + }; + + /** +@@ -460,6 +464,8 @@ static int k3_r5_rproc_prepare(struct rp + ret); + return ret; + } ++ core->released_from_reset = true; ++ wake_up_interruptible(&cluster->core_transition); + + /* + * Newer IP revisions like on J7200 SoCs support h/w auto-initialization +@@ -1140,6 +1146,12 @@ static int k3_r5_rproc_configure_mode(st + return ret; + } + ++ /* ++ * Skip the waiting mechanism for sequential power-on of cores if the ++ * core has already been booted by another entity. ++ */ ++ core->released_from_reset = c_state; ++ + ret = ti_sci_proc_get_status(core->tsp, &boot_vec, &cfg, &ctrl, + &stat); + if (ret < 0) { +@@ -1280,6 +1292,26 @@ init_rmem: + cluster->mode == CLUSTER_MODE_SINGLECPU || + cluster->mode == CLUSTER_MODE_SINGLECORE) + break; ++ ++ /* ++ * R5 cores require to be powered on sequentially, core0 ++ * should be in higher power state than core1 in a cluster ++ * So, wait for current core to power up before proceeding ++ * to next core and put timeout of 2sec for each core. ++ * ++ * This waiting mechanism is necessary because ++ * rproc_auto_boot_callback() for core1 can be called before ++ * core0 due to thread execution order. ++ */ ++ ret = wait_event_interruptible_timeout(cluster->core_transition, ++ core->released_from_reset, ++ msecs_to_jiffies(2000)); ++ if (ret <= 0) { ++ dev_err(dev, ++ "Timed out waiting for %s core to power up!\n", ++ rproc->name); ++ return ret; ++ } + } + + return 0; +@@ -1709,6 +1741,7 @@ static int k3_r5_probe(struct platform_d + cluster->dev = dev; + cluster->soc_data = data; + INIT_LIST_HEAD(&cluster->cores); ++ init_waitqueue_head(&cluster->core_transition); + + ret = of_property_read_u32(np, "ti,cluster-mode", &cluster->mode); + if (ret < 0 && ret != -EINVAL) { diff --git a/queue-6.9/series b/queue-6.9/series index ef4a316ac67..34676579244 100644 --- a/queue-6.9/series +++ b/queue-6.9/series @@ -241,3 +241,19 @@ dma-buf-handle-testing-kthreads-creation-failure.patch tracing-add-module_description-to-preemptirq_delay_test.patch vmci-prevent-speculation-leaks-by-sanitizing-event-in-event_deliver.patch spmi-hisi-spmi-controller-do-not-override-device-identifier.patch +knfsd-lookup-can-return-an-illegal-error-value.patch +fs-proc-fix-softlockup-in-__read_vmcore.patch +kexec-fix-the-unexpected-kexec_dprintk-macro.patch +ocfs2-update-inode-fsync-transaction-id-in-ocfs2_unlink-and-ocfs2_link.patch +ocfs2-use-coarse-time-for-new-created-files.patch +ocfs2-fix-races-between-hole-punching-and-aio-dio.patch +dm-integrity-set-discard_granularity-to-logical-block-size.patch +pci-rockchip-ep-remove-wrong-mask-on-subsys_vendor_id.patch +dmaengine-axi-dmac-fix-possible-race-in-remove.patch +drm-bridge-aux-hpd-bridge-correct-devm_drm_dp_hpd_bridge_add-stub.patch +remoteproc-k3-r5-wait-for-core0-power-up-before-powering-up-core1.patch +remoteproc-k3-r5-do-not-allow-core1-to-power-up-before-core0-via-sysfs.patch +iio-adc-axi-adc-make-sure-axi-clock-is-enabled.patch +iio-temperature-mcp9600-fix-temperature-reading-for-negative-values.patch +iio-invensense-fix-interrupt-timestamp-alignment.patch +drm-mst-fix-null-pointer-dereference-at-drm_dp_add_payload_part2.patch