public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: John.C.Harrison@Intel.com, Intel-GFX@Lists.FreeDesktop.Org
Subject: Re: [Intel-gfx] [PATCH 3/4] drm/i915/guc: Clear pointers on free
Date: Fri, 9 Oct 2020 14:43:42 -0700	[thread overview]
Message-ID: <c5477b1a-2827-2499-ac54-b3f0b57314fa@intel.com> (raw)
In-Reply-To: <20200925232637.1968039-4-John.C.Harrison@Intel.com>



On 9/25/2020 4:26 PM, John.C.Harrison@Intel.com wrote:
> From: John Harrison <John.C.Harrison@Intel.com>
>
> Was hitting null pointers and similar issues when running various
> module load/unload and inject failure type tests. So clear those
> pointers down when the objects have been de-allocated.

Had a quick chat with John about the incorrect pointer access, since the 
cleanup wouldn't fix the fact we're accessing a pointer after the 
relevant object was deallocated. None of the errors he hit are actually 
in the tree at the moment, the cleanup is just to make the errors 
slightly clearer in case we accidentally introduce new ones.
With a reworded commit message to better explain the above:

Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>

Daniele

> Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
> ---
>   drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c | 1 +
>   drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c  | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
> index 7950d28beb8c..5212ff844292 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ads.c
> @@ -220,6 +220,7 @@ int intel_guc_ads_create(struct intel_guc *guc)
>   void intel_guc_ads_destroy(struct intel_guc *guc)
>   {
>   	i915_vma_unpin_and_release(&guc->ads_vma, I915_VMA_RELEASE_MAP);
> +	guc->ads_blob = NULL;
>   }
>   
>   static void guc_ads_private_data_reset(struct intel_guc *guc)
> diff --git a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> index 11742fca0e9e..fa9e048cc65f 100644
> --- a/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> +++ b/drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c
> @@ -210,6 +210,7 @@ void intel_guc_ct_fini(struct intel_guc_ct *ct)
>   	GEM_BUG_ON(ct->enabled);
>   
>   	i915_vma_unpin_and_release(&ct->vma, I915_VMA_RELEASE_MAP);
> +	memset(ct, 0, sizeof(*ct));
>   }
>   
>   /**

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-10-09 21:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25 23:26 [Intel-gfx] [PATCH 0/4] drm/i915/guc: Update to GuC v49 John.C.Harrison
2020-09-25 23:26 ` [Intel-gfx] [PATCH 1/4] drm/i915/guc: Update to use firmware v49.0.1 John.C.Harrison
2020-10-01  0:24   ` Daniele Ceraolo Spurio
2020-09-25 23:26 ` [Intel-gfx] [PATCH 2/4] drm/i915/guc: Improved reporting when GuC fails to load John.C.Harrison
2020-10-01  0:38   ` Daniele Ceraolo Spurio
2020-09-25 23:26 ` [Intel-gfx] [PATCH 3/4] drm/i915/guc: Clear pointers on free John.C.Harrison
2020-10-09 21:43   ` Daniele Ceraolo Spurio [this message]
2020-09-25 23:26 ` [Intel-gfx] [PATCH 4/4] drm/i915/uc: turn on GuC/HuC auto mode by default John.C.Harrison
2020-09-25 23:48 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/guc: Update to GuC v49 Patchwork
2020-09-26  0:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-09-26  1:38 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2020-09-21 17:54 [Intel-gfx] [PATCH 0/4] " John.C.Harrison
2020-09-21 17:54 ` [Intel-gfx] [PATCH 3/4] drm/i915/guc: Clear pointers on free John.C.Harrison

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=c5477b1a-2827-2499-ac54-b3f0b57314fa@intel.com \
    --to=daniele.ceraolospurio@intel.com \
    --cc=Intel-GFX@Lists.FreeDesktop.Org \
    --cc=John.C.Harrison@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