[Intel-gfx] [PATCH] drm/i915: Flush the i915_vm_release before ggtt shutdown
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Mon Jul 29 14:17:18 UTC 2019
On 29/07/2019 14:24, Chris Wilson wrote:
> As the gen6_ppgtt may refer back to the GGTT for their page-directory
> slots, make sure those __i915_vm_release are completed prior to shutting
> down the GGTT.
>
> Fixes: b32fa8111563 ("drm/i915/gtt: Defer address space cleanup to an RCU worker")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
> ---
> The workers are RCU deferred so need a barrier to first flush the frees
> onto the workqueue.
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index 4dd1fa956143..423c890d03bf 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -2721,6 +2721,9 @@ static void ggtt_cleanup_hw(struct i915_ggtt *ggtt)
>
> ggtt->vm.closed = true;
>
> + rcu_barrier(); /* flush the RCU'ed__i915_vm_release */
> + flush_workqueue(i915->wq);
> +
> mutex_lock(&i915->drm.struct_mutex);
>
> list_for_each_entry_safe(vma, vn, &ggtt->vm.bound_list, vm_link)
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Regards,
Tvrtko
More information about the Intel-gfx
mailing list