From: Matthew Brost <matthew.brost@intel.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>
Cc: <thomas.hellstrom@linux.intel.com>,
<intel-xe@lists.freedesktop.org>,
<dri-devel@lists.freedesktop.org>, <matthew.auld@intel.com>
Subject: Re: [PATCH 3/6] drm/ttm: fix error handling in ttm_buffer_object_transfer
Date: Mon, 23 Jun 2025 19:24:39 -0700 [thread overview]
Message-ID: <aFoMZ6TMZOVKA2R/@lstrano-desk.jf.intel.com> (raw)
In-Reply-To: <20250616130726.22863-3-christian.koenig@amd.com>
On Mon, Jun 16, 2025 at 03:07:23PM +0200, Christian König wrote:
> Unlocking the resv object was missing in the error path, additionally to
> that we should move over the resource only after the fence slot was
> reserved.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
Fixes tag?
You probably can merge this one by itself ahead of the rest of the series.
With that:
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> ---
> drivers/gpu/drm/ttm/ttm_bo_util.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index b78365dc1fed..56f3152f34f5 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -256,6 +256,13 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
> ret = dma_resv_trylock(&fbo->base.base._resv);
> WARN_ON(!ret);
>
> + ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
> + if (ret) {
> + dma_resv_unlock(&fbo->base.base._resv);
> + kfree(fbo);
> + return ret;
> + }
> +
> if (fbo->base.resource) {
> ttm_resource_set_bo(fbo->base.resource, &fbo->base);
> bo->resource = NULL;
> @@ -264,12 +271,6 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
> fbo->base.bulk_move = NULL;
> }
>
> - ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1);
> - if (ret) {
> - kfree(fbo);
> - return ret;
> - }
> -
> ttm_bo_get(bo);
> fbo->bo = bo;
>
> --
> 2.34.1
>
next prev parent reply other threads:[~2025-06-24 2:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-16 13:07 [PATCH 1/6] drm/vmwgfx: drop printing the TTM refcount for debugging Christian König
2025-06-16 13:07 ` [PATCH 2/6] drm/xe: stop asserting on the TTM refcount Christian König
2025-06-23 14:54 ` Matthew Brost
2025-06-16 13:07 ` [PATCH 3/6] drm/ttm: fix error handling in ttm_buffer_object_transfer Christian König
2025-06-24 2:24 ` Matthew Brost [this message]
2025-06-16 13:07 ` [PATCH 4/6] drm/ttm: rename ttm_bo_put to _fini Christian König
2025-06-17 2:08 ` kernel test robot
2025-06-16 13:07 ` [PATCH 5/6] drm/ttm: disable ttm_bo_validate_deleted_evict for now Christian König
2025-06-16 13:07 ` [PATCH 6/6] drm/ttm: replace TTMs refcount with the DRM refcount Christian König
2025-06-17 4:27 ` kernel test robot
2025-06-17 10:18 ` Thomas Hellström
2025-06-16 14:23 ` ✗ LGCI.VerificationFailed: failure for series starting with [1/6] drm/vmwgfx: drop printing the TTM refcount for debugging Patchwork
2025-06-23 9:35 ` ✗ CI.checkpatch: warning for series starting with [1/6] drm/vmwgfx: drop printing the TTM refcount for debugging (rev2) Patchwork
2025-06-23 9:36 ` ✗ CI.KUnit: failure " Patchwork
2025-06-23 19:02 ` [PATCH 1/6] drm/vmwgfx: drop printing the TTM refcount for debugging Ian Forbes
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=aFoMZ6TMZOVKA2R/@lstrano-desk.jf.intel.com \
--to=matthew.brost@intel.com \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=matthew.auld@intel.com \
--cc=thomas.hellstrom@linux.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