Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Souza, Jose" <jose.souza@intel.com>
To: "Roper, Matthew D" <matthew.d.roper@intel.com>
Cc: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
	"Vivi,  Rodrigo" <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v3 3/6] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot
Date: Mon, 29 Jan 2024 21:20:55 +0000	[thread overview]
Message-ID: <b37001dd5dd865b8a428faf3059f82572af25030.camel@intel.com> (raw)
In-Reply-To: <20240129211639.GL5506@mdroper-desk1.amr.corp.intel.com>

On Mon, 2024-01-29 at 13:16 -0800, Matt Roper wrote:
> On Mon, Jan 29, 2024 at 10:17:39AM -0800, José Roberto de Souza wrote:
> > A future patch will require gt and xe device structs, so here
> > replacing class by hwe.
> 
> I thought this didn't work because in cases like a failure during probe
> the the devcoredump can persist for a while after the xe_device (and
> xe_gt, and xe_hw_engine) have all been kfree'd?
> 
> I.e., we can use the GT or HWE during the capture phase, but by the time
> we get to the print phase they may already have been deallocated and we
> can't touch anything except the data we've already stashed away locally?

No, devcoredump needs to be removed before xe_device.
Rodrigo is even fixing devcoredump to do that: https://lore.kernel.org/all/20240117195349.343083-1-rodrigo.vivi@intel.com/T/

> 
> 
> Matt
> 
> > 
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Matt Roper <matthew.d.roper@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> >  drivers/gpu/drm/xe/xe_hw_engine.c       | 6 +++---
> >  drivers/gpu/drm/xe/xe_hw_engine_types.h | 4 ++--
> >  2 files changed, 5 insertions(+), 5 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/xe/xe_hw_engine.c b/drivers/gpu/drm/xe/xe_hw_engine.c
> > index 0d17e32d70c87..61b0c18d8b624 100644
> > --- a/drivers/gpu/drm/xe/xe_hw_engine.c
> > +++ b/drivers/gpu/drm/xe/xe_hw_engine.c
> > @@ -760,7 +760,7 @@ xe_hw_engine_snapshot_capture(struct xe_hw_engine *hwe)
> >  		return NULL;
> >  
> >  	snapshot->name = kstrdup(hwe->name, GFP_ATOMIC);
> > -	snapshot->class = hwe->class;
> > +	snapshot->hwe = hwe;
> >  	snapshot->logical_instance = hwe->logical_instance;
> >  	snapshot->forcewake.domain = hwe->domain;
> >  	snapshot->forcewake.ref = xe_force_wake_ref(gt_to_fw(hwe->gt),
> > @@ -807,7 +807,7 @@ xe_hw_engine_snapshot_capture(struct xe_hw_engine *hwe)
> >  	snapshot->reg.ring_eir = hw_engine_mmio_read32(hwe, RING_EIR(0));
> >  	snapshot->reg.ipehr = hw_engine_mmio_read32(hwe, RING_IPEHR(0));
> >  
> > -	if (snapshot->class == XE_ENGINE_CLASS_COMPUTE)
> > +	if (snapshot->hwe->class == XE_ENGINE_CLASS_COMPUTE)
> >  		snapshot->reg.rcu_mode = xe_mmio_read32(hwe->gt, RCU_MODE);
> >  
> >  	return snapshot;
> > @@ -852,7 +852,7 @@ void xe_hw_engine_snapshot_print(struct xe_hw_engine_snapshot *snapshot,
> >  	drm_printf(p, "\tBBADDR: 0x%016llx\n", snapshot->reg.ring_bbaddr);
> >  	drm_printf(p, "\tDMA_FADDR: 0x%016llx\n", snapshot->reg.ring_dma_fadd);
> >  	drm_printf(p, "\tIPEHR: 0x%08x\n", snapshot->reg.ipehr);
> > -	if (snapshot->class == XE_ENGINE_CLASS_COMPUTE)
> > +	if (snapshot->hwe->class == XE_ENGINE_CLASS_COMPUTE)
> >  		drm_printf(p, "\tRCU_MODE: 0x%08x\n",
> >  			   snapshot->reg.rcu_mode);
> >  }
> > diff --git a/drivers/gpu/drm/xe/xe_hw_engine_types.h b/drivers/gpu/drm/xe/xe_hw_engine_types.h
> > index d7f828c76cc5f..27deaa31efd31 100644
> > --- a/drivers/gpu/drm/xe/xe_hw_engine_types.h
> > +++ b/drivers/gpu/drm/xe/xe_hw_engine_types.h
> > @@ -158,8 +158,8 @@ struct xe_hw_engine {
> >  struct xe_hw_engine_snapshot {
> >  	/** @name: name of the hw engine */
> >  	char *name;
> > -	/** @class: class of this hw engine */
> > -	enum xe_engine_class class;
> > +	/** @hwe: hw engine */
> > +	struct xe_hw_engine *hwe;
> >  	/** @logical_instance: logical instance of this hw engine */
> >  	u16 logical_instance;
> >  	/** @forcewake: Force Wake information snapshot */
> > -- 
> > 2.43.0
> > 
> 


  reply	other threads:[~2024-01-29 21:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-29 18:17 [PATCH v3 1/6] drm/xe: Add functions to convert regular address to canonical address and back José Roberto de Souza
2024-01-29 18:17 ` [PATCH v3 2/6] drm/xe: Add batch buffer addresses to devcoredump José Roberto de Souza
2024-01-29 18:17 ` [PATCH v3 3/6] drm/xe: Store xe_he_engine in xe_hw_engine_snapshot José Roberto de Souza
2024-01-29 21:16   ` Matt Roper
2024-01-29 21:20     ` Souza, Jose [this message]
2024-01-29 18:17 ` [PATCH v3 4/6] drm/xe: Add misc functions to support read of specific DSS registers José Roberto de Souza
2024-01-29 21:24   ` Matt Roper
2024-01-30 14:42     ` Souza, Jose
2024-01-30 15:54       ` Dong, Zhanjun
2024-01-30 16:14         ` Souza, Jose
2024-01-30 16:52           ` Dong, Zhanjun
2024-01-29 18:17 ` [PATCH v3 5/6] drm/xe: Move XE_MAX_EU_FUSE_BITS to xe_gt_types.h José Roberto de Souza
2024-01-29 18:17 ` [PATCH v3 6/6] drm/xe: Add INSTDONE registers to devcoredump José Roberto de Souza
2024-01-29 18:21 ` ✓ CI.Patch_applied: success for series starting with [v3,1/6] drm/xe: Add functions to convert regular address to canonical address and back Patchwork
2024-01-29 18:21 ` ✗ CI.checkpatch: warning " Patchwork
2024-01-29 18:22 ` ✓ CI.KUnit: success " Patchwork
2024-01-29 18:29 ` ✓ CI.Build: " Patchwork
2024-01-29 18:30 ` ✗ CI.Hooks: failure " Patchwork
2024-01-29 18:31 ` ✓ CI.checksparse: success " Patchwork
2024-01-29 18:55 ` ✓ CI.BAT: " Patchwork
2024-01-29 21:13 ` [PATCH v3 1/6] " Matt Roper
2024-01-29 21:24   ` Souza, Jose

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=b37001dd5dd865b8a428faf3059f82572af25030.camel@intel.com \
    --to=jose.souza@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.d.roper@intel.com \
    --cc=rodrigo.vivi@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