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>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1560755897-5002-1-git-send-email-yannick.fertre@st.com>
Date:   Mon, 17 Jun 2019 09:18:17 +0200
From:   Yannick Fertré <yannick.fertre@...com>
To:     Yannick Fertre <yannick.fertre@...com>,
        Philippe Cornu <philippe.cornu@...com>,
        Benjamin Gaignard <benjamin.gaignard@...com>,
        Vincent Abriou <vincent.abriou@...com>,
        David Airlie <airlied@...ux.ie>,
        Daniel Vetter <daniel@...ll.ch>,
        Maxime Coquelin <mcoquelin.stm32@...il.com>,
        Alexandre Torgue <alexandre.torgue@...com>,
        <dri-devel@...ts.freedesktop.org>,
        <linux-stm32@...md-mailman.stormreply.com>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH 1/3] drm/stm: drv: fix suspend/resume

Without this fix, the system can not go in "suspend" mode
due to an error in drv_suspend function.

Fixes: 35ab6cf ("drm/stm: support runtime power management")

Signed-off-by: Yannick Fertré <yannick.fertre@...com>
---
 drivers/gpu/drm/stm/drv.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/stm/drv.c b/drivers/gpu/drm/stm/drv.c
index 5659572..9dee4e4 100644
--- a/drivers/gpu/drm/stm/drv.c
+++ b/drivers/gpu/drm/stm/drv.c
@@ -136,8 +136,7 @@ static __maybe_unused int drv_suspend(struct device *dev)
 	struct ltdc_device *ldev = ddev->dev_private;
 	struct drm_atomic_state *state;
 
-	if (WARN_ON(!ldev->suspend_state))
-		return -ENOENT;
+	WARN_ON(ldev->suspend_state);
 
 	state = drm_atomic_helper_suspend(ddev);
 	if (IS_ERR(state))
@@ -155,15 +154,17 @@ static __maybe_unused int drv_resume(struct device *dev)
 	struct ltdc_device *ldev = ddev->dev_private;
 	int ret;
 
+	if (WARN_ON(!ldev->suspend_state))
+		return -ENOENT;
+
 	pm_runtime_force_resume(dev);
 	ret = drm_atomic_helper_resume(ddev, ldev->suspend_state);
-	if (ret) {
+	if (ret)
 		pm_runtime_force_suspend(dev);
-		ldev->suspend_state = NULL;
-		return ret;
-	}
 
-	return 0;
+	ldev->suspend_state = NULL;
+
+	return ret;
 }
 
 static __maybe_unused int drv_runtime_suspend(struct device *dev)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ