From 10d0088bba47fb628fe533f85e9f618a77f0cb6e Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 Oct 2025 14:47:20 +0200 Subject: [PATCH] 5.4-stable patches added patches: cpufreq-intel_pstate-fix-object-lifecycle-issue-in-update_qos_request.patch crypto-atmel-fix-dma_unmap_sg-direction.patch iio-dac-ad5360-use-int-type-to-store-negative-error-codes.patch iio-dac-ad5421-use-int-type-to-store-negative-error-codes.patch iio-frequency-adf4350-fix-prescaler-usage.patch --- ...ifecycle-issue-in-update_qos_request.patch | 58 +++++++++++++++ ...pto-atmel-fix-dma_unmap_sg-direction.patch | 32 +++++++++ ...t-type-to-store-negative-error-codes.patch | 35 +++++++++ ...t-type-to-store-negative-error-codes.patch | 35 +++++++++ ...requency-adf4350-fix-prescaler-usage.patch | 72 +++++++++++++++++++ queue-5.4/series | 5 ++ 6 files changed, 237 insertions(+) create mode 100644 queue-5.4/cpufreq-intel_pstate-fix-object-lifecycle-issue-in-update_qos_request.patch create mode 100644 queue-5.4/crypto-atmel-fix-dma_unmap_sg-direction.patch create mode 100644 queue-5.4/iio-dac-ad5360-use-int-type-to-store-negative-error-codes.patch create mode 100644 queue-5.4/iio-dac-ad5421-use-int-type-to-store-negative-error-codes.patch create mode 100644 queue-5.4/iio-frequency-adf4350-fix-prescaler-usage.patch diff --git a/queue-5.4/cpufreq-intel_pstate-fix-object-lifecycle-issue-in-update_qos_request.patch b/queue-5.4/cpufreq-intel_pstate-fix-object-lifecycle-issue-in-update_qos_request.patch new file mode 100644 index 0000000000..b6e41a0cd6 --- /dev/null +++ b/queue-5.4/cpufreq-intel_pstate-fix-object-lifecycle-issue-in-update_qos_request.patch @@ -0,0 +1,58 @@ +From 69e5d50fcf4093fb3f9f41c4f931f12c2ca8c467 Mon Sep 17 00:00:00 2001 +From: "Rafael J. Wysocki" +Date: Fri, 5 Sep 2025 15:52:03 +0200 +Subject: cpufreq: intel_pstate: Fix object lifecycle issue in update_qos_request() + +From: Rafael J. Wysocki + +commit 69e5d50fcf4093fb3f9f41c4f931f12c2ca8c467 upstream. + +The cpufreq_cpu_put() call in update_qos_request() takes place too early +because the latter subsequently calls freq_qos_update_request() that +indirectly accesses the policy object in question through the QoS request +object passed to it. + +Fortunately, update_qos_request() is called under intel_pstate_driver_lock, +so this issue does not matter for changing the intel_pstate operation +mode, but it theoretically can cause a crash to occur on CPU device hot +removal (which currently can only happen in virt, but it is formally +supported nevertheless). + +Address this issue by modifying update_qos_request() to drop the +reference to the policy later. + +Fixes: da5c504c7aae ("cpufreq: intel_pstate: Implement QoS supported freq constraints") +Cc: 5.4+ # 5.4+ +Signed-off-by: Rafael J. Wysocki +Reviewed-by: Zihuan Zhang +Link: https://patch.msgid.link/2255671.irdbgypaU6@rafael.j.wysocki +Signed-off-by: Greg Kroah-Hartman +--- + drivers/cpufreq/intel_pstate.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +--- a/drivers/cpufreq/intel_pstate.c ++++ b/drivers/cpufreq/intel_pstate.c +@@ -1092,10 +1092,10 @@ static void update_qos_request(enum freq + continue; + + req = policy->driver_data; +- cpufreq_cpu_put(policy); +- +- if (!req) ++ if (!req) { ++ cpufreq_cpu_put(policy); + continue; ++ } + + if (hwp_active) + intel_pstate_get_hwp_max(i, &turbo_max, &max_state); +@@ -1114,6 +1114,8 @@ static void update_qos_request(enum freq + + if (freq_qos_update_request(req, freq) < 0) + pr_warn("Failed to update freq constraint: CPU%d\n", i); ++ ++ cpufreq_cpu_put(policy); + } + } + diff --git a/queue-5.4/crypto-atmel-fix-dma_unmap_sg-direction.patch b/queue-5.4/crypto-atmel-fix-dma_unmap_sg-direction.patch new file mode 100644 index 0000000000..3cbecc2a19 --- /dev/null +++ b/queue-5.4/crypto-atmel-fix-dma_unmap_sg-direction.patch @@ -0,0 +1,32 @@ +From f5d643156ef62216955c119216d2f3815bd51cb1 Mon Sep 17 00:00:00 2001 +From: Thomas Fourier +Date: Wed, 3 Sep 2025 10:34:46 +0200 +Subject: crypto: atmel - Fix dma_unmap_sg() direction + +From: Thomas Fourier + +commit f5d643156ef62216955c119216d2f3815bd51cb1 upstream. + +It seems like everywhere in this file, dd->in_sg is mapped with +DMA_TO_DEVICE and dd->out_sg is mapped with DMA_FROM_DEVICE. + +Fixes: 13802005d8f2 ("crypto: atmel - add Atmel DES/TDES driver") +Cc: +Signed-off-by: Thomas Fourier +Signed-off-by: Herbert Xu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/atmel-tdes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/crypto/atmel-tdes.c ++++ b/drivers/crypto/atmel-tdes.c +@@ -565,7 +565,7 @@ static int atmel_tdes_crypt_start(struct + + if (err && (dd->flags & TDES_FLAGS_FAST)) { + dma_unmap_sg(dd->dev, dd->in_sg, 1, DMA_TO_DEVICE); +- dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_TO_DEVICE); ++ dma_unmap_sg(dd->dev, dd->out_sg, 1, DMA_FROM_DEVICE); + } + + return err; diff --git a/queue-5.4/iio-dac-ad5360-use-int-type-to-store-negative-error-codes.patch b/queue-5.4/iio-dac-ad5360-use-int-type-to-store-negative-error-codes.patch new file mode 100644 index 0000000000..73b6ce659e --- /dev/null +++ b/queue-5.4/iio-dac-ad5360-use-int-type-to-store-negative-error-codes.patch @@ -0,0 +1,35 @@ +From f9381ece76de999a2065d5b4fdd87fa17883978c Mon Sep 17 00:00:00 2001 +From: Qianfeng Rong +Date: Mon, 1 Sep 2025 21:57:25 +0800 +Subject: iio: dac: ad5360: use int type to store negative error codes + +From: Qianfeng Rong + +commit f9381ece76de999a2065d5b4fdd87fa17883978c upstream. + +Change the 'ret' variable in ad5360_update_ctrl() from unsigned int to +int, as it needs to store either negative error codes or zero returned +by ad5360_write_unlocked(). + +Fixes: a3e2940c24d3 ("staging:iio:dac: Add AD5360 driver") +Signed-off-by: Qianfeng Rong +Reviewed-by: Andy Shevchenko +Link: https://patch.msgid.link/20250901135726.17601-2-rongqianfeng@vivo.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/dac/ad5360.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/dac/ad5360.c ++++ b/drivers/iio/dac/ad5360.c +@@ -259,7 +259,7 @@ static int ad5360_update_ctrl(struct iio + unsigned int clr) + { + struct ad5360_state *st = iio_priv(indio_dev); +- unsigned int ret; ++ int ret; + + mutex_lock(&indio_dev->mlock); + diff --git a/queue-5.4/iio-dac-ad5421-use-int-type-to-store-negative-error-codes.patch b/queue-5.4/iio-dac-ad5421-use-int-type-to-store-negative-error-codes.patch new file mode 100644 index 0000000000..f3072b07be --- /dev/null +++ b/queue-5.4/iio-dac-ad5421-use-int-type-to-store-negative-error-codes.patch @@ -0,0 +1,35 @@ +From 3379c900320954d768ed9903691fb2520926bbe3 Mon Sep 17 00:00:00 2001 +From: Qianfeng Rong +Date: Mon, 1 Sep 2025 21:57:26 +0800 +Subject: iio: dac: ad5421: use int type to store negative error codes + +From: Qianfeng Rong + +commit 3379c900320954d768ed9903691fb2520926bbe3 upstream. + +Change the 'ret' variable in ad5421_update_ctrl() from unsigned int to +int, as it needs to store either negative error codes or zero returned +by ad5421_write_unlocked(). + +Fixes: 5691b23489db ("staging:iio:dac: Add AD5421 driver") +Signed-off-by: Qianfeng Rong +Reviewed-by: Andy Shevchenko +Link: https://patch.msgid.link/20250901135726.17601-3-rongqianfeng@vivo.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/dac/ad5421.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/dac/ad5421.c ++++ b/drivers/iio/dac/ad5421.c +@@ -183,7 +183,7 @@ static int ad5421_update_ctrl(struct iio + unsigned int clr) + { + struct ad5421_state *st = iio_priv(indio_dev); +- unsigned int ret; ++ int ret; + + mutex_lock(&indio_dev->mlock); + diff --git a/queue-5.4/iio-frequency-adf4350-fix-prescaler-usage.patch b/queue-5.4/iio-frequency-adf4350-fix-prescaler-usage.patch new file mode 100644 index 0000000000..617964d1b5 --- /dev/null +++ b/queue-5.4/iio-frequency-adf4350-fix-prescaler-usage.patch @@ -0,0 +1,72 @@ +From 33d7ecbf69aa7dd4145e3b77962bcb8759eede3d Mon Sep 17 00:00:00 2001 +From: Michael Hennerich +Date: Fri, 29 Aug 2025 12:25:42 +0100 +Subject: iio: frequency: adf4350: Fix prescaler usage. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Michael Hennerich + +commit 33d7ecbf69aa7dd4145e3b77962bcb8759eede3d upstream. + +The ADF4350/1 features a programmable dual-modulus prescaler of 4/5 or 8/9. +When set to 4/5, the maximum RF frequency allowed is 3 GHz. +Therefore, when operating the ADF4351 above 3 GHz, this must be set to 8/9. +In this context not the RF output frequency is meant +- it's the VCO frequency. + +Therefore move the prescaler selection after we derived the VCO frequency +from the desired RF output frequency. + +This BUG may have caused PLL lock instabilities when operating the VCO at +the very high range close to 4.4 GHz. + +Fixes: e31166f0fd48 ("iio: frequency: New driver for Analog Devices ADF4350/ADF4351 Wideband Synthesizers") +Signed-off-by: Michael Hennerich +Signed-off-by: Nuno Sá +Reviewed-by: Andy Shevchenko +Link: https://patch.msgid.link/20250829-adf4350-fix-v2-1-0bf543ba797d@analog.com +Cc: +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/frequency/adf4350.c | 20 +++++++++++++------- + 1 file changed, 13 insertions(+), 7 deletions(-) + +--- a/drivers/iio/frequency/adf4350.c ++++ b/drivers/iio/frequency/adf4350.c +@@ -137,6 +137,19 @@ static int adf4350_set_freq(struct adf43 + if (freq > ADF4350_MAX_OUT_FREQ || freq < st->min_out_freq) + return -EINVAL; + ++ st->r4_rf_div_sel = 0; ++ ++ /* ++ * !\TODO: The below computation is making sure we get a power of 2 ++ * shift (st->r4_rf_div_sel) so that freq becomes higher or equal to ++ * ADF4350_MIN_VCO_FREQ. This might be simplified with fls()/fls_long() ++ * and friends. ++ */ ++ while (freq < ADF4350_MIN_VCO_FREQ) { ++ freq <<= 1; ++ st->r4_rf_div_sel++; ++ } ++ + if (freq > ADF4350_MAX_FREQ_45_PRESC) { + prescaler = ADF4350_REG1_PRESCALER; + mdiv = 75; +@@ -145,13 +158,6 @@ static int adf4350_set_freq(struct adf43 + mdiv = 23; + } + +- st->r4_rf_div_sel = 0; +- +- while (freq < ADF4350_MIN_VCO_FREQ) { +- freq <<= 1; +- st->r4_rf_div_sel++; +- } +- + /* + * Allow a predefined reference division factor + * if not set, compute our own diff --git a/queue-5.4/series b/queue-5.4/series index a38f27c0aa..3134973194 100644 --- a/queue-5.4/series +++ b/queue-5.4/series @@ -105,3 +105,8 @@ xen-manage-fix-suspend-error-path.patch firmware-meson_sm-fix-device-leak-at-probe.patch media-i2c-mt9v111-fix-incorrect-type-for-ret.patch drm-nouveau-fix-bad-ret-code-in-nouveau_bo_move_prep.patch +cpufreq-intel_pstate-fix-object-lifecycle-issue-in-update_qos_request.patch +crypto-atmel-fix-dma_unmap_sg-direction.patch +iio-dac-ad5360-use-int-type-to-store-negative-error-codes.patch +iio-dac-ad5421-use-int-type-to-store-negative-error-codes.patch +iio-frequency-adf4350-fix-prescaler-usage.patch -- 2.47.3