intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/gt: Cleanup heartbeat systole first
Date: Thu, 07 Nov 2019 09:45:08 +0200	[thread overview]
Message-ID: <87a798nn97.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20191106223410.30334-1-chris@chris-wilson.co.uk>

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

> Before we grab the engine wakeref, tidy up the previous heartbeat
> request. If we then abort because the engine powerwell is off, we ensure
> the request is freed as we know we will not have freed it when
> cancelling the work (as the work is running!).
>
> Fixes: 841e86728615 ("drm/i915/gt: Only drop heartbeat.systole if the sole owner")
> References: 058179e72e09 ("drm/i915/gt: Replace hangcheck by heartbeats")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> index 06aa14c7aa8c..c91fd4e4af29 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> @@ -63,15 +63,15 @@ static void heartbeat(struct work_struct *wrk)
>  	struct intel_context *ce = engine->kernel_context;
>  	struct i915_request *rq;
>  
> -	if (!intel_engine_pm_get_if_awake(engine))
> -		return;
> -
>  	rq = engine->heartbeat.systole;
>  	if (rq && i915_request_completed(rq)) {
>  		i915_request_put(rq);
>  		engine->heartbeat.systole = NULL;
>  	}
>  
> +	if (!intel_engine_pm_get_if_awake(engine))
> +		return;
> +
>  	if (intel_gt_is_wedged(engine->gt))
>  		goto out;
>  
> -- 
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

WARNING: multiple messages have this Message-ID (diff)
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/gt: Cleanup heartbeat systole first
Date: Thu, 07 Nov 2019 09:45:08 +0200	[thread overview]
Message-ID: <87a798nn97.fsf@gaia.fi.intel.com> (raw)
Message-ID: <20191107074508.ZMFdTjiguuwtMkNyeSQHODkWYjfQLlWbfpu2q77sBg4@z> (raw)
In-Reply-To: <20191106223410.30334-1-chris@chris-wilson.co.uk>

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

> Before we grab the engine wakeref, tidy up the previous heartbeat
> request. If we then abort because the engine powerwell is off, we ensure
> the request is freed as we know we will not have freed it when
> cancelling the work (as the work is running!).
>
> Fixes: 841e86728615 ("drm/i915/gt: Only drop heartbeat.systole if the sole owner")
> References: 058179e72e09 ("drm/i915/gt: Replace hangcheck by heartbeats")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> index 06aa14c7aa8c..c91fd4e4af29 100644
> --- a/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> +++ b/drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c
> @@ -63,15 +63,15 @@ static void heartbeat(struct work_struct *wrk)
>  	struct intel_context *ce = engine->kernel_context;
>  	struct i915_request *rq;
>  
> -	if (!intel_engine_pm_get_if_awake(engine))
> -		return;
> -
>  	rq = engine->heartbeat.systole;
>  	if (rq && i915_request_completed(rq)) {
>  		i915_request_put(rq);
>  		engine->heartbeat.systole = NULL;
>  	}
>  
> +	if (!intel_engine_pm_get_if_awake(engine))
> +		return;
> +
>  	if (intel_gt_is_wedged(engine->gt))
>  		goto out;
>  
> -- 
> 2.24.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-11-07  7:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-06 22:34 [PATCH] drm/i915/gt: Cleanup heartbeat systole first Chris Wilson
2019-11-06 22:34 ` [Intel-gfx] " Chris Wilson
2019-11-07  1:17 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-11-07  1:17   ` [Intel-gfx] " Patchwork
2019-11-07  1:38 ` ✓ Fi.CI.BAT: success " Patchwork
2019-11-07  1:38   ` [Intel-gfx] " Patchwork
2019-11-07  7:45 ` Mika Kuoppala [this message]
2019-11-07  7:45   ` [Intel-gfx] [PATCH] " Mika Kuoppala
2019-11-08  5:31 ` ✓ Fi.CI.IGT: success for " Patchwork
2019-11-08  5:31   ` [Intel-gfx] " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a798nn97.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).