[PATCH v1] drm/xe/throttle: Log throttle reasons

Raag Jadav raag.jadav at intel.com
Tue Nov 19 18:51:26 UTC 2024


On Fri, Nov 15, 2024 at 12:03:43PM -0800, Dixit, Ashutosh wrote:
> On Fri, 15 Nov 2024 11:54:46 -0800, Matthew Brost wrote:
> > On Fri, Nov 15, 2024 at 06:26:14PM +0530, Raag Jadav wrote:
> > > Log throttle register MMIO reads which will be useful for debugging.
> > >
> > > Signed-off-by: Raag Jadav <raag.jadav at intel.com>
> > > ---
> > >  drivers/gpu/drm/xe/xe_gt_throttle.c | 9 ++++++---
> > >  1 file changed, 6 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/xe/xe_gt_throttle.c b/drivers/gpu/drm/xe/xe_gt_throttle.c
> > > index 03b225364101..0ce21ffc08dc 100644
> > > --- a/drivers/gpu/drm/xe/xe_gt_throttle.c
> > > +++ b/drivers/gpu/drm/xe/xe_gt_throttle.c
> > > @@ -37,15 +37,18 @@ dev_to_gt(struct device *dev)
> > >
> > >  u32 xe_gt_throttle_get_limit_reasons(struct xe_gt *gt)
> > >  {
> > > +	struct xe_device *xe = gt_to_xe(gt);
> > > +	bool media = xe_gt_is_media_type(gt);
> > >	u32 reg;
> > >
> > > -	xe_pm_runtime_get(gt_to_xe(gt));
> > > -	if (xe_gt_is_media_type(gt))
> > > +	xe_pm_runtime_get(xe);
> > > +	if (media)
> > >		reg = xe_mmio_read32(&gt->mmio, MTL_MEDIA_PERF_LIMIT_REASONS);
> > >	else
> > >		reg = xe_mmio_read32(&gt->mmio, GT0_PERF_LIMIT_REASONS);
> > > -	xe_pm_runtime_put(gt_to_xe(gt));
> > > +	xe_pm_runtime_put(xe);
> > >
> > > +	drm_dbg(&xe->drm, "%s reg: 0x%x\n", media ? "media" : "gt", reg);
> >
> > How often does this happen? i.e. Is this common enough that it will spam
> > dmesg when running IGTs. I find messages which spam dmesg very annoying.
> > See this patch [1] I posted to remove one of these.
> 
> How about reading via debugfs as in i915? Also, looks like we don't have a
> means to clear the top 16 'latched' bits yet?

It seems the latched bits are only for logging and don't have any effect
on lower bits which indicate realtime throttling.

We can add them if we care about history, although I'm not sure if that's
the usecase.

Raag


More information about the Intel-xe mailing list