From nobody Sun Feb 8 19:21:12 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1CFFA33B6F0; Sat, 7 Feb 2026 19:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770491664; cv=none; b=VjPQunkN4+G6fUmwddpP9C0x7aNsePkh5h2iUYj2GwIrmf9X13MMLy0eX4kDffUMxfbORs3tciXOExa4uprmHKyOBVB5gliv92+4P/1G2JoQVvWv8+G1YSoeVRwiotOp76+fIi1phU3yNS83AfmuNjMWHDudY8ukwaMMmfNQBr4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770491664; c=relaxed/simple; bh=TiYDGvrzsWr6bSZnAbY5TAGgZ/ddNnSDc0QvKT5qZ08=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=s+O/PJ5MYAg9xQXS2zg9+J7HvfYJUwybNRzMpmskxmaTI1DfJwTLNo2Fi/KQl76b23JQgLCaGayfDNWd2z3i2SduAp0zlmLn53AmJt0aKa2YiCo+FHK+l5XLPY91q4JiZ0l5XeSI86qilo/thEbntfmhFcmzFII+wA2yIAsZptM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=j07UJK2Q; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="j07UJK2Q" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id BB30F264FC; Sat, 7 Feb 2026 20:14:22 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Ei-tSKNkFk4u; Sat, 7 Feb 2026 20:14:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1770491661; bh=TiYDGvrzsWr6bSZnAbY5TAGgZ/ddNnSDc0QvKT5qZ08=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=j07UJK2QMNRcoEj2Ig2fZARE12zRxDWtJUNBpZOYt2DRHstjPgBry6RywjVEgW52j LnWe+l183tzEWtO/tci/XCVr4D+sLJDgvn2RjtyHlo2I5Bxr1ptsdo5beSpxhe3VMr 5GYQBjddpnVc+9ksIo9p+S59QTYLEN7FWB9vJaqHvWcZe7gxmZh8EaYPMOTGHSyKbO q04KBbMa+OPW4q0+mIf4qm8yg3JC9mk3aOXAEWy7hIXxLLN3HyLZJ6De64ix3DDVkn 2RwNiwPOLyC34T3jgtZP2mPo6h2j0oXPiXm/PjDvHDgQmGEAzNS2wLdr+251x3CGVK 2bEDboaMKLdNw== From: Kaustabh Chakraborty Date: Sun, 08 Feb 2026 00:43:58 +0530 Subject: [PATCH v2 1/2] drm/bridge: samsung-dsim: enable MFLUSH_VS for Exynos 7870 DSIM Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260208-exynos-dsim-fixes-v2-1-a857e8130a2a@disroot.org> References: <20260208-exynos-dsim-fixes-v2-0-a857e8130a2a@disroot.org> In-Reply-To: <20260208-exynos-dsim-fixes-v2-0-a857e8130a2a@disroot.org> To: Inki Dae , Jagan Teki , Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kaustabh Chakraborty , stable@vger.kernel.org Commit a36c533ad3e1 ("drm/bridge: samsung-dsim: Always flush display FIFO on vsync pulse") intends to enable FIFO flushing at v-sync pulse by not setting the active-low MFLUSH_VS bit. However, in Exynos 7870 DSIM, the MFLUSH_VS bit is active-high. There is no publicly available documentation to the best of my knowledge, but downstream kernel code [1] supports this claim. Enable the bit for Exynos 7870. Cc: stable@vger.kernel.org # v6.17 and later Link: https://github.com/samsungexynos7870/android_kernel_samsung_exynos787= 0/blob/a3762bb1761ae/drivers/video/fbdev/exynos/decon_7870/dsim_reg_7870.c#= L699 [1] Tested-by: Marek Szyprowski Signed-off-by: Kaustabh Chakraborty --- drivers/gpu/drm/bridge/samsung-dsim.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge= /samsung-dsim.c index 1d85e706c74b9..70f8946ad3b24 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -1089,6 +1089,13 @@ static int samsung_dsim_init_link(struct samsung_dsi= m *dsi) reg |=3D DSIM_HBP_DISABLE_MODE; if (dsi->mode_flags & MIPI_DSI_MODE_VIDEO_NO_HSA) reg |=3D DSIM_HSA_DISABLE_MODE; + + /* + * For some hardware types, DSIM_MFLUSH_VS bit needs to be + * enabled explicitly. + */ + if (dsi->plat_data->hw_type =3D=3D DSIM_TYPE_EXYNOS7870) + reg |=3D DSIM_MFLUSH_VS; } =20 if (dsi->mode_flags & MIPI_DSI_MODE_NO_EOT_PACKET) --=20 2.52.0 From nobody Sun Feb 8 19:21:12 2026 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8BE7433B6FD for ; Sat, 7 Feb 2026 19:14:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.21.23.139 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770491673; cv=none; b=lb6jZuAzUHC7PdvsGVxs88zxxLjk3QGnDgNpTcwve3zlz8QKvKcz3JUNJRigMQwTuom8pgdKgt8hBfcEmUGGm3UKsqZVnSxQWBujx7/jvDdia36qXTcrqrjqq7JY3Elf1wGr9FE+zGwoiVjN9L5UL4PnR3jzriUbCpDvT1uChGs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770491673; c=relaxed/simple; bh=Pw14T46YMvFwxGmDTs4+fN6NLezp7je2HTGomFtgE/k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=V1pA/kwSwYYSk5QYH9f6o/+cikgs7zt8yTUAvk5zzy87erzO6FAwc2YGkHVym25p6ALP6MJPcEGLxHkM9N5JkwL2+Sbbp6PJfmEisDAqU9NBr6kUegu+wnwpMEYOy7swLuF3sj80gp/2R2uRb3Zb1wV/3OlsWIjWsG6pUxcsYCs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b=KaBmOFSS; arc=none smtp.client-ip=178.21.23.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=disroot.org header.i=@disroot.org header.b="KaBmOFSS" Received: from [127.0.0.1] (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3D0B82640E; Sat, 7 Feb 2026 20:14:32 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id IiqnB6U-bqwI; Sat, 7 Feb 2026 20:14:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1770491671; bh=Pw14T46YMvFwxGmDTs4+fN6NLezp7je2HTGomFtgE/k=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=KaBmOFSS3pohHwo8NL9SvAs+l3g3N/2sJoFru1ZQIi/JZ0pgRyG/djTPHn8+OcpPE FW2ErdYn9YWSPEi38AnbBm2YuB5Cgo4vOaFCKo3HBhNIBTSPhwbgFzYpLDB9ZTZofK lJyoscYGXeo+sYyiUSrVTw1rTTaP2OwxKl4Xh1gQxajZS/yG+ebs0ifbcm2r59s0yy XSdisrZt/X65FOTBwRacNQBlsLCdDzd3J/FevSzIS29LTB2giyEb9WGmSWCo5j7mKu ISV/xhm5pjyIRHOrdNbXIyFtlLRS3OXZlZrw1LztEHdVE48LdzFNdiNJQAOe6+0kmA SgoGIISuOerTQ== From: Kaustabh Chakraborty Date: Sun, 08 Feb 2026 00:43:59 +0530 Subject: [PATCH v2 2/2] drm/bridge: samsung-dsim: use DSIM interrupt to wait for PLL stability Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260208-exynos-dsim-fixes-v2-2-a857e8130a2a@disroot.org> References: <20260208-exynos-dsim-fixes-v2-0-a857e8130a2a@disroot.org> In-Reply-To: <20260208-exynos-dsim-fixes-v2-0-a857e8130a2a@disroot.org> To: Inki Dae , Jagan Teki , Marek Szyprowski , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Kaustabh Chakraborty Stabilizing PLL needs to be waited for. This is done using a loop, checking the PLL_STABLE bit in the status register. DSIM fires an interrupt when the PLL is stabilized. Rely on this functionality for stabilization wait, getting rid of the implicit loop. This has been tested on a Galaxy J6 (Exynos 7870). Unfortunately, since testing on all supported devices is less feasible, introduce a stop-gap measure where the timeout has a gracious lower bound of 100 microseconds. This will (hopefully) prevent regressions due to timeout on other devices. Suggested-by: Inki Dae Link: https://lore.kernel.org/r/CAAQKjZMLMbwDVZRb5+Xb_5yz3AEP4uuzFJMuuZy9NF= Du13VU5w@mail.gmail.com Tested-by: Marek Szyprowski Signed-off-by: Kaustabh Chakraborty --- drivers/gpu/drm/bridge/samsung-dsim.c | 41 +++++++++++++++++++++++--------= ---- include/drm/bridge/samsung-dsim.h | 1 + 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/bridge/samsung-dsim.c b/drivers/gpu/drm/bridge= /samsung-dsim.c index 70f8946ad3b24..0ca6c6484c9a6 100644 --- a/drivers/gpu/drm/bridge/samsung-dsim.c +++ b/drivers/gpu/drm/bridge/samsung-dsim.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -788,7 +789,7 @@ static unsigned long samsung_dsim_set_pll(struct samsun= g_dsim *dsi, { const struct samsung_dsim_driver_data *driver_data =3D dsi->driver_data; unsigned long fin, fout; - int timeout; + unsigned int timeout; u8 p, s; u16 m; u32 reg; @@ -849,19 +850,26 @@ static unsigned long samsung_dsim_set_pll(struct sams= ung_dsim *dsi, if (dsi->swap_dn_dp_data) reg |=3D DSIM_PLL_DPDNSWAP_DAT; =20 + /* + * The PLL_TIMER value is the product of the timeout delay and the APB + * bus clock rate. Calcutate the timeout delay on-the-fly here. + * It is assumed that the bus clock is the first clock in the provided + * bulk clock data. + */ + timeout =3D 100; + fin =3D clk_get_rate(dsi->driver_data->clk_data[0].clk) / HZ_PER_MHZ; + if (fin) + timeout =3D max(dsi->driver_data->reg_values[PLL_TIMER] / fin, + timeout); + + reinit_completion(&dsi->pll_stabilized); samsung_dsim_write(dsi, DSIM_PLLCTRL_REG, reg); =20 - timeout =3D 3000; - do { - if (timeout-- =3D=3D 0) { - dev_err(dsi->dev, "PLL failed to stabilize\n"); - return 0; - } - if (driver_data->has_legacy_status_reg) - reg =3D samsung_dsim_read(dsi, DSIM_STATUS_REG); - else - reg =3D samsung_dsim_read(dsi, DSIM_LINK_STATUS_REG); - } while ((reg & BIT(driver_data->pll_stable_bit)) =3D=3D 0); + if (wait_for_completion_timeout(&dsi->pll_stabilized, + usecs_to_jiffies(timeout))) { + dev_err(dsi->dev, "PLL failed to stabilize\n"); + return 0; + } =20 dsi->hs_clock =3D fout; =20 @@ -1596,8 +1604,12 @@ static irqreturn_t samsung_dsim_irq(int irq, void *d= ev_id) return IRQ_HANDLED; } =20 - if (!(status & (DSIM_INT_RX_DONE | DSIM_INT_SFR_FIFO_EMPTY | - DSIM_INT_PLL_STABLE))) + if (status & DSIM_INT_PLL_STABLE) { + complete(&dsi->pll_stabilized); + return IRQ_HANDLED; + } + + if (!(status & (DSIM_INT_RX_DONE | DSIM_INT_SFR_FIFO_EMPTY))) return IRQ_HANDLED; =20 if (samsung_dsim_transfer_finish(dsi)) @@ -2146,6 +2158,7 @@ int samsung_dsim_probe(struct platform_device *pdev) return PTR_ERR(dsi); =20 init_completion(&dsi->completed); + init_completion(&dsi->pll_stabilized); spin_lock_init(&dsi->transfer_lock); INIT_LIST_HEAD(&dsi->transfer_list); =20 diff --git a/include/drm/bridge/samsung-dsim.h b/include/drm/bridge/samsung= -dsim.h index 03005e474704b..e3433da21ad08 100644 --- a/include/drm/bridge/samsung-dsim.h +++ b/include/drm/bridge/samsung-dsim.h @@ -123,6 +123,7 @@ struct samsung_dsim { int state; struct drm_property *brightness; struct completion completed; + struct completion pll_stabilized; =20 spinlock_t transfer_lock; /* protects transfer_list */ struct list_head transfer_list; --=20 2.52.0