Skip to content

Commit 93eea62

Browse files
Chris Wilsonrodrigovivi
authored andcommitted
drm/i915/selftests: Unwind hugepages to drop wakeref on error
Make sure that upon error after we have acquired the wakeref we do release it again. v2: add another missing "goto out_wf"(Andi). Fixes: 027c38b ("drm/i915/selftests: Grab the runtime pm in shrink_thp") Cc: Andi Shyti <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Reviewed-by: Andrzej Hajda <[email protected]> Signed-off-by: Chris Wilson <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Signed-off-by: Andi Shyti <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 14ec40a) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 67b0b4e commit 93eea62

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/i915/gem/selftests/huge_pages.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1847,7 +1847,7 @@ static int igt_shrink_thp(void *arg)
18471847
I915_SHRINK_ACTIVE);
18481848
i915_vma_unpin(vma);
18491849
if (err)
1850-
goto out_put;
1850+
goto out_wf;
18511851

18521852
/*
18531853
* Now that the pages are *unpinned* shrinking should invoke
@@ -1863,19 +1863,19 @@ static int igt_shrink_thp(void *arg)
18631863
pr_err("unexpected pages mismatch, should_swap=%s\n",
18641864
str_yes_no(should_swap));
18651865
err = -EINVAL;
1866-
goto out_put;
1866+
goto out_wf;
18671867
}
18681868

18691869
if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) {
18701870
pr_err("unexpected residual page-size bits, should_swap=%s\n",
18711871
str_yes_no(should_swap));
18721872
err = -EINVAL;
1873-
goto out_put;
1873+
goto out_wf;
18741874
}
18751875

18761876
err = i915_vma_pin(vma, 0, 0, flags);
18771877
if (err)
1878-
goto out_put;
1878+
goto out_wf;
18791879

18801880
while (n--) {
18811881
err = cpu_check(obj, n, 0xdeadbeaf);

0 commit comments

Comments
 (0)