All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm/ttm: fix pipelined gutting
Date: Tue, 8 Jun 2021 10:12:31 +0200	[thread overview]
Message-ID: <19fb55aa-c093-5c8c-daea-bad378964af7@linux.intel.com> (raw)
In-Reply-To: <20210608075021.3058-1-christian.koenig@amd.com>


On 6/8/21 9:50 AM, Christian König wrote:
> We need to make sure to allocate the sys_mem resource before the point
> of no return.
>
> Signed-off-by: Christian König <christian.koenig@amd.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo_util.c | 22 ++++++++++++++++------
>   1 file changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 9be6a10a5873..eccf2ad8f335 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -582,6 +582,7 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
>   {
>   	static const struct ttm_place sys_mem = { .mem_type = TTM_PL_SYSTEM };
>   	struct ttm_buffer_object *ghost;
> +	struct ttm_resource *sys_res;
>   	struct ttm_tt *ttm;
>   	int ret;
>   
> @@ -602,6 +603,9 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
>   		return ttm_resource_alloc(bo, &sys_mem, &bo->resource);
>   	}
>   
> +
> +	ret = ttm_resource_alloc(bo, &sys_mem, &sys_res);

This needs to be moved higher up to also cover the idle optimization path.
Also the return value doesn't seem to be checked?

/Thomas



  reply	other threads:[~2021-06-08  8:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-08  7:50 [PATCH] drm/ttm: fix pipelined gutting Christian König
2021-06-08  8:12 ` Thomas Hellström [this message]
2021-06-08 12:03 ` kernel test robot
2021-06-08 12:03   ` kernel test robot
2021-06-09  1:50 ` kernel test robot
2021-06-09  1:50   ` kernel test robot

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=19fb55aa-c093-5c8c-daea-bad378964af7@linux.intel.com \
    --to=thomas.hellstrom@linux.intel.com \
    --cc=ckoenig.leichtzumerken@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.