All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Intel-gfx] [PATCH 4/4] drm/i915/selftest: Always cancel semaphore on error
@ 2022-04-10 23:49 Mae Chavez
  0 siblings, 0 replies; 3+ messages in thread
From: Mae Chavez @ 2022-04-10 23:49 UTC (permalink / raw)
  To: dri-devel

[-- Attachment #1: Type: text/plain, Size: 1 bytes --]



[-- Attachment #2: Type: text/html, Size: 23 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH 4/4] drm/i915/selftest: Always cancel semaphore on error
  2022-03-14 18:20 ` [Intel-gfx] [PATCH 4/4] drm/i915/selftest: Always cancel semaphore on error Ramalingam C
@ 2022-04-08 14:43   ` Thomas Hellström
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Hellström @ 2022-04-08 14:43 UTC (permalink / raw)
  To: Ramalingam C, intel-gfx, dri-devel
  Cc: CQ Tang, Hellstrom Thomas, Chris Wilson


On 3/14/22 19:20, Ramalingam C wrote:
> From: Chris Wilson <chris@chris-wilson.co.uk>
>
> Ensure that we always signal the semaphore when timing out, so that if it
> happens to be stuck waiting for the semaphore we will quickly recover
> without having to wait for a reset.
>
> Reported-by: CQ Tang <cq.tang@intel.com>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: CQ Tang <cq.tang@intel.com>
> cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Signed-off-by: Ramalingam C <ramalingam.c@intel.com>

Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>


> ---
>   drivers/gpu/drm/i915/gt/selftest_lrc.c | 17 ++++++++---------
>   1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> index b9cc89de01bf..ae16668dd9d4 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
> @@ -1435,18 +1435,17 @@ static int __lrc_isolation(struct intel_engine_cs *engine, u32 poison)
>   	}
>   
>   	err = poison_registers(B, poison, sema);
> -	if (err) {
> -		WRITE_ONCE(*sema, -1);
> -		i915_request_put(rq);
> -		goto err_result1;
> -	}
> -
> -	if (i915_request_wait(rq, 0, HZ / 2) < 0) {
> -		i915_request_put(rq);
> +	if (err == 0 && i915_request_wait(rq, 0, HZ / 2) < 0) {
> +		pr_err("%s(%s): wait for results timed out\n",
> +		       __func__, engine->name);
>   		err = -ETIME;
> -		goto err_result1;
>   	}
> +
> +	/* Always cancel the semaphore wait, just in case the GPU gets stuck */
> +	WRITE_ONCE(*sema, -1);
>   	i915_request_put(rq);
> +	if (err)
> +		goto err_result1;
>   
>   	err = compare_isolation(engine, ref, result, A, poison);
>   

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-gfx] [PATCH 4/4] drm/i915/selftest: Always cancel semaphore on error
  2022-03-14 18:20 [PATCH 0/4] lrc selftest fixes Ramalingam C
@ 2022-03-14 18:20 ` Ramalingam C
  2022-04-08 14:43   ` Thomas Hellström
  0 siblings, 1 reply; 3+ messages in thread
From: Ramalingam C @ 2022-03-14 18:20 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: CQ Tang, Hellstrom Thomas, Chris Wilson

From: Chris Wilson <chris@chris-wilson.co.uk>

Ensure that we always signal the semaphore when timing out, so that if it
happens to be stuck waiting for the semaphore we will quickly recover
without having to wait for a reset.

Reported-by: CQ Tang <cq.tang@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: CQ Tang <cq.tang@intel.com>
cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Ramalingam C <ramalingam.c@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_lrc.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/selftest_lrc.c b/drivers/gpu/drm/i915/gt/selftest_lrc.c
index b9cc89de01bf..ae16668dd9d4 100644
--- a/drivers/gpu/drm/i915/gt/selftest_lrc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_lrc.c
@@ -1435,18 +1435,17 @@ static int __lrc_isolation(struct intel_engine_cs *engine, u32 poison)
 	}
 
 	err = poison_registers(B, poison, sema);
-	if (err) {
-		WRITE_ONCE(*sema, -1);
-		i915_request_put(rq);
-		goto err_result1;
-	}
-
-	if (i915_request_wait(rq, 0, HZ / 2) < 0) {
-		i915_request_put(rq);
+	if (err == 0 && i915_request_wait(rq, 0, HZ / 2) < 0) {
+		pr_err("%s(%s): wait for results timed out\n",
+		       __func__, engine->name);
 		err = -ETIME;
-		goto err_result1;
 	}
+
+	/* Always cancel the semaphore wait, just in case the GPU gets stuck */
+	WRITE_ONCE(*sema, -1);
 	i915_request_put(rq);
+	if (err)
+		goto err_result1;
 
 	err = compare_isolation(engine, ref, result, A, poison);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-11  7:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-10 23:49 [Intel-gfx] [PATCH 4/4] drm/i915/selftest: Always cancel semaphore on error Mae Chavez
  -- strict thread matches above, loose matches on Subject: below --
2022-03-14 18:20 [PATCH 0/4] lrc selftest fixes Ramalingam C
2022-03-14 18:20 ` [Intel-gfx] [PATCH 4/4] drm/i915/selftest: Always cancel semaphore on error Ramalingam C
2022-04-08 14:43   ` Thomas Hellström

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.