Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
* [PATCH] drm: imx-dcss: Check return value of drm_mode_config_helper_suspend()
@ 2026-11-19 11:30 Denis Arefev
  2026-11-25  8:28 ` Laurentiu Palcu
  0 siblings, 1 reply; 2+ messages in thread
From: Denis Arefev @ 2026-11-19 11:30 UTC (permalink / raw)
  To: Laurentiu Palcu
  Cc: Lucas Stach, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Guido Günther,
	dri-devel, imx, linux-arm-kernel, linux-kernel, lvc-project,
	stable

dcss_dev_suspend() ignores the return value of 
drm_mode_config_helper_suspend(). On failure that helper rolls back its
partial work (re-enables fbdev and polling) and leaves
mode_config.suspend_state unset, i.e. the DRM side is not suspended.
Continuing to suspend the context loader and disable the clocks then
leaves the device in an inconsistent state.

Check the return value and propagate the error to the PM core, as the
other DRM drivers calling this helper do.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
Cc: stable@vger.kernel.org
Signed-off-by: Denis Arefev <arefev@swemel.ru>
---
 drivers/gpu/drm/imx/dcss/dcss-dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/dcss/dcss-dev.c b/drivers/gpu/drm/imx/dcss/dcss-dev.c
index 45a91e43bab1..0b12ce2498f0 100644
--- a/drivers/gpu/drm/imx/dcss/dcss-dev.c
+++ b/drivers/gpu/drm/imx/dcss/dcss-dev.c
@@ -253,7 +253,9 @@ static int dcss_dev_suspend(struct device *dev)
 	struct drm_device *ddev = dcss_drv_dev_to_drm(dev);
 	int ret;
 
-	drm_mode_config_helper_suspend(ddev);
+	ret = drm_mode_config_helper_suspend(ddev);
+	if (ret)
+		return ret;
 
 	if (pm_runtime_suspended(dev))
 		return 0;
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm: imx-dcss: Check return value of drm_mode_config_helper_suspend()
  2026-11-19 11:30 [PATCH] drm: imx-dcss: Check return value of drm_mode_config_helper_suspend() Denis Arefev
@ 2026-11-25  8:28 ` Laurentiu Palcu
  0 siblings, 0 replies; 2+ messages in thread
From: Laurentiu Palcu @ 2026-11-25  8:28 UTC (permalink / raw)
  To: Denis Arefev
  Cc: Lucas Stach, Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Guido Günther,
	dri-devel, imx, linux-arm-kernel, linux-kernel, lvc-project,
	stable

Hi Denis,

On Thu, Nov 19, 2026 at 02:30:29PM +0300, Denis Arefev wrote:
> dcss_dev_suspend() ignores the return value of 
> drm_mode_config_helper_suspend(). On failure that helper rolls back its
> partial work (re-enables fbdev and polling) and leaves
> mode_config.suspend_state unset, i.e. the DRM side is not suspended.
> Continuing to suspend the context loader and disable the clocks then
> leaves the device in an inconsistent state.
> 
> Check the return value and propagate the error to the PM core, as the
> other DRM drivers calling this helper do.
> 
> Found by Linux Verification Center (linuxtesting.org) with SVACE.
> 
> Fixes: 9021c317b770 ("drm/imx: Add initial support for DCSS on iMX8MQ")
> Cc: stable@vger.kernel.org
> Signed-off-by: Denis Arefev <arefev@swemel.ru>

Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>

-- 
Thanks,
Laurentiu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-25  8:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 11:30 [PATCH] drm: imx-dcss: Check return value of drm_mode_config_helper_suspend() Denis Arefev
2026-11-25  8:28 ` Laurentiu Palcu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox