Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: Oak Zeng <oak.zeng@intel.com>, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/xe: unlock object in an error condition
Date: Fri, 29 Nov 2024 09:37:23 +0100	[thread overview]
Message-ID: <665583917e387e1cebc18a9c88fd8dd4f199f752.camel@linux.intel.com> (raw)
In-Reply-To: <20241128213408.1821171-1-oak.zeng@intel.com>

Hi, Oak,


On Thu, 2024-11-28 at 16:34 -0500, Oak Zeng wrote:
> In xe_gem_fault, we reserved a buffer object but didn't unreserve
> it under an error condition. Unreserve it.
> 
> Signed-off-by: Oak Zeng <oak.zeng@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_bo.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index f51d86511cb9e..634a1b54ca60d 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -1286,7 +1286,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault
> *vmf)
>  	}
>  
>  	if (ret == VM_FAULT_RETRY && !(vmf->flags &
> FAULT_FLAG_RETRY_NOWAIT))
> -		goto out;
> +		goto unlock;

This change is not correct. On fault retries, the dma_resv lock and the
mmap lock is already dropped by the ttm helpers. This weird construct
is to allow wait for io outside wide locks, and then restart the fault.

So this patch can be dropped.

Thanks,
Thomas




>  	/*
>  	 * ttm_bo_vm_reserve() already has dma_resv_lock.
>  	 */
> @@ -1297,6 +1297,7 @@ static vm_fault_t xe_gem_fault(struct vm_fault
> *vmf)
>  		mutex_unlock(&xe->mem_access.vram_userfault.lock);
>  	}
>  
> +unlock:
>  	dma_resv_unlock(tbo->base.resv);
>  out:
>  	if (needs_rpm)


  parent reply	other threads:[~2024-11-29  8:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-28 21:34 [PATCH] drm/xe: unlock object in an error condition Oak Zeng
2024-11-28 22:48 ` ✓ CI.Patch_applied: success for " Patchwork
2024-11-28 22:48 ` ✓ CI.checkpatch: " Patchwork
2024-11-28 22:49 ` ✓ CI.KUnit: " Patchwork
2024-11-28 23:07 ` ✓ CI.Build: " Patchwork
2024-11-28 23:09 ` ✓ CI.Hooks: " Patchwork
2024-11-28 23:11 ` ✓ CI.checksparse: " Patchwork
2024-11-28 23:34 ` ✗ Xe.CI.BAT: failure " Patchwork
2024-11-29  8:37 ` Thomas Hellström [this message]
2024-11-29 16:05   ` [PATCH] " Zeng, Oak
2024-11-29 12:47 ` ✗ Xe.CI.Full: failure for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=665583917e387e1cebc18a9c88fd8dd4f199f752.camel@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=oak.zeng@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox