From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
To: intel-gfx@lists.freedesktop.org, vinay.belgaumkar@intel.com
Cc: dev@lankhorst.se
Subject: [PATCH 1/3] drm/i915/pmu: Disable on PREEMPT_RT
Date: Tue, 29 Sep 2026 12:01:49 -0700 [thread overview]
Message-ID: <20260929190147.2886670-6-umesh.nerlige.ramappa@intel.com> (raw)
In-Reply-To: <20260929190147.2886670-5-umesh.nerlige.ramappa@intel.com>
From: Maarten Lankhorst <dev@lankhorst.se>
I tried to come up with alternative and lockless approaches
to make pmu work, but since the perf events are run in
atomic context on PREEMPT_RT, ordinary spinlocks no longer
work and forcewake and register accesses become problematic.
Disable perf events on PREEMPT_RT for now, without affecting
!PREEMPT_RT users.
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>
---
v2: s/reeturn/return/
---
drivers/gpu/drm/i915/i915_pmu.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_pmu.c b/drivers/gpu/drm/i915/i915_pmu.c
index 1c3bafda9c70..9ea5626399e5 100644
--- a/drivers/gpu/drm/i915/i915_pmu.c
+++ b/drivers/gpu/drm/i915/i915_pmu.c
@@ -1156,6 +1156,16 @@ void i915_pmu_register(struct drm_i915_private *i915)
};
int ret = -ENOMEM;
+ /*
+ * PREEMPT_RT has problems with forcewake. Forcewake is used by the
+ * engine 'busy' event when guc submission is enabled, and to measure
+ * rc6 residency.
+ *
+ * Disable pmu events on PREEMPT_RT entirely to prevent deadlocks.
+ */
+ if (IS_ENABLED(CONFIG_PREEMPT_RT))
+ return;
+
spin_lock_init(&pmu->lock);
hrtimer_setup(&pmu->timer, i915_sample, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
init_rc6(pmu);
--
2.55.0
next prev parent reply other threads:[~2026-09-29 19:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-29 19:01 [PATCH 0/3] Fixup deadlock scenarios in the PMU path Umesh Nerlige Ramappa
2026-09-29 19:01 ` Umesh Nerlige Ramappa [this message]
2026-09-30 5:42 ` [PATCH 1/3] drm/i915/pmu: Disable on PREEMPT_RT Maarten Lankhorst
2026-09-30 8:02 ` Tvrtko Ursulin
2026-09-30 13:25 ` Maarten Lankhorst
2026-10-01 12:15 ` Tvrtko Ursulin
2026-09-29 19:01 ` [PATCH 2/3] drm/i915/guc: Use a delayed wakeref put in guc_engine_busyness() Umesh Nerlige Ramappa
2026-09-29 19:01 ` [PATCH 3/3] drm/i915/pmu: Use a delayed wakeref put in get_rc6() Umesh Nerlige Ramappa
2026-09-29 21:35 ` ✓ i915.CI.BAT: success for Fixup deadlock scenarios in the PMU path (rev2) Patchwork
2026-09-30 7:26 ` ✗ i915.CI.Full: failure " 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=20260929190147.2886670-6-umesh.nerlige.ramappa@intel.com \
--to=umesh.nerlige.ramappa@intel.com \
--cc=dev@lankhorst.se \
--cc=intel-gfx@lists.freedesktop.org \
--cc=vinay.belgaumkar@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