Skip to contentSkip to conversation

drm/syncobj: Fix oops on drm_syncobj_find_fence(file_priv, 0, ...).

PATCH In review Eric Anholt 4 participants 4 messages Nov 5, 2018 – Nov 6, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/syncobj: Fix oops on drm_syncobj_find_fence(file_priv, 0, ...).

This broke rendering on V3D, where we almost always have a 0 in-syncobj.

Fixes 48197bc564c7 ("drm: add syncobj timeline support v9")
Cc Chunming Zhou <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/drm_syncobj.c +2 -1
index 4dca5f7e8c4b..da8175d9c6ff 100644
@@ -443,7 +443,8 @@ int drm_syncobj_find_fence(struct drm_file *file_private,
 	int ret;
 
 	ret = drm_syncobj_search_fence(syncobj, point, flags, fence);
-	drm_syncobj_put(syncobj);
+	if (syncobj)
+		drm_syncobj_put(syncobj);
 	return ret;
 }
 EXPORT_SYMBOL(drm_syncobj_find_fence);
Signature · 6 lines
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw
Quoted 34 lines

-----Original Message-----
From: Eric Anholt <[email protected]>
Sent: Tuesday, November 06, 2018 7:01 AM
To: [email protected]
Cc: [email protected]; Eric Anholt <[email protected]>; Zhou, David(ChunMing) <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH] drm/syncobj: Fix oops on drm_syncobj_find_fence(file_priv, 0, ...).

This broke rendering on V3D, where we almost always have a 0 in-syncobj.

Fixes 48197bc564c7 ("drm: add syncobj timeline support v9")
Cc Chunming Zhou <[email protected]>
Cc Christian König <[email protected]>
---
 drivers/gpu/drm/drm_syncobj.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/drm_syncobj.c index 4dca5f7e8c4b..da8175d9c6ff 100644

drivers/gpu/drm/drm_syncobj.c +2 -1
@@ -443,7 +443,8 @@ int drm_syncobj_find_fence(struct drm_file
 *file_private,
 	int ret;
 
 	ret = drm_syncobj_search_fence(syncobj, point, flags, fence);
-	drm_syncobj_put(syncobj);
+	if (syncobj)
+		drm_syncobj_put(syncobj);
 	return ret;
 }
Quoted 3 lines

EXPORT_SYMBOL(drm_syncobj_find_fence);
--
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Should I push it to drm-misc-next?

Christian.

Am 06.11.18 um 03:18 schrieb Zhou, David(ChunMing):

Quoted 30 lines
Quoted 28 lines

-----Original Message-----
From: Eric Anholt <[email protected]>
Sent: Tuesday, November 06, 2018 7:01 AM
To: [email protected]
Cc: [email protected]; Eric Anholt <[email protected]>; Zhou, David(ChunMing) <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH] drm/syncobj: Fix oops on drm_syncobj_find_fence(file_priv, 0, ...).

This broke rendering on V3D, where we almost always have a 0 in-syncobj.

Fixes 48197bc564c7 ("drm: add syncobj timeline support v9")
Cc Chunming Zhou <[email protected]>
Cc Christian König <[email protected]>
---
  drivers/gpu/drm/drm_syncobj.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/drm_syncobj.c index 4dca5f7e8c4b..da8175d9c6ff 100644

drivers/gpu/drm/drm_syncobj.c +0 -0
@@ -443,7 +443,8 @@ int drm_syncobj_find_fence(struct drm_file
 *file_private,
  	int ret;
 
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/drm_syncobj.c +2 -1
  	ret = drm_syncobj_search_fence(syncobj, point, flags, fence);
-	drm_syncobj_put(syncobj);
+	if (syncobj)
+		drm_syncobj_put(syncobj);
  	return ret;
  }

EXPORT_SYMBOL(drm_syncobj_find_fence);
--
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
Quoted 3 lines · Christian

Should I push it to drm-misc-next?

Yeah.

This should have broken an igt somewhere ... would be good to double check whether that's true and why it wasn't caught. From a quick look i915 doesn't use this interface (it uses drm_syncobj_find, which isn't broken like this), only amdgpu and v3d use this.

I guess an in-kernel unit test for these driver interfaces is what we need here.
-Daniel

Quoted 48 lines

Christian.

Am 06.11.18 um 03:18 schrieb Zhou, David(ChunMing):

Quoted 30 lines
Quoted 28 lines

-----Original Message-----
From: Eric Anholt <[email protected]>
Sent: Tuesday, November 06, 2018 7:01 AM
To: [email protected]
Cc: [email protected]; Eric Anholt <[email protected]>; Zhou, David(ChunMing) <[email protected]>; Koenig, Christian <[email protected]>
Subject: [PATCH] drm/syncobj: Fix oops on drm_syncobj_find_fence(file_priv, 0, ...).

This broke rendering on V3D, where we almost always have a 0 in-syncobj.

Fixes 48197bc564c7 ("drm: add syncobj timeline support v9")
Cc Chunming Zhou <[email protected]>
Cc Christian König <[email protected]>
---
  drivers/gpu/drm/drm_syncobj.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/drm_syncobj.c index 4dca5f7e8c4b..da8175d9c6ff 100644

drivers/gpu/drm/drm_syncobj.c +0 -0
@@ -443,7 +443,8 @@ int drm_syncobj_find_fence(struct drm_file
 *file_private,
  	int ret;
 
Quoted 9 lines
Quoted 9 lines
drivers/gpu/drm/drm_syncobj.c +2 -1
  	ret = drm_syncobj_search_fence(syncobj, point, flags, fence);
-	drm_syncobj_put(syncobj);
+	if (syncobj)
+		drm_syncobj_put(syncobj);
  	return ret;
  }

EXPORT_SYMBOL(drm_syncobj_find_fence);
--
2.19.1

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel