Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1450885 > unrolled thread

[PATCH 3/6] drm/vc4: Fix handling of a pm_runtime_get_sync() success case.

Started byEric Anholt <eric@anholt.net>
First post2016-07-26 22:50 +0200
Last post2016-07-26 22:50 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/6] drm/vc4: Fix handling of a pm_runtime_get_sync() success case. Eric Anholt <eric@anholt.net> - 2016-07-26 22:50 +0200

#1450885 — [PATCH 3/6] drm/vc4: Fix handling of a pm_runtime_get_sync() success case.

FromEric Anholt <eric@anholt.net>
Date2016-07-26 22:50 +0200
Subject[PATCH 3/6] drm/vc4: Fix handling of a pm_runtime_get_sync() success case.
Message-ID<rZhsB-6N1-1@gated-at.bofh.it>
If the device was already up, a 1 is returned instead of 0.  We were
erroring out, leading the 3D driver to sometimes fail at screen
initialization (generally with ENOENT returned to it).

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: af713795c59f ("drm/vc4: Add a getparam ioctl for getting the V3D identity regs.")
---
 drivers/gpu/drm/vc4/vc4_drv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c
index 9435894822d5..fb20e03ec7e2 100644
--- a/drivers/gpu/drm/vc4/vc4_drv.c
+++ b/drivers/gpu/drm/vc4/vc4_drv.c
@@ -57,21 +57,21 @@ static int vc4_get_param_ioctl(struct drm_device *dev, void *data,
 	switch (args->param) {
 	case DRM_VC4_PARAM_V3D_IDENT0:
 		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
-		if (ret)
+		if (ret < 0)
 			return ret;
 		args->value = V3D_READ(V3D_IDENT0);
 		pm_runtime_put(&vc4->v3d->pdev->dev);
 		break;
 	case DRM_VC4_PARAM_V3D_IDENT1:
 		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
-		if (ret)
+		if (ret < 0)
 			return ret;
 		args->value = V3D_READ(V3D_IDENT1);
 		pm_runtime_put(&vc4->v3d->pdev->dev);
 		break;
 	case DRM_VC4_PARAM_V3D_IDENT2:
 		ret = pm_runtime_get_sync(&vc4->v3d->pdev->dev);
-		if (ret)
+		if (ret < 0)
 			return ret;
 		args->value = V3D_READ(V3D_IDENT2);
 		pm_runtime_put(&vc4->v3d->pdev->dev);
-- 
2.8.1

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web