Skip to content

Commit 14ec40a

Browse files
Chris WilsonAndi Shyti
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 <andi.shyti@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com> Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230117123234.26487-1-nirmoy.das@intel.com
1 parent 67804e4 commit 14ec40a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,7 +1855,7 @@ static int igt_shrink_thp(void *arg)
18551855
I915_SHRINK_ACTIVE);
18561856
i915_vma_unpin(vma);
18571857
if (err)
1858-
goto out_put;
1858+
goto out_wf;
18591859

18601860
/*
18611861
* Now that the pages are *unpinned* shrinking should invoke
@@ -1871,19 +1871,19 @@ static int igt_shrink_thp(void *arg)
18711871
pr_err("unexpected pages mismatch, should_swap=%s\n",
18721872
str_yes_no(should_swap));
18731873
err = -EINVAL;
1874-
goto out_put;
1874+
goto out_wf;
18751875
}
18761876

18771877
if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) {
18781878
pr_err("unexpected residual page-size bits, should_swap=%s\n",
18791879
str_yes_no(should_swap));
18801880
err = -EINVAL;
1881-
goto out_put;
1881+
goto out_wf;
18821882
}
18831883

18841884
err = i915_vma_pin(vma, 0, 0, flags);
18851885
if (err)
1886-
goto out_put;
1886+
goto out_wf;
18871887

18881888
while (n--) {
18891889
err = cpu_check(obj, n, 0xdeadbeaf);

0 commit comments

Comments
 (0)