All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 6/9] drm/i915/uncore: Don't meddle with mmio debug upon user forcewake
Date: Fri, 06 Nov 2026 16:58:56 +0200	[thread overview]
Message-ID: <f8a0ccccfd1929ef7d845507f2cb8eb960d9fcad@intel.com> (raw)
In-Reply-To: <20261104221842.18799-7-ville.syrjala@linux.intel.com>

On Thu, 05 Nov 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Currently when userspace takes the forcewake via debugfs, the
> kernel will stop looking for unclaimed mmio accesses. That link
> is kinda weird since forcewake is for GT stuff and unclaimed
> mmio detection is for display stuff.
>
> Just kill the mmio debug suspend/resume upon user forcewake.
> One should almost always use IGT_NO_FORCEWAKE=1 when poking
> at display register from userspace anyway so as to not
> perturb the rest of the system.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_uncore.c | 46 ++---------------------------
>  drivers/gpu/drm/i915/intel_uncore.h |  2 --
>  2 files changed, 2 insertions(+), 46 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_uncore.c b/drivers/gpu/drm/i915/intel_uncore.c
> index e360e4f9d9a2..abd695e880c1 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.c
> +++ b/drivers/gpu/drm/i915/intel_uncore.c
> @@ -65,41 +65,6 @@ intel_uncore_mmio_debug_init_early(struct drm_i915_private *i915)
>  	i915->uncore.debug = &i915->mmio_debug;
>  }
>  
> -static void mmio_debug_suspend(struct intel_uncore *uncore)
> -{
> -	if (!uncore->debug)
> -		return;
> -
> -	spin_lock(&uncore->debug->lock);
> -
> -	/* Save and disable mmio debugging for the user bypass */
> -	if (!uncore->debug->suspend_count++) {
> -		uncore->debug->saved_mmio_check = uncore->debug->unclaimed_mmio_check;
> -		uncore->debug->unclaimed_mmio_check = 0;
> -	}
> -
> -	spin_unlock(&uncore->debug->lock);
> -}
> -
> -static bool check_for_unclaimed_mmio(struct intel_uncore *uncore);
> -
> -static void mmio_debug_resume(struct intel_uncore *uncore)
> -{
> -	if (!uncore->debug)
> -		return;
> -
> -	spin_lock(&uncore->debug->lock);
> -
> -	if (!--uncore->debug->suspend_count)
> -		uncore->debug->unclaimed_mmio_check = uncore->debug->saved_mmio_check;
> -
> -	if (check_for_unclaimed_mmio(uncore))
> -		drm_info(&uncore->i915->drm,
> -			 "Invalid mmio detected during user access\n");
> -
> -	spin_unlock(&uncore->debug->lock);
> -}
> -
>  static const char * const forcewake_domain_names[] = {
>  	"render",
>  	"gt",
> @@ -598,9 +563,6 @@ check_for_unclaimed_mmio(struct intel_uncore *uncore)
>  
>  	lockdep_assert_held(&uncore->debug->lock);
>  
> -	if (uncore->debug->suspend_count)
> -		return false;
> -
>  	if (intel_uncore_has_fpga_dbg_unclaimed(uncore))
>  		ret |= fpga_check_for_unclaimed_mmio(uncore);
>  
> @@ -733,10 +695,8 @@ void intel_uncore_forcewake_get(struct intel_uncore *uncore,
>  void intel_uncore_forcewake_user_get(struct intel_uncore *uncore)
>  {
>  	spin_lock_irq(&uncore->lock);
> -	if (!uncore->user_forcewake_count++) {
> +	if (!uncore->user_forcewake_count++)
>  		intel_uncore_forcewake_get__locked(uncore, FORCEWAKE_ALL);
> -		mmio_debug_suspend(uncore);
> -	}
>  	spin_unlock_irq(&uncore->lock);
>  }
>  
> @@ -750,10 +710,8 @@ void intel_uncore_forcewake_user_get(struct intel_uncore *uncore)
>  void intel_uncore_forcewake_user_put(struct intel_uncore *uncore)
>  {
>  	spin_lock_irq(&uncore->lock);
> -	if (!--uncore->user_forcewake_count) {
> -		mmio_debug_resume(uncore);
> +	if (!--uncore->user_forcewake_count)
>  		intel_uncore_forcewake_put__locked(uncore, FORCEWAKE_ALL);
> -	}
>  	spin_unlock_irq(&uncore->lock);
>  }
>  
> diff --git a/drivers/gpu/drm/i915/intel_uncore.h b/drivers/gpu/drm/i915/intel_uncore.h
> index fafc2ca9a237..4ec7c545d04e 100644
> --- a/drivers/gpu/drm/i915/intel_uncore.h
> +++ b/drivers/gpu/drm/i915/intel_uncore.h
> @@ -42,8 +42,6 @@ struct intel_gt;
>  struct intel_uncore_mmio_debug {
>  	spinlock_t lock; /** lock is also taken in irq contexts. */
>  	int unclaimed_mmio_check;
> -	int saved_mmio_check;
> -	u32 suspend_count;
>  };
>  
>  enum forcewake_domain_id {

-- 
Jani Nikula, Intel

  reply	other threads:[~2026-11-06 14:59 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-04 22:18 [PATCH 0/9] drm/i915/de: Work towards uncore elimination Ville Syrjala
2026-11-04 22:18 ` [PATCH 1/9] drm/i915/de: Introduce dislay->mmio and intel_de_init() Ville Syrjala
2026-11-04 22:31   ` sashiko-bot
2026-11-05  8:58     ` Jani Nikula
2026-11-05 20:03     ` Ville Syrjälä
2026-11-04 23:29   ` Michał Grzelak
2026-11-04 22:18 ` [PATCH 2/9] drm/i915/de: Convert intel_de_{read,write}() into vfuncs Ville Syrjala
2026-11-06 14:50   ` Jani Nikula
2026-11-06 15:35     ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 3/9] drm/i915/de: Introduce mmio read/write templates Ville Syrjala
2026-11-04 23:32   ` Michał Grzelak
2026-11-06 14:52   ` Jani Nikula
2026-11-06 16:03     ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 4/9] drm/i915/de: Eliminate runtime overhead from DMC wakelock on pre-LNL platforms Ville Syrjala
2026-11-06 14:53   ` Jani Nikula
2026-11-04 22:18 ` [PATCH 5/9] drm/i915/de: Introduce display->mmio.lock Ville Syrjala
2026-11-04 22:35   ` sashiko-bot
2026-11-05  9:32   ` Jani Nikula
2026-11-05 13:43     ` Ville Syrjälä
2026-11-05 13:47       ` Jani Nikula
2026-11-06 14:55   ` Jani Nikula
2026-11-04 22:18 ` [PATCH 6/9] drm/i915/uncore: Don't meddle with mmio debug upon user forcewake Ville Syrjala
2026-11-06 14:58   ` Jani Nikula [this message]
2026-11-04 22:18 ` [PATCH 7/9] drm/i915/de: Move unclaimed mmio detection into display code Ville Syrjala
2026-11-04 22:36   ` sashiko-bot
2026-11-06 16:19     ` Ville Syrjälä
2026-11-06 16:39   ` Jani Nikula
2026-11-06 17:24     ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 8/9] drm/i915/de: Stop using intel_uncore_{read,write}() Ville Syrjala
2026-11-06 15:37   ` Jani Nikula
2026-11-06 15:55     ` Ville Syrjälä
2026-11-04 22:18 ` [PATCH 9/9] drm/xe: Nuke the intel_uncore_{read,write}() wrappers Ville Syrjala
2026-11-06 15:38   ` [PATCH 9/9] drm/xe: Nuke the intel_uncore_{read, write}() wrappers Jani Nikula
2026-11-05  0:01 ` ✗ CI.checkpatch: warning for drm/i915/de: Work towards uncore elimination Patchwork
2026-11-05  0:03 ` ✓ CI.KUnit: success " Patchwork
2026-11-05  0:40 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-05  2:14 ` ✓ i915.CI.BAT: " Patchwork
2026-11-05  4:38 ` ✓ i915.CI.Full: " Patchwork
2026-11-05  7:10 ` ✗ CI.checkpatch: warning for drm/i915/de: Work towards uncore elimination (rev2) Patchwork
2026-11-05  7:13 ` ✓ CI.KUnit: success " Patchwork
2026-11-05  7:47 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-06  1:17 ` ✓ Xe.CI.FULL: " Patchwork

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=f8a0ccccfd1929ef7d845507f2cb8eb960d9fcad@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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.