From 057eb0b2a4afb21afdbb66e93cc2df67fc840836 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 12 Aug 2024 14:24:51 +0200 Subject: [PATCH] 5.10-stable patches added patches: drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch drm-mgag200-set-ddc-timeout-in-milliseconds.patch --- ...y-handle-zero-sized-aux-transactions.patch | 58 +++++++++++ ...g200-set-ddc-timeout-in-milliseconds.patch | 41 ++++++++ ...v-properly-check-for-softirq-context.patch | 96 ------------------- queue-5.10/series | 3 +- 4 files changed, 101 insertions(+), 97 deletions(-) create mode 100644 queue-5.10/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch create mode 100644 queue-5.10/drm-mgag200-set-ddc-timeout-in-milliseconds.patch delete mode 100644 queue-5.10/kcov-properly-check-for-softirq-context.patch diff --git a/queue-5.10/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch b/queue-5.10/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch new file mode 100644 index 00000000000..7f918573440 --- /dev/null +++ b/queue-5.10/drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch @@ -0,0 +1,58 @@ +From e82290a2e0e8ec5e836ecad1ca025021b3855c2d Mon Sep 17 00:00:00 2001 +From: Lucas Stach +Date: Mon, 18 Mar 2024 21:39:23 +0100 +Subject: drm/bridge: analogix_dp: properly handle zero sized AUX transactions + +From: Lucas Stach + +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 +Reviewed-by: Robert Foss +Signed-off-by: Robert Foss +Link: https://patchwork.freedesktop.org/patch/msgid/20240318203925.2837689-1-l.stach@pengutronix.de +Signed-off-by: Greg Kroah-Hartman +--- + 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 +@@ -1115,7 +1115,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 */ +@@ -1167,7 +1166,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++; + } + } + +@@ -1215,7 +1213,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++; + } + } + +@@ -1232,7 +1229,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.10/drm-mgag200-set-ddc-timeout-in-milliseconds.patch b/queue-5.10/drm-mgag200-set-ddc-timeout-in-milliseconds.patch new file mode 100644 index 00000000000..29b33b89614 --- /dev/null +++ b/queue-5.10/drm-mgag200-set-ddc-timeout-in-milliseconds.patch @@ -0,0 +1,41 @@ +From ecde5db1598aecab54cc392282c15114f526f05f Mon Sep 17 00:00:00 2001 +From: Thomas Zimmermann +Date: Mon, 13 May 2024 14:51:06 +0200 +Subject: drm/mgag200: Set DDC timeout in milliseconds + +From: Thomas Zimmermann + +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 +Reviewed-by: Jocelyn Falempe +Fixes: 414c45310625 ("mgag200: initial g200se driver (v2)") +Cc: Dave Airlie +Cc: Maarten Lankhorst +Cc: Maxime Ripard +Cc: Thomas Zimmermann +Cc: Jocelyn Falempe +Cc: dri-devel@lists.freedesktop.org +Cc: # v3.5+ +Link: https://patchwork.freedesktop.org/patch/msgid/20240513125620.6337-2-tzimmermann@suse.de +Signed-off-by: Greg Kroah-Hartman +--- + 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.10/kcov-properly-check-for-softirq-context.patch b/queue-5.10/kcov-properly-check-for-softirq-context.patch deleted file mode 100644 index f07cf9d3b5f..00000000000 --- a/queue-5.10/kcov-properly-check-for-softirq-context.patch +++ /dev/null @@ -1,96 +0,0 @@ -From 7d4df2dad312f270d62fecb0e5c8b086c6d7dcfc Mon Sep 17 00:00:00 2001 -From: Andrey Konovalov -Date: Mon, 29 Jul 2024 04:21:58 +0200 -Subject: kcov: properly check for softirq context - -From: Andrey Konovalov - -commit 7d4df2dad312f270d62fecb0e5c8b086c6d7dcfc upstream. - -When collecting coverage from softirqs, KCOV uses in_serving_softirq() to -check whether the code is running in the softirq context. Unfortunately, -in_serving_softirq() is > 0 even when the code is running in the hardirq -or NMI context for hardirqs and NMIs that happened during a softirq. - -As a result, if a softirq handler contains a remote coverage collection -section and a hardirq with another remote coverage collection section -happens during handling the softirq, KCOV incorrectly detects a nested -softirq coverate collection section and prints a WARNING, as reported by -syzbot. - -This issue was exposed by commit a7f3813e589f ("usb: gadget: dummy_hcd: -Switch to hrtimer transfer scheduler"), which switched dummy_hcd to using -hrtimer and made the timer's callback be executed in the hardirq context. - -Change the related checks in KCOV to account for this behavior of -in_serving_softirq() and make KCOV ignore remote coverage collection -sections in the hardirq and NMI contexts. - -This prevents the WARNING printed by syzbot but does not fix the inability -of KCOV to collect coverage from the __usb_hcd_giveback_urb when dummy_hcd -is in use (caused by a7f3813e589f); a separate patch is required for that. - -Link: https://lkml.kernel.org/r/20240729022158.92059-1-andrey.konovalov@linux.dev -Fixes: 5ff3b30ab57d ("kcov: collect coverage from interrupts") -Signed-off-by: Andrey Konovalov -Reported-by: syzbot+2388cdaeb6b10f0c13ac@syzkaller.appspotmail.com -Closes: https://syzkaller.appspot.com/bug?extid=2388cdaeb6b10f0c13ac -Acked-by: Marco Elver -Cc: Alan Stern -Cc: Aleksandr Nogikh -Cc: Alexander Potapenko -Cc: Dmitry Vyukov -Cc: Greg Kroah-Hartman -Cc: Marcello Sylvester Bauer -Cc: -Signed-off-by: Andrew Morton -Signed-off-by: Greg Kroah-Hartman ---- - kernel/kcov.c | 15 ++++++++++++--- - 1 file changed, 12 insertions(+), 3 deletions(-) - ---- a/kernel/kcov.c -+++ b/kernel/kcov.c -@@ -151,6 +151,15 @@ static void kcov_remote_area_put(struct - list_add(&area->list, &kcov_remote_areas); - } - -+/* -+ * Unlike in_serving_softirq(), this function returns false when called during -+ * a hardirq or an NMI that happened in the softirq context. -+ */ -+static inline bool in_softirq_really(void) -+{ -+ return in_serving_softirq() && !in_hardirq() && !in_nmi(); -+} -+ - static notrace bool check_kcov_mode(enum kcov_mode needed_mode, struct task_struct *t) - { - unsigned int mode; -@@ -160,7 +169,7 @@ static notrace bool check_kcov_mode(enum - * so we ignore code executed in interrupts, unless we are in a remote - * coverage collection section in a softirq. - */ -- if (!in_task() && !(in_serving_softirq() && t->kcov_softirq)) -+ if (!in_task() && !(in_softirq_really() && t->kcov_softirq)) - return false; - mode = READ_ONCE(t->kcov_mode); - /* -@@ -822,7 +831,7 @@ void kcov_remote_start(u64 handle) - - if (WARN_ON(!kcov_check_handle(handle, true, true, true))) - return; -- if (!in_task() && !in_serving_softirq()) -+ if (!in_task() && !in_softirq_really()) - return; - - local_irq_save(flags); -@@ -963,7 +972,7 @@ void kcov_remote_stop(void) - int sequence; - unsigned long flags; - -- if (!in_task() && !in_serving_softirq()) -+ if (!in_task() && !in_softirq_really()) - return; - - local_irq_save(flags); diff --git a/queue-5.10/series b/queue-5.10/series index 36c83001bfc..e2b543b2bfd 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -327,7 +327,6 @@ scsi-mpt3sas-avoid-iommu-page-faults-on-report-zones.patch irqchip-meson-gpio-support-more-than-8-channels-gpio.patch irqchip-meson-gpio-convert-meson_gpio_irq_controller.patch serial-core-check-uartclk-for-zero-to-avoid-divide-by-zero.patch -kcov-properly-check-for-softirq-context.patch irqchip-xilinx-fix-shift-out-of-bounds.patch genirq-irqdesc-honor-caller-provided-affinity-in-alloc_desc.patch power-supply-axp288_charger-fix-constant_charge_voltage-writes.patch @@ -335,3 +334,5 @@ 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 +drm-bridge-analogix_dp-properly-handle-zero-sized-aux-transactions.patch +drm-mgag200-set-ddc-timeout-in-milliseconds.patch -- 2.47.3