diff mbox

[1/3] drm/i915: Mark up potential allocation paths within i915_sw_fence as might_sleep

Message ID 20171212180652.22061-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson Dec. 12, 2017, 6:06 p.m. UTC
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 <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_sw_fence.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Joonas Lahtinen Dec. 13, 2017, 11:08 a.m. UTC | #1
On Tue, 2017-12-12 at 18:06 +0000, Chris Wilson wrote:
> 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 <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
Chris Wilson Dec. 13, 2017, 1:29 p.m. UTC | #2
Quoting Patchwork (2017-12-12 19:20:00)
> == Series Details ==
> 
> Series: series starting with [1/3] drm/i915: Mark up potential allocation paths within i915_sw_fence as might_sleep
> URL   : https://patchwork.freedesktop.org/series/35239/
> State : success
> 
> == Summary ==
> 
> Test gem_tiled_swapping:
>         Subgroup non-threaded:
>                 incomplete -> PASS       (shard-snb) fdo#104009
>                 pass       -> INCOMPLETE (shard-hsw) fdo#104218
> Test kms_flip:
>         Subgroup plain-flip-fb-recreate-interruptible:
>                 pass       -> FAIL       (shard-hsw) fdo#100368
> Test kms_cursor_crc:
>         Subgroup cursor-256x256-suspend:
>                 pass       -> DMESG-WARN (shard-snb) fdo#103375

Thanks for the review. Having left a bit of clear air on CI after the
associated fixes, now pushed.
-Chris
diff mbox

Patch

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;