Re: [PATCH 2/2] [RFC] drm/i915: Unbind the vma in suspend if it was bound

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 25, 2024 at 3:51 PM Vidya Srinivas <vidya.srinivas@xxxxxxxxx> wrote:
>
> In i915_ggtt_suspend_vm, if the vma was bound, the path
> to unbind/evict is not hitting during suspend. This is
> causing issues with DPT where DPT gets shrunk but the
> framebuffer is still on the DPT's bound list. This
> causes system reboot in some scenarios of suspend/resume
> where it tries to rewrite the PTEs via a stale mapping.
>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/gt/intel_ggtt.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ggtt.c b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> index d60a6ca0cae5..8499aa12a787 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ggtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ggtt.c
> @@ -157,13 +157,11 @@ void i915_ggtt_suspend_vm(struct i915_address_space *vm)
>                         goto retry;
>                 }
>
> -               if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND)) {
> +               if (!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND))
>                         i915_vma_wait_for_bind(vma);
>
> -                       __i915_vma_evict(vma, false);
> -                       drm_mm_remove_node(&vma->node);
> -               }
> -
> +               __i915_vma_evict(vma, false);
> +               drm_mm_remove_node(&vma->node);
>                 i915_gem_object_unlock(obj);
>         }

I think all you need is in the else path of if
(!i915_vma_is_bound(vma, I915_VMA_GLOBAL_BIND)) is a call to
__i915_vma_unbind(vma)

But we need Ville to confirm this makes sense?

>
> --
> 2.34.1
>




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux