Long running dma-fences are not allowed to be exported, a drm_syncobj is
designed to be exported to the user, so add a warn if drm_syncobj
install long running dna-fences as this is not allowed.

Signed-off-by: Matthew Brost <matthew.br...@intel.com>
---
 drivers/gpu/drm/drm_syncobj.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c
index 0c2be8360525..7c304cd7d037 100644
--- a/drivers/gpu/drm/drm_syncobj.c
+++ b/drivers/gpu/drm/drm_syncobj.c
@@ -291,6 +291,7 @@ void drm_syncobj_add_point(struct drm_syncobj *syncobj,
        struct syncobj_wait_entry *cur, *tmp;
        struct dma_fence *prev;
 
+       WARN_ON_ONCE(dma_fence_is_lr(fence));
        dma_fence_get(fence);
 
        spin_lock(&syncobj->lock);
@@ -325,8 +326,10 @@ void drm_syncobj_replace_fence(struct drm_syncobj *syncobj,
        struct dma_fence *old_fence;
        struct syncobj_wait_entry *cur, *tmp;
 
-       if (fence)
+       if (fence) {
+               WARN_ON_ONCE(dma_fence_is_lr(fence));
                dma_fence_get(fence);
+       }
 
        spin_lock(&syncobj->lock);
 
-- 
2.34.1

Reply via email to