lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250918-drm-misc-next-v1-1-7b2742b2ba8a@foss.st.com>
Date: Thu, 18 Sep 2025 16:33:18 +0200
From: Raphael Gallais-Pou <raphael.gallais-pou@...s.st.com>
To: Yannick Fertre <yannick.fertre@...s.st.com>,
        Philippe Cornu
	<philippe.cornu@...s.st.com>,
        Maarten Lankhorst
	<maarten.lankhorst@...ux.intel.com>,
        Maxime Ripard <mripard@...nel.org>,
        Thomas Zimmermann <tzimmermann@...e.de>,
        David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...s.st.com>
CC: <dri-devel@...ts.freedesktop.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: [PATCH] drm/stm: ltdc: switch to pm_runtime_resume_and_get

pm_runtime_get_sync() error code is not checked if it fails on clock
enable.  This can lead to an illegal access to the clock peripheral and
cause a system hang on MP1 or a SERC fired on MP2.  By using
pm_runtime_resume_and_get(), the PM counter isn't incremented if an
error occurs and we can return the error code.

Switch from pm_runtime_get_sync() to pm_runtime_resume_and_get() and
check returned error code.

Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@...s.st.com>
---
 drivers/gpu/drm/stm/ltdc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/stm/ltdc.c b/drivers/gpu/drm/stm/ltdc.c
index d1501e86a5b1c3fd5e8791a2143616a66850a62b..5ce3fd205fd7bbfd8735535c0ba4a660d68d02f9 100644
--- a/drivers/gpu/drm/stm/ltdc.c
+++ b/drivers/gpu/drm/stm/ltdc.c
@@ -779,7 +779,8 @@ static void ltdc_crtc_atomic_enable(struct drm_crtc *crtc,
 
 	drm_dbg_driver(crtc->dev, "\n");
 
-	pm_runtime_get_sync(ddev->dev);
+	if (pm_runtime_resume_and_get(ddev->dev))
+		return;
 
 	/* Sets the background color value */
 	regmap_write(ldev->regmap, LTDC_BCCR, BCCR_BCBLACK);
@@ -941,7 +942,7 @@ static void ltdc_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	}
 
 	if (!pm_runtime_active(ddev->dev)) {
-		ret = pm_runtime_get_sync(ddev->dev);
+		ret = pm_runtime_resume_and_get(ddev->dev);
 		if (ret) {
 			drm_err(crtc->dev, "Failed to set mode, cannot get sync\n");
 			return;

---
base-commit: 0bf37f45d5c472aebdf32da64775cac1110c085c
change-id: 20250918-drm-misc-next-225da9d83998

Best regards,
-- 
Raphael Gallais-Pou <raphael.gallais-pou@...s.st.com>


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ