[Intel-gfx] [PATCH v8 03/20] drm/i915: Modify error handler for per engine hang recovery

Chris Wilson chris at chris-wilson.co.uk
Sun Jun 4 11:47:25 UTC 2017


Quoting Chris Wilson (2017-06-02 21:16:42)
> I think you want to do something like:
> 
> if (intel_has_engine_reset()) {
>         for_each_engine_mask() {
>                 if (test_and_set_bit(I915_RESET_ENGINE + engine->id))
>                         continue;
> 
>                 if (i915_reset_engine() == 0)
>                         engine_mask &= ~engine->mask;
> 
>                 clear_bit(I915_RESET_ENGINE + engine->id);
>                 wake_up_bit(I915_RESET_ENGINE + engine->id);
>         }
> }
> 
> if (!engine_mask)
>         goto out;
> 
> if (test_and_set_bit(I915_RESET_BACKOFF))
>         goto out;
> 
> for_each_engine() {
>         wait_on_bit(I915_RESET_ENGINE + engine->id);
>         set_bit(I915_RESET_ENGINE);
> }

This needs to be in a loop for that sweet layer of paranoia.

while (test_and_set_bit(I915_RESET_ENGINE + engine->id))
	wait_on_bit(I915_RESET_ENGINE + engine->id);
-Chris


More information about the Intel-gfx mailing list