public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Das, Nirmoy" <nirmoy.das@intel.com>
To: <intel-gfx@lists.freedesktop.org>
Cc: matthew.auld@intel.com, dri-devel@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Do not cleanup obj with NULL bo->resource
Date: Wed, 21 Sep 2022 10:27:04 +0200	[thread overview]
Message-ID: <02c3f43a-4077-3f0a-526c-cd485a8a8711@intel.com> (raw)
In-Reply-To: <20220920170628.3391-1-nirmoy.das@intel.com>

Hi Matt

On 9/20/2022 7:06 PM, Nirmoy Das wrote:
> For delayed BO release i915_ttm_delete_mem_notify()
> gets called twice, once with proper bo->resource and
> another time with NULL. We shouldn't do anything for
> the 2nd time as we already cleanedup the obj once.
>
> References: https://gitlab.freedesktop.org/drm/intel/-/issues/6850


Please add the below Fixes before merging, I missed that.

Fixes: ad74457a6b5a96 ("drm/i915/dgfx: Release mmap on rpm suspend")

Thanks,
Nirmoy

> Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>   drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> index 0544b0a4a43a..e3fc38dd5db0 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c
> @@ -511,7 +511,7 @@ static void i915_ttm_delete_mem_notify(struct ttm_buffer_object *bo)
>   	struct drm_i915_gem_object *obj = i915_ttm_to_gem(bo);
>   	intel_wakeref_t wakeref = 0;
>   
> -	if (likely(obj)) {
> +	if (bo->resource && likely(obj)) {
>   		/* ttm_bo_release() already has dma_resv_lock */
>   		if (i915_ttm_cpu_maps_iomem(bo->resource))
>   			wakeref = intel_runtime_pm_get(&to_i915(obj->base.dev)->runtime_pm);

      parent reply	other threads:[~2022-09-21  8:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-20 17:06 [Intel-gfx] [PATCH] drm/i915: Do not cleanup obj with NULL bo->resource Nirmoy Das
2022-09-20 17:13 ` Matthew Auld
2022-09-21  7:52   ` Christian König
2022-09-20 17:53 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-09-20 23:37 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-09-21  8:27 ` Das, Nirmoy [this message]

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=02c3f43a-4077-3f0a-526c-cd485a8a8711@intel.com \
    --to=nirmoy.das@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@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