From: Greg Kroah-Hartman Date: Tue, 18 Feb 2025 14:10:02 +0000 (+0100) Subject: 6.6-stable patches X-Git-Tag: v6.1.129~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=34ee054cc4a3dfdf0e64dcf40ddf8d05106bd3b4;p=thirdparty%2Fkernel%2Fstable-queue.git 6.6-stable patches added patches: drm-rcar-du-dsi-fix-phy-lock-bit-check.patch drm-tidss-clear-the-interrupt-status-for-interrupts-being-disabled.patch drm-tidss-fix-issue-in-irq-handling-causing-irq-flood-issue.patch drm-v3d-stop-active-perfmon-if-it-is-being-destroyed.patch --- diff --git a/queue-6.6/drm-rcar-du-dsi-fix-phy-lock-bit-check.patch b/queue-6.6/drm-rcar-du-dsi-fix-phy-lock-bit-check.patch new file mode 100644 index 0000000000..3a95410ff6 --- /dev/null +++ b/queue-6.6/drm-rcar-du-dsi-fix-phy-lock-bit-check.patch @@ -0,0 +1,51 @@ +From 6389e616fae8a101ce00068f7690461ab57b29d8 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen +Date: Tue, 17 Dec 2024 07:31:35 +0200 +Subject: drm/rcar-du: dsi: Fix PHY lock bit check + +From: Tomi Valkeinen + +commit 6389e616fae8a101ce00068f7690461ab57b29d8 upstream. + +The driver checks for bit 16 (using CLOCKSET1_LOCK define) in CLOCKSET1 +register when waiting for the PPI clock. However, the right bit to check +is bit 17 (CLOCKSET1_LOCK_PHY define). Not only that, but there's +nothing in the documents for bit 16 for V3U nor V4H. + +So, fix the check to use bit 17, and drop the define for bit 16. + +Fixes: 155358310f01 ("drm: rcar-du: Add R-Car DSI driver") +Fixes: 11696c5e8924 ("drm: Place Renesas drivers in a separate dir") +Cc: stable@vger.kernel.org +Signed-off-by: Tomi Valkeinen +Reviewed-by: Laurent Pinchart +Tested-by: Geert Uytterhoeven +Signed-off-by: Tomi Valkeinen +Link: https://patchwork.freedesktop.org/patch/msgid/20241217-rcar-gh-dsi-v5-1-e77421093c05@ideasonboard.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c | 2 +- + drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h | 1 - + 2 files changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c ++++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi.c +@@ -587,7 +587,7 @@ static int rcar_mipi_dsi_startup(struct + for (timeout = 10; timeout > 0; --timeout) { + if ((rcar_mipi_dsi_read(dsi, PPICLSR) & PPICLSR_STPST) && + (rcar_mipi_dsi_read(dsi, PPIDLSR) & PPIDLSR_STPST) && +- (rcar_mipi_dsi_read(dsi, CLOCKSET1) & CLOCKSET1_LOCK)) ++ (rcar_mipi_dsi_read(dsi, CLOCKSET1) & CLOCKSET1_LOCK_PHY)) + break; + + usleep_range(1000, 2000); +--- a/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h ++++ b/drivers/gpu/drm/renesas/rcar-du/rcar_mipi_dsi_regs.h +@@ -142,7 +142,6 @@ + + #define CLOCKSET1 0x101c + #define CLOCKSET1_LOCK_PHY (1 << 17) +-#define CLOCKSET1_LOCK (1 << 16) + #define CLOCKSET1_CLKSEL (1 << 8) + #define CLOCKSET1_CLKINSEL_EXTAL (0 << 2) + #define CLOCKSET1_CLKINSEL_DIG (1 << 2) diff --git a/queue-6.6/drm-tidss-clear-the-interrupt-status-for-interrupts-being-disabled.patch b/queue-6.6/drm-tidss-clear-the-interrupt-status-for-interrupts-being-disabled.patch new file mode 100644 index 0000000000..3ec94d50dc --- /dev/null +++ b/queue-6.6/drm-tidss-clear-the-interrupt-status-for-interrupts-being-disabled.patch @@ -0,0 +1,72 @@ +From 361a2ebb5cad211732ec3c5d962de49b21895590 Mon Sep 17 00:00:00 2001 +From: Devarsh Thakkar +Date: Mon, 21 Oct 2024 17:07:49 +0300 +Subject: drm/tidss: Clear the interrupt status for interrupts being disabled + +From: Devarsh Thakkar + +commit 361a2ebb5cad211732ec3c5d962de49b21895590 upstream. + +The driver does not touch the irqstatus register when it is disabling +interrupts. This might cause an interrupt to trigger for an interrupt +that was just disabled. + +To fix the issue, clear the irqstatus registers right after disabling +the interrupts. + +Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") +Cc: stable@vger.kernel.org +Reported-by: Jonathan Cormier +Closes: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1394222/am625-issue-about-tidss-rcu_preempt-self-detected-stall-on-cpu/5424479#5424479 +Signed-off-by: Devarsh Thakkar +[Tomi: mostly rewrote the patch] +Reviewed-by: Jonathan Cormier +Tested-by: Jonathan Cormier +Reviewed-by: Aradhya Bhatia +Signed-off-by: Tomi Valkeinen +Link: https://patchwork.freedesktop.org/patch/msgid/20241021-tidss-irq-fix-v1-5-82ddaec94e4a@ideasonboard.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/tidss/tidss_dispc.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +--- a/drivers/gpu/drm/tidss/tidss_dispc.c ++++ b/drivers/gpu/drm/tidss/tidss_dispc.c +@@ -646,7 +646,7 @@ void dispc_k2g_set_irqenable(struct disp + { + dispc_irq_t old_mask = dispc_k2g_read_irqenable(dispc); + +- /* clear the irqstatus for newly enabled irqs */ ++ /* clear the irqstatus for irqs that will be enabled */ + dispc_k2g_clear_irqstatus(dispc, (mask ^ old_mask) & mask); + + dispc_k2g_vp_set_irqenable(dispc, 0, mask); +@@ -654,6 +654,9 @@ void dispc_k2g_set_irqenable(struct disp + + dispc_write(dispc, DISPC_IRQENABLE_SET, (1 << 0) | (1 << 7)); + ++ /* clear the irqstatus for irqs that were disabled */ ++ dispc_k2g_clear_irqstatus(dispc, (mask ^ old_mask) & old_mask); ++ + /* flush posted write */ + dispc_k2g_read_irqenable(dispc); + } +@@ -785,7 +788,7 @@ static void dispc_k3_set_irqenable(struc + + old_mask = dispc_k3_read_irqenable(dispc); + +- /* clear the irqstatus for newly enabled irqs */ ++ /* clear the irqstatus for irqs that will be enabled */ + dispc_k3_clear_irqstatus(dispc, (old_mask ^ mask) & mask); + + for (i = 0; i < dispc->feat->num_vps; ++i) { +@@ -810,6 +813,9 @@ static void dispc_k3_set_irqenable(struc + if (main_disable) + dispc_write(dispc, DISPC_IRQENABLE_CLR, main_disable); + ++ /* clear the irqstatus for irqs that were disabled */ ++ dispc_k3_clear_irqstatus(dispc, (old_mask ^ mask) & old_mask); ++ + /* Flush posted writes */ + dispc_read(dispc, DISPC_IRQENABLE_SET); + } diff --git a/queue-6.6/drm-tidss-fix-issue-in-irq-handling-causing-irq-flood-issue.patch b/queue-6.6/drm-tidss-fix-issue-in-irq-handling-causing-irq-flood-issue.patch new file mode 100644 index 0000000000..18b4f56991 --- /dev/null +++ b/queue-6.6/drm-tidss-fix-issue-in-irq-handling-causing-irq-flood-issue.patch @@ -0,0 +1,83 @@ +From 44b6730ab53ef04944fbaf6da0e77397531517b7 Mon Sep 17 00:00:00 2001 +From: Tomi Valkeinen +Date: Mon, 21 Oct 2024 17:07:45 +0300 +Subject: drm/tidss: Fix issue in irq handling causing irq-flood issue + +From: Tomi Valkeinen + +commit 44b6730ab53ef04944fbaf6da0e77397531517b7 upstream. + +It has been observed that sometimes DSS will trigger an interrupt and +the top level interrupt (DISPC_IRQSTATUS) is not zero, but the VP and +VID level interrupt-statuses are zero. + +As the top level irqstatus is supposed to tell whether we have VP/VID +interrupts, the thinking of the driver authors was that this particular +case could never happen. Thus the driver only clears the DISPC_IRQSTATUS +bits which has corresponding interrupts in VP/VID status. So when this +issue happens, the driver will not clear DISPC_IRQSTATUS, and we get an +interrupt flood. + +It is unclear why the issue happens. It could be a race issue in the +driver, but no such race has been found. It could also be an issue with +the HW. However a similar case can be easily triggered by manually +writing to DISPC_IRQSTATUS_RAW. This will forcibly set a bit in the +DISPC_IRQSTATUS and trigger an interrupt, and as the driver never clears +the bit, we get an interrupt flood. + +To fix the issue, always clear DISPC_IRQSTATUS. The concern with this +solution is that if the top level irqstatus is the one that triggers the +interrupt, always clearing DISPC_IRQSTATUS might leave some interrupts +unhandled if VP/VID interrupt statuses have bits set. However, testing +shows that if any of the irqstatuses is set (i.e. even if +DISPC_IRQSTATUS == 0, but a VID irqstatus has a bit set), we will get an +interrupt. + +Co-developed-by: Bin Liu +Signed-off-by: Bin Liu +Co-developed-by: Devarsh Thakkar +Signed-off-by: Devarsh Thakkar +Co-developed-by: Jonathan Cormier +Signed-off-by: Jonathan Cormier +Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem") +Cc: stable@vger.kernel.org +Tested-by: Jonathan Cormier +Reviewed-by: Aradhya Bhatia +Signed-off-by: Tomi Valkeinen +Link: https://patchwork.freedesktop.org/patch/msgid/20241021-tidss-irq-fix-v1-1-82ddaec94e4a@ideasonboard.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/tidss/tidss_dispc.c | 12 ++++-------- + 1 file changed, 4 insertions(+), 8 deletions(-) + +--- a/drivers/gpu/drm/tidss/tidss_dispc.c ++++ b/drivers/gpu/drm/tidss/tidss_dispc.c +@@ -726,24 +726,20 @@ static + void dispc_k3_clear_irqstatus(struct dispc_device *dispc, dispc_irq_t clearmask) + { + unsigned int i; +- u32 top_clear = 0; + + for (i = 0; i < dispc->feat->num_vps; ++i) { +- if (clearmask & DSS_IRQ_VP_MASK(i)) { ++ if (clearmask & DSS_IRQ_VP_MASK(i)) + dispc_k3_vp_write_irqstatus(dispc, i, clearmask); +- top_clear |= BIT(i); +- } + } + for (i = 0; i < dispc->feat->num_planes; ++i) { +- if (clearmask & DSS_IRQ_PLANE_MASK(i)) { ++ if (clearmask & DSS_IRQ_PLANE_MASK(i)) + dispc_k3_vid_write_irqstatus(dispc, i, clearmask); +- top_clear |= BIT(4 + i); +- } + } + if (dispc->feat->subrev == DISPC_K2G) + return; + +- dispc_write(dispc, DISPC_IRQSTATUS, top_clear); ++ /* always clear the top level irqstatus */ ++ dispc_write(dispc, DISPC_IRQSTATUS, dispc_read(dispc, DISPC_IRQSTATUS)); + + /* Flush posted writes */ + dispc_read(dispc, DISPC_IRQSTATUS); diff --git a/queue-6.6/drm-v3d-stop-active-perfmon-if-it-is-being-destroyed.patch b/queue-6.6/drm-v3d-stop-active-perfmon-if-it-is-being-destroyed.patch new file mode 100644 index 0000000000..e5a9cf5e1e --- /dev/null +++ b/queue-6.6/drm-v3d-stop-active-perfmon-if-it-is-being-destroyed.patch @@ -0,0 +1,52 @@ +From 21f1435b1e6b012a07c42f36b206d2b66fc8f13b Mon Sep 17 00:00:00 2001 +From: Christian Gmeiner +Date: Mon, 18 Nov 2024 23:19:47 +0100 +Subject: drm/v3d: Stop active perfmon if it is being destroyed +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian Gmeiner + +commit 21f1435b1e6b012a07c42f36b206d2b66fc8f13b upstream. + +If the active performance monitor (`v3d->active_perfmon`) is being +destroyed, stop it first. Currently, the active perfmon is not +stopped during destruction, leaving the `v3d->active_perfmon` pointer +stale. This can lead to undefined behavior and instability. + +This patch ensures that the active perfmon is stopped before being +destroyed, aligning with the behavior introduced in commit +7d1fd3638ee3 ("drm/v3d: Stop the active perfmon before being destroyed"). + +Cc: stable@vger.kernel.org # v5.15+ +Fixes: 26a4dc29b74a ("drm/v3d: Expose performance counters to userspace") +Signed-off-by: Christian Gmeiner +Signed-off-by: Maíra Canal +Link: https://patchwork.freedesktop.org/patch/msgid/20241118221948.1758130-1-christian.gmeiner@gmail.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/v3d/v3d_perfmon.c | 5 +++++ + 1 file changed, 5 insertions(+) + +--- a/drivers/gpu/drm/v3d/v3d_perfmon.c ++++ b/drivers/gpu/drm/v3d/v3d_perfmon.c +@@ -179,6 +179,7 @@ int v3d_perfmon_destroy_ioctl(struct drm + { + struct v3d_file_priv *v3d_priv = file_priv->driver_priv; + struct drm_v3d_perfmon_destroy *req = data; ++ struct v3d_dev *v3d = v3d_priv->v3d; + struct v3d_perfmon *perfmon; + + mutex_lock(&v3d_priv->perfmon.lock); +@@ -188,6 +189,10 @@ int v3d_perfmon_destroy_ioctl(struct drm + if (!perfmon) + return -EINVAL; + ++ /* If the active perfmon is being destroyed, stop it first */ ++ if (perfmon == v3d->active_perfmon) ++ v3d_perfmon_stop(v3d, perfmon, false); ++ + v3d_perfmon_put(perfmon); + + return 0; diff --git a/queue-6.6/series b/queue-6.6/series index 15f01eb709..abbbce623a 100644 --- a/queue-6.6/series +++ b/queue-6.6/series @@ -126,3 +126,7 @@ openvswitch-use-rcu-protection-in-ovs_vport_cmd_fill.patch ndisc-extend-rcu-protection-in-ndisc_send_skb.patch ipv6-mcast-extend-rcu-protection-in-igmp6_send.patch ipv6-mcast-add-rcu-protection-to-mld_newpack.patch +drm-tidss-fix-issue-in-irq-handling-causing-irq-flood-issue.patch +drm-tidss-clear-the-interrupt-status-for-interrupts-being-disabled.patch +drm-rcar-du-dsi-fix-phy-lock-bit-check.patch +drm-v3d-stop-active-perfmon-if-it-is-being-destroyed.patch