Hi Niranjana,

[...]

> +     for_each_child(ce, child) {
> +             err = intel_context_pin_ww(child, ww);
> +             GEM_BUG_ON(err);        /* perma-pinned should incr a counter */
> +     }
> +
> +     for_each_child(ce, child) {
> +             err = eb_pin_timeline(child, throttle, nonblock);
> +             if (err)
> +                     goto unwind;
> +             ++i;
> +     }

any reason for having two separate for_each_child here?

Andi

> +     err = eb_pin_timeline(ce, throttle, nonblock);
> +     if (err)
> +             goto unwind;
> +
> +     return 0;
> +
> +unwind:
> +     for_each_child(ce, child) {
> +             if (j++ < i) {
> +                     mutex_lock(&child->timeline->mutex);
> +                     intel_context_exit(child);
> +                     mutex_unlock(&child->timeline->mutex);
> +             }
> +     }
> +     for_each_child(ce, child)
> +             intel_context_unpin(child);

[...]

Reply via email to