Skip to content

Commit 5b0a78e

Browse files
mlankhorstdanvet
authored andcommitted
drm/i915: Move gt_revoke() slightly
We get a lockdep splat when the reset mutex is held, because it can be taken from fence_wait. This conflicts with the mmu notifier we have, because we recurse between reset mutex and mmap lock -> mmu notifier. Remove this recursion by calling revoke_mmaps before taking the lock. The reset code still needs fixing, as taking mmap locks during reset is not allowed. Signed-off-by: Maarten Lankhorst <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> [danvet: Add FIXME.] Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fd995a3 commit 5b0a78e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

drivers/gpu/drm/i915/gt/intel_reset.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -974,8 +974,6 @@ static int do_reset(struct intel_gt *gt, intel_engine_mask_t stalled_mask)
974974
{
975975
int err, i;
976976

977-
gt_revoke(gt);
978-
979977
err = __intel_gt_reset(gt, ALL_ENGINES);
980978
for (i = 0; err && i < RESET_MAX_RETRIES; i++) {
981979
msleep(10 * (i + 1));
@@ -1030,6 +1028,13 @@ void intel_gt_reset(struct intel_gt *gt,
10301028

10311029
might_sleep();
10321030
GEM_BUG_ON(!test_bit(I915_RESET_BACKOFF, &gt->reset.flags));
1031+
1032+
/*
1033+
* FIXME: Revoking cpu mmap ptes cannot be done from a dma_fence
1034+
* critical section like gpu reset.
1035+
*/
1036+
gt_revoke(gt);
1037+
10331038
mutex_lock(&gt->reset.mutex);
10341039

10351040
/* Clear any previous failed attempts at recovery. Time to try again. */

0 commit comments

Comments
 (0)