All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/uncore: Warn on previous unclaimed accesses
Date: Fri, 8 Apr 2022 13:44:44 +0100	[thread overview]
Message-ID: <71468da0-d379-6a78-a322-8244c8d5a668@linux.intel.com> (raw)
In-Reply-To: <20220405001149.2675226-1-lucas.demarchi@intel.com>


On 05/04/2022 01:11, Lucas De Marchi wrote:
> Since gen6 we use FPGA_DBG register to detect unclaimed MMIO registers.
> This register is in the display engine IP and can only ever detect
> unclaimed accesses to registers in this area. However sometimes there
> are reports of this triggering for registers in other areas, which
> should not be possible.
> 
> Right now we always warn after the read/write of registers going through
> unclaimed_reg_debug(). However places using __raw_uncore_* may be
> triggering the unclaimed access and those being later accounted to a
> different register. Let's warn both before and after the read/write
> with a slightly different message, so it's clear if the register
> reported in the warning is actually the culprit.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

I see this triggering a lot on drm-tip today (TGL), is that expected?

[    3.994907] i915 0000:00:02.0: [drm:intel_uncore_init_mmio [i915]] unclaimed mmio detected on uncore init, clearing
[    4.392525] i915 0000:00:02.0: Unclaimed access detected before read from register 0x44408
[    5.669929] i915 0000:00:02.0: Unclaimed access detected before write to register 0x50380
[    6.652808] i915 0000:00:02.0: Unclaimed access detected before write to register 0x50380
[   13.015978] i915 0000:00:02.0: Unclaimed access detected before write to register 0x50380
[   16.876802] i915 0000:00:02.0: Unclaimed access detected before write to register 0x44404
[   45.174395] i915 0000:00:02.0: Unclaimed access detected before write to register 0x44404

It continues at runtime as well:

[10265.010902] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10329.093078] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10354.060331] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10385.486480] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10408.910533] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10433.398443] i915 0000:00:02.0: Unclaimed access detected before write to register 0x1900ec
[10444.110593] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10468.302627] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10493.398727] i915 0000:00:02.0: Unclaimed access detected before write to register 0x1900ec
[10515.366845] i915 0000:00:02.0: Unclaimed access detected before read from register 0x44408
[10518.674046] i915 0000:00:02.0: Unclaimed access detected before read from register 0xc7204
[10529.934735] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10553.398808] i915 0000:00:02.0: Unclaimed access detected before write to register 0x1900ec
[10599.684455] i915 0000:00:02.0: Unclaimed access detected before read from register 0xc4008
[10602.898167] i915 0000:00:02.0: Unclaimed access detected before read from register 0xc7204
[10613.398909] i915 0000:00:02.0: Unclaimed access detected before write to register 0x1900ec
[10686.006783] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10711.906813] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10745.860538] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10771.812277] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10805.903058] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10831.927073] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10853.398958] i915 0000:00:02.0: Unclaimed access detected before write to register 0x1900ec
[10866.007084] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10879.378435] i915 0000:00:02.0: Unclaimed access detected before read from register 0xc7204
[10891.727120] i915 0000:00:02.0: Unclaimed access detected before write to register 0x190030
[10913.395161] i915 0000:00:02.0: Unclaimed access detected before write to register 0x1900ec
[10939.026480] i915 0000:00:02.0: Unclaimed access detected before read from register 0xc7204
[10964.626494] i915 0000:00:02.0: Unclaimed access detected before read from register 0xc7204

It don't think this machine had a problem with this before, or perhaps it was going undetected?

Regards,

Tvrtko

> ---
>   drivers/gpu/drm/i915/intel_uncore.c | 29 +++++++++++++++++++++--------
>   1 file changed, 21 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index 8b9caaaacc21..df59ec88459e 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -1502,11 +1502,10 @@ ilk_dummy_write(struct intel_uncore *uncore)
>   static void
>   __unclaimed_reg_debug(struct intel_uncore *uncore,
>   		      const i915_reg_t reg,
> -		      const bool read,
> -		      const bool before)
> +		      const bool read)
>   {
>   	if (drm_WARN(&uncore->i915->drm,
> -		     check_for_unclaimed_mmio(uncore) && !before,
> +		     check_for_unclaimed_mmio(uncore),
>   		     "Unclaimed %s register 0x%x\n",
>   		     read ? "read from" : "write to",
>   		     i915_mmio_reg_offset(reg)))
> @@ -1514,6 +1513,20 @@ __unclaimed_reg_debug(struct intel_uncore *uncore,
>   		uncore->i915->params.mmio_debug--;
>   }
>   
> +static void
> +__unclaimed_previous_reg_debug(struct intel_uncore *uncore,
> +			       const i915_reg_t reg,
> +			       const bool read)
> +{
> +	if (drm_WARN(&uncore->i915->drm,
> +		     check_for_unclaimed_mmio(uncore),
> +		     "Unclaimed access detected before %s register 0x%x\n",
> +		     read ? "read from" : "write to",
> +		     i915_mmio_reg_offset(reg)))
> +		/* Only report the first N failures */
> +		uncore->i915->params.mmio_debug--;
> +}
> +
>   static inline void
>   unclaimed_reg_debug(struct intel_uncore *uncore,
>   		    const i915_reg_t reg,
> @@ -1526,13 +1539,13 @@ unclaimed_reg_debug(struct intel_uncore *uncore,
>   	/* interrupts are disabled and re-enabled around uncore->lock usage */
>   	lockdep_assert_held(&uncore->lock);
>   
> -	if (before)
> +	if (before) {
>   		spin_lock(&uncore->debug->lock);
> -
> -	__unclaimed_reg_debug(uncore, reg, read, before);
> -
> -	if (!before)
> +		__unclaimed_previous_reg_debug(uncore, reg, read);
> +	} else {
> +		__unclaimed_reg_debug(uncore, reg, read);
>   		spin_unlock(&uncore->debug->lock);
> +	}
>   }
>   
>   #define __vgpu_read(x) \

  parent reply	other threads:[~2022-04-08 12:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-05  0:11 [Intel-gfx] [PATCH] drm/i915/uncore: Warn on previous unclaimed accesses Lucas De Marchi
2022-04-05  1:29 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2022-04-05  9:43 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-04-05 15:19   ` Lucas De Marchi
2022-04-05 17:07     ` Vudum, Lakshminarayana
2022-04-05 16:30 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
2022-04-06  4:02 ` [Intel-gfx] [PATCH] " Matt Roper
2022-04-06  5:53   ` Lucas De Marchi
2022-04-06 20:35     ` Lucas De Marchi
2022-04-08 12:44 ` Tvrtko Ursulin [this message]
2022-04-08 15:00   ` Lucas De Marchi

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=71468da0-d379-6a78-a322-8244c8d5a668@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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 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.