]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.15-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2024 12:25:25 +0000 (14:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 12 Aug 2024 12:25:25 +0000 (14:25 +0200)
added patches:
drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch
drm-mgag200-set-ddc-timeout-in-milliseconds.patch
sched-smt-fix-unbalance-sched_smt_present-dec-inc.patch
sched-smt-introduce-sched_smt_present_inc-dec-helper.patch

queue-5.15/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch [new file with mode: 0644]
queue-5.15/drm-mgag200-set-ddc-timeout-in-milliseconds.patch [new file with mode: 0644]
queue-5.15/sched-smt-fix-unbalance-sched_smt_present-dec-inc.patch [new file with mode: 0644]
queue-5.15/sched-smt-introduce-sched_smt_present_inc-dec-helper.patch [new file with mode: 0644]
queue-5.15/series

diff --git a/queue-5.15/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch b/queue-5.15/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch
new file mode 100644 (file)
index 0000000..776a65f
--- /dev/null
@@ -0,0 +1,58 @@
+From e82290a2e0e8ec5e836ecad1ca025021b3855c2d Mon Sep 17 00:00:00 2001
+From: Lucas Stach <l.stach@pengutronix.de>
+Date: Mon, 18 Mar 2024 21:39:23 +0100
+Subject: drm/bridge: analogix_dp: properly handle zero sized AUX transactions
+
+From: Lucas Stach <l.stach@pengutronix.de>
+
+commit e82290a2e0e8ec5e836ecad1ca025021b3855c2d upstream.
+
+Address only transactions without any data are valid and should not
+be flagged as short transactions. Simply return the message size when
+no transaction errors occured.
+
+CC: stable@vger.kernel.org
+Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
+Reviewed-by: Robert Foss <rfoss@kernel.org>
+Signed-off-by: Robert Foss <rfoss@kernel.org>
+Link: https://patchwork.freedesktop.org/patch/msgid/20240318203925.2837689-1-l.stach@pengutronix.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c |    5 +----
+ 1 file changed, 1 insertion(+), 4 deletions(-)
+
+--- a/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
++++ b/drivers/gpu/drm/bridge/analogix/analogix_dp_reg.c
+@@ -1027,7 +1027,6 @@ ssize_t analogix_dp_transfer(struct anal
+       u32 status_reg;
+       u8 *buffer = msg->buffer;
+       unsigned int i;
+-      int num_transferred = 0;
+       int ret;
+       /* Buffer size of AUX CH is 16 bytes */
+@@ -1079,7 +1078,6 @@ ssize_t analogix_dp_transfer(struct anal
+                       reg = buffer[i];
+                       writel(reg, dp->reg_base + ANALOGIX_DP_BUF_DATA_0 +
+                              4 * i);
+-                      num_transferred++;
+               }
+       }
+@@ -1127,7 +1125,6 @@ ssize_t analogix_dp_transfer(struct anal
+                       reg = readl(dp->reg_base + ANALOGIX_DP_BUF_DATA_0 +
+                                   4 * i);
+                       buffer[i] = (unsigned char)reg;
+-                      num_transferred++;
+               }
+       }
+@@ -1144,7 +1141,7 @@ ssize_t analogix_dp_transfer(struct anal
+                (msg->request & ~DP_AUX_I2C_MOT) == DP_AUX_NATIVE_READ)
+               msg->reply = DP_AUX_NATIVE_REPLY_ACK;
+-      return num_transferred > 0 ? num_transferred : -EBUSY;
++      return msg->size;
+ aux_error:
+       /* if aux err happen, reset aux */
diff --git a/queue-5.15/drm-mgag200-set-ddc-timeout-in-milliseconds.patch b/queue-5.15/drm-mgag200-set-ddc-timeout-in-milliseconds.patch
new file mode 100644 (file)
index 0000000..29b33b8
--- /dev/null
@@ -0,0 +1,41 @@
+From ecde5db1598aecab54cc392282c15114f526f05f Mon Sep 17 00:00:00 2001
+From: Thomas Zimmermann <tzimmermann@suse.de>
+Date: Mon, 13 May 2024 14:51:06 +0200
+Subject: drm/mgag200: Set DDC timeout in milliseconds
+
+From: Thomas Zimmermann <tzimmermann@suse.de>
+
+commit ecde5db1598aecab54cc392282c15114f526f05f upstream.
+
+Compute the i2c timeout in jiffies from a value in milliseconds. The
+original values of 2 jiffies equals 2 milliseconds if HZ has been
+configured to a value of 1000. This corresponds to 2.2 milliseconds
+used by most other DRM drivers. Update mgag200 accordingly.
+
+Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
+Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
+Fixes: 414c45310625 ("mgag200: initial g200se driver (v2)")
+Cc: Dave Airlie <airlied@redhat.com>
+Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
+Cc: Maxime Ripard <mripard@kernel.org>
+Cc: Thomas Zimmermann <tzimmermann@suse.de>
+Cc: Jocelyn Falempe <jfalempe@redhat.com>
+Cc: dri-devel@lists.freedesktop.org
+Cc: <stable@vger.kernel.org> # v3.5+
+Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-2-tzimmermann@suse.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpu/drm/mgag200/mgag200_i2c.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/gpu/drm/mgag200/mgag200_i2c.c
++++ b/drivers/gpu/drm/mgag200/mgag200_i2c.c
+@@ -134,7 +134,7 @@ struct mga_i2c_chan *mgag200_i2c_create(
+       i2c->adapter.algo_data = &i2c->bit;
+       i2c->bit.udelay = 10;
+-      i2c->bit.timeout = 2;
++      i2c->bit.timeout = usecs_to_jiffies(2200);
+       i2c->bit.data = i2c;
+       i2c->bit.setsda         = mga_gpio_setsda;
+       i2c->bit.setscl         = mga_gpio_setscl;
diff --git a/queue-5.15/sched-smt-fix-unbalance-sched_smt_present-dec-inc.patch b/queue-5.15/sched-smt-fix-unbalance-sched_smt_present-dec-inc.patch
new file mode 100644 (file)
index 0000000..2d27f92
--- /dev/null
@@ -0,0 +1,52 @@
+From e22f910a26cc2a3ac9c66b8e935ef2a7dd881117 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Wed, 3 Jul 2024 11:16:08 +0800
+Subject: sched/smt: Fix unbalance sched_smt_present dec/inc
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit e22f910a26cc2a3ac9c66b8e935ef2a7dd881117 upstream.
+
+I got the following warn report while doing stress test:
+
+jump label: negative count!
+WARNING: CPU: 3 PID: 38 at kernel/jump_label.c:263 static_key_slow_try_dec+0x9d/0xb0
+Call Trace:
+ <TASK>
+ __static_key_slow_dec_cpuslocked+0x16/0x70
+ sched_cpu_deactivate+0x26e/0x2a0
+ cpuhp_invoke_callback+0x3ad/0x10d0
+ cpuhp_thread_fun+0x3f5/0x680
+ smpboot_thread_fn+0x56d/0x8d0
+ kthread+0x309/0x400
+ ret_from_fork+0x41/0x70
+ ret_from_fork_asm+0x1b/0x30
+ </TASK>
+
+Because when cpuset_cpu_inactive() fails in sched_cpu_deactivate(),
+the cpu offline failed, but sched_smt_present is decremented before
+calling sched_cpu_deactivate(), it leads to unbalanced dec/inc, so
+fix it by incrementing sched_smt_present in the error path.
+
+Fixes: c5511d03ec09 ("sched/smt: Make sched_smt_present track topology")
+Cc: stable@kernel.org
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Reviewed-by: Chen Yu <yu.c.chen@intel.com>
+Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com>
+Link: https://lore.kernel.org/r/20240703031610.587047-3-yangyingliang@huaweicloud.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/sched/core.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -9214,6 +9214,7 @@ int sched_cpu_deactivate(unsigned int cp
+       ret = cpuset_cpu_inactive(cpu);
+       if (ret) {
++              sched_smt_present_inc(cpu);
+               balance_push_set(cpu, false);
+               set_cpu_active(cpu, true);
+               return ret;
diff --git a/queue-5.15/sched-smt-introduce-sched_smt_present_inc-dec-helper.patch b/queue-5.15/sched-smt-introduce-sched_smt_present_inc-dec-helper.patch
new file mode 100644 (file)
index 0000000..1459614
--- /dev/null
@@ -0,0 +1,77 @@
+From 31b164e2e4af84d08d2498083676e7eeaa102493 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Wed, 3 Jul 2024 11:16:07 +0800
+Subject: sched/smt: Introduce sched_smt_present_inc/dec() helper
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 31b164e2e4af84d08d2498083676e7eeaa102493 upstream.
+
+Introduce sched_smt_present_inc/dec() helper, so it can be called
+in normal or error path simply. No functional changed.
+
+Cc: stable@kernel.org
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
+Link: https://lore.kernel.org/r/20240703031610.587047-2-yangyingliang@huaweicloud.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ kernel/sched/core.c |   26 +++++++++++++++++++-------
+ 1 file changed, 19 insertions(+), 7 deletions(-)
+
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -9101,6 +9101,22 @@ static int cpuset_cpu_inactive(unsigned
+       return 0;
+ }
++static inline void sched_smt_present_inc(int cpu)
++{
++#ifdef CONFIG_SCHED_SMT
++      if (cpumask_weight(cpu_smt_mask(cpu)) == 2)
++              static_branch_inc_cpuslocked(&sched_smt_present);
++#endif
++}
++
++static inline void sched_smt_present_dec(int cpu)
++{
++#ifdef CONFIG_SCHED_SMT
++      if (cpumask_weight(cpu_smt_mask(cpu)) == 2)
++              static_branch_dec_cpuslocked(&sched_smt_present);
++#endif
++}
++
+ int sched_cpu_activate(unsigned int cpu)
+ {
+       struct rq *rq = cpu_rq(cpu);
+@@ -9112,13 +9128,10 @@ int sched_cpu_activate(unsigned int cpu)
+        */
+       balance_push_set(cpu, false);
+-#ifdef CONFIG_SCHED_SMT
+       /*
+        * When going up, increment the number of cores with SMT present.
+        */
+-      if (cpumask_weight(cpu_smt_mask(cpu)) == 2)
+-              static_branch_inc_cpuslocked(&sched_smt_present);
+-#endif
++      sched_smt_present_inc(cpu);
+       set_cpu_active(cpu, true);
+       if (sched_smp_initialized) {
+@@ -9187,13 +9200,12 @@ int sched_cpu_deactivate(unsigned int cp
+       }
+       rq_unlock_irqrestore(rq, &rf);
+-#ifdef CONFIG_SCHED_SMT
+       /*
+        * When going down, decrement the number of cores with SMT present.
+        */
+-      if (cpumask_weight(cpu_smt_mask(cpu)) == 2)
+-              static_branch_dec_cpuslocked(&sched_smt_present);
++      sched_smt_present_dec(cpu);
++#ifdef CONFIG_SCHED_SMT
+       sched_core_cpu_deactivate(cpu);
+ #endif
index 7f8ba24e5d8315a86a2474ee422125ae5d04b71a..53d670998db8d4355870df899de34393284f4084 100644 (file)
@@ -468,3 +468,7 @@ power-supply-axp288_charger-round-constant_charge_voltage-writes-down.patch
 tracing-fix-overflow-in-get_free_elt.patch
 padata-fix-possible-divide-by-0-panic-in-padata_mt_helper.patch
 x86-mtrr-check-if-fixed-mtrrs-exist-before-saving-them.patch
+sched-smt-introduce-sched_smt_present_inc-dec-helper.patch
+sched-smt-fix-unbalance-sched_smt_present-dec-inc.patch
+drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch
+drm-mgag200-set-ddc-timeout-in-milliseconds.patch