As kmalloc is allowed to block (if given the right flags), mark up the
two i915_sw_fence routines that may call kmalloc as potential sleeping
routines.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Tvrtko Ursulin <[email protected]>
Cc: Joonas Lahtinen <[email protected]>
---
 drivers/gpu/drm/i915/i915_sw_fence.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c 
b/drivers/gpu/drm/i915/i915_sw_fence.c
index e8ca67a129d2..1212b04604be 100644
--- a/drivers/gpu/drm/i915/i915_sw_fence.c
+++ b/drivers/gpu/drm/i915/i915_sw_fence.c
@@ -303,6 +303,7 @@ static int __i915_sw_fence_await_sw_fence(struct 
i915_sw_fence *fence,
        int pending;
 
        debug_fence_assert(fence);
+       might_sleep_if(gfpflags_allow_blocking(gfp));
 
        if (i915_sw_fence_done(signaler))
                return 0;
@@ -418,6 +419,7 @@ int i915_sw_fence_await_dma_fence(struct i915_sw_fence 
*fence,
        int ret;
 
        debug_fence_assert(fence);
+       might_sleep_if(gfpflags_allow_blocking(gfp));
 
        if (dma_fence_is_signaled(dma))
                return 0;
@@ -464,6 +466,7 @@ int i915_sw_fence_await_reservation(struct i915_sw_fence 
*fence,
        int ret = 0, pending;
 
        debug_fence_assert(fence);
+       might_sleep_if(gfpflags_allow_blocking(gfp));
 
        if (write) {
                struct dma_fence **shared;
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to