[Intel-gfx] [PATCH 1/2] drm/i915: Postpone fake breadcrumb interrupt until real interrupts cease

Chris Wilson chris at chris-wilson.co.uk
Thu Feb 16 14:31:47 UTC 2017


On Thu, Feb 16, 2017 at 02:22:52PM +0000, Chris Wilson wrote:
> When the timer expires for checking on interrupt processing, check to
> see if any interrupts arrived within the last time period. If real
> interrupts are still being delivered, we can be reassured that we
> haven't missed the final interrupt as the waiter will still be woken.
> Only once all activity ceases, do we have to worry about the waiter
> never being woken and so need to install a timer to kick the waiter for
> a slow arrival of a seqno.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---

> @@ -34,8 +39,9 @@ static void intel_breadcrumbs_hangcheck(unsigned long data)
>  	if (!b->irq_enabled)
>  		return;
>  
> -	if (time_before(jiffies, b->timeout)) {
> -		mod_timer(&b->hangcheck, b->timeout);
> +	if (b->hangcheck_interrupts != atomic_read(&engine->irq_count)) {
> +		b->hangcheck_interrupts = atomic_read(&engine->irq_count);
> +		mod_timer(&b->hangcheck, wait_timeout());
>  		return;

Still toying with the idea of how to check for a delayed waiter - we
don't want to blame the hw if the waiter hasn't yet been run (perhaps
due to low priority on a loaded system).

Tempted to grab the b->first_wait and do a check against tsk->state.
Of course that may well be overkill!
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list