Skip to contentSkip to conversation

drm/i915: fix i915_gem_object_wait_moving_fence

PATCH In review Matthew Auld 4 participants 6 messages Apr 8, 2022

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

PATCH v2 1/1 drm/i915: fix i915_gem_object_wait_moving_fence

All of CI is just failing with the following, which prevents loading of the module:

    i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed

Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error.

v2(Lucas): handle ret == 0

Fixes 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency")
Cc Christian König <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Daniel Vetter <[email protected]>
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +9 -2
index 2998d895a6b3..747ac65e060f 100644
@@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct drm_i915_gem_object *obj,
 int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj,
 				      bool intr)
 {
+	long ret;
+
 	assert_object_held(obj);
-	return dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
-				     intr, MAX_SCHEDULE_TIMEOUT);
+
+	ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
+				    intr, MAX_SCHEDULE_TIMEOUT);
+	if (!ret)
+		ret = -ETIME;
+
+	return ret < 0 ? ret : 0;
 }
 
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
Signature · 1 line
2.34.1
Reviewed-by on v2 1/1
#1 lore raw

Am 08.04.22 um 10:42 schrieb Matthew Auld:

Quoted 10 lines

All of CI is just failing with the following, which prevents loading of the module:

     i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed

Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error.

Quoted 8 lines

v2(Lucas): handle ret == 0

Fixes 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency")
Cc Christian König <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Daniel Vetter <[email protected]>

Should I push it to drm-misc-next?

Quoted 27 lines
---
  drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++--
  1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +9 -2
index 2998d895a6b3..747ac65e060f 100644
@@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct drm_i915_gem_object *obj,
  int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj,
  				      bool intr)
  {
+	long ret;
+
  	assert_object_held(obj);
-	return dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
-				     intr, MAX_SCHEDULE_TIMEOUT);
+
+	ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
+				    intr, MAX_SCHEDULE_TIMEOUT);
+	if (!ret)
+		ret = -ETIME;
+
+	return ret < 0 ? ret : 0;
  }
 
  #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#2 lore raw
Quoted 20 lines · Christian König

Am 08.04.22 um 10:42 schrieb Matthew Auld:

Quoted 10 lines

All of CI is just failing with the following, which prevents loading of the module:

     i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed

Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error.

Quoted 8 lines

v2(Lucas): handle ret == 0

Fixes 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency")
Cc Christian König <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Daniel Vetter <[email protected]>
Quoted 3 lines

Should I push it to drm-misc-next?

I guess we need to wait for at least BAT result to come back. I will ping here, assuming that comes back green. Thanks.

Quoted 29 lines
Quoted 28 lines

---
  drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++--

  1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +9 -2
index 2998d895a6b3..747ac65e060f 100644
@@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct 
 drm_i915_gem_object *obj,
   int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj,
                         bool intr)
   {
+    long ret;
+
       assert_object_held(obj);
-    return dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
-                     intr, MAX_SCHEDULE_TIMEOUT);
+
+    ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
+                    intr, MAX_SCHEDULE_TIMEOUT);
+    if (!ret)
+        ret = -ETIME;
+
+    return ret < 0 ? ret : 0;
   }
   #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
#3 lore raw
Quoted 21 lines · Matthew Auld
Quoted 20 lines · Christian König

Am 08.04.22 um 10:42 schrieb Matthew Auld:

Quoted 18 lines

All of CI is just failing with the following, which prevents loading of the module:

     i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed

Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error.

v2(Lucas): handle ret == 0

Fixes 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency")
Cc Christian König <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Daniel Vetter <[email protected]>
Quoted 5 lines
Quoted 3 lines

Should I push it to drm-misc-next?

I guess we need to wait for at least BAT result to come back. I will ping here, assuming that comes back green. Thanks.

Ok, please go ahead with merging.

Quoted 31 lines
Quoted 31 lines
Quoted 30 lines

---
  drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++--

  1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +9 -2
index 2998d895a6b3..747ac65e060f 100644
@@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct 
 drm_i915_gem_object *obj,
   int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj,
                         bool intr)
   {
+    long ret;
+
       assert_object_held(obj);
-    return dma_resv_wait_timeout(obj->base. resv, 
 DMA_RESV_USAGE_KERNEL,
-                     intr, MAX_SCHEDULE_TIMEOUT);
+
+    ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
+                    intr, MAX_SCHEDULE_TIMEOUT);
+    if (!ret)
+        ret = -ETIME;
+
+    return ret < 0 ? ret : 0;
   }

  #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)

#4 lore raw
In reply to Matthew Auld
Quoted 10 lines · Matthew Auld

All of CI is just failing with the following, which prevents loading of the module:

    i915 0000:03:00.0: [drm] *ERROR* Scratch setup failed

Best guess is that this comes from the pin_map() for the scratch page, which does an i915_gem_object_wait_moving_fence() somewhere. It looks like this now calls into dma_resv_wait_timeout() which can return the remaining timeout, leading to the caller thinking this is an error.

Quoted 8 lines

v2(Lucas): handle ret == 0

Fixes 1d7f5e6c5240 ("drm/i915: drop bo->moving dependency")
Cc Christian König <[email protected]>
Cc Lucas De Marchi <[email protected]>
Cc Daniel Vetter <[email protected]>

For the record, patchwork is disabled at this time. Trybot is still up if you want CI to verify this.

Signature · 1 line
Petri Latvala
Quoted 30 lines
---
 drivers/gpu/drm/i915/gem/i915_gem_object.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +9 -2
index 2998d895a6b3..747ac65e060f 100644
@@ -772,9 +772,16 @@ int i915_gem_object_get_moving_fence(struct drm_i915_gem_object *obj,
 int i915_gem_object_wait_moving_fence(struct drm_i915_gem_object *obj,
 				      bool intr)
 {
+	long ret;
+
 	assert_object_held(obj);
-	return dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
-				     intr, MAX_SCHEDULE_TIMEOUT);
+
+	ret = dma_resv_wait_timeout(obj->base. resv, DMA_RESV_USAGE_KERNEL,
+				    intr, MAX_SCHEDULE_TIMEOUT);
+	if (!ret)
+		ret = -ETIME;
+
+	return ret < 0 ? ret : 0;
 }
 
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
Signature · 1 line
2.34.1
#5 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915: fix i915_gem_object_wait_moving_fence

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: drm/i915: fix i915_gem_object_wait_moving_fence
URL : https://patchwork.freedesktop.org/series/102396/
State : failure

== Summary ==

Applying: drm/i915: fix i915_gem_object_wait_moving_fence Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/gem/i915_gem_object.c
Falling back to patching base and 3-way merge... No changes -- Patch already applied.