diff mbox series

[v3] drm/i915/selftests: avoid using uninitialized context

Message ID iuaonpjc3rywmvhna6umjlvzilocn2uqsrxfxfob24e2taocbi@lkaivvfp4777 (mailing list archive)
State New
Headers show
Series [v3] drm/i915/selftests: avoid using uninitialized context | expand

Commit Message

Krzysztof Karas Jan. 30, 2025, 9:19 a.m. UTC
There is an error path in igt_ppgtt_alloc(), which leads
to ww object being passed down to i915_gem_ww_ctx_fini() without
initialization. Correct that by only putting ppgtt->vm and
returning early.

Fixes: 480ae79537b2 ("drm/i915/selftests: Prepare gtt tests for obj->mm.lock removal")
Signed-off-by: Krzysztof Karas <krzysztof.karas@intel.com>
Reviewed-by: Mikolaj Wasiak <mikolaj.wasiak@intel.com>
---
Changelog:
 * v1 -> v2:
        Avoid calling i915_gem_ww_ctx_fini() with zeroed context
        by returning early (Sebastian).

 * v2 -> v3:
        Use an additional label for clenup path (Mikolaj).

 drivers/gpu/drm/i915/selftests/i915_gem_gtt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Krzysztof Karas Jan. 30, 2025, 12:23 p.m. UTC | #1
Hi CI team,

below failures are not related to my patch. Could you re-report?

Krzysztof

> Series: drm/i915/selftests: avoid using uninitialized context (rev3)
> URL   : https://patchwork.freedesktop.org/series/143990/
> State : failure
> 
...
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in Patchwork_143990v3:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@kms_flip@basic-flip-vs-wf_vblank@a-dp1:
>     - fi-cfl-8109u:       [PASS][1] -> [DMESG-WARN][2] +2 other tests dmesg-warn
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/fi-cfl-8109u/igt@kms_flip@basic-flip-vs-wf_vblank@a-dp1.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_143990v3/fi-cfl-8109u/igt@kms_flip@basic-flip-vs-wf_vblank@a-dp1.html
>
Illipilli, TejasreeX Jan. 31, 2025, 12:04 p.m. UTC | #2
Hi,

https://patchwork.freedesktop.org/series/143990/ - Re-reported.

Thanks,
Tejasree

-----Original Message-----
From: I915-ci-infra <i915-ci-infra-bounces@lists.freedesktop.org> On Behalf Of Krzysztof Karas
Sent: Thursday, January 30, 2025 5:54 PM
To: I915-ci-infra@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: ✗ i915.CI.BAT: failure for drm/i915/selftests: avoid using uninitialized context (rev3)

Hi CI team,

below failures are not related to my patch. Could you re-report?

Krzysztof

> Series: drm/i915/selftests: avoid using uninitialized context (rev3)
> URL   : https://patchwork.freedesktop.org/series/143990/
> State : failure
> 
...
> Possible new issues
> -------------------
> 
>   Here are the unknown changes that may have been introduced in Patchwork_143990v3:
> 
> ### IGT changes ###
> 
> #### Possible regressions ####
> 
>   * igt@kms_flip@basic-flip-vs-wf_vblank@a-dp1:
>     - fi-cfl-8109u:       [PASS][1] -> [DMESG-WARN][2] +2 other tests dmesg-warn
>    [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_16041/fi-cfl-8109u/igt@kms_flip@basic-flip-vs-wf_vblank@a-dp1.html
>    [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_143990v3/fi-cfl-8109u/igt@kms_flip@basic-flip-vs-wf_vblank@a-dp1.html
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
index 5816d515203a..7ab4c4e60264 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_gtt.c
@@ -168,7 +168,7 @@  static int igt_ppgtt_alloc(void *arg)
 		return PTR_ERR(ppgtt);
 
 	if (!ppgtt->vm.allocate_va_range)
-		goto err_ppgtt_cleanup;
+		goto ppgtt_vm_put;
 
 	/*
 	 * While we only allocate the page tables here and so we could
@@ -236,7 +236,7 @@  static int igt_ppgtt_alloc(void *arg)
 			goto retry;
 	}
 	i915_gem_ww_ctx_fini(&ww);
-
+ppgtt_vm_put:
 	i915_vm_put(&ppgtt->vm);
 	return err;
 }