Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/2] drm/xe/pmu: Don't let open PMU events block S0ix and GT C6
@ 2026-12-02 20:51 Michal Hlavac
  2026-12-02 20:51 ` [PATCH RFC 1/2] drm/xe/pmu: Release forcewake across system suspend Michal Hlavac
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Michal Hlavac @ 2026-12-02 20:51 UTC (permalink / raw)
  To: Matthew Brost, Thomas Hellström, Rodrigo Vivi
  Cc: intel-xe, Riana Tauro, Vinay Belgaumkar, Umesh Nerlige Ramappa,
	Lucas De Marchi, Michal Hlavac

Engine activity and GT frequency events of the xe PMU take GT forcewake
when they are created and hold it until they are destroyed. A monitoring
tool that keeps such events open keeps the GT out of C6 for as long as
it runs, also across system suspend. ksystemstats in KDE Plasma 6.8 does
that as soon as a GPU sensor is displayed.

On a Dell XPS 14 DA14260 (Panther Lake, suspend-to-idle only) this means
that the platform never enters S0ix: after a 45 s suspend
/sys/power/suspend_stats/last_hw_sleep is 0 and intel_pmc_core reports
"CPU did not enter Package C10". The problem is tracked in [1] and [2].

This series contains two ways to fix it, and I would like to ask which
one you prefer.

Patch 1 is the small fix. It keeps the forcewake, but lets all events of
a GT share one reference and releases it across system suspend. What the
events report does not change. The GT still never enters C6 while events
are open.

Patch 2 removes the forcewake from the PMU. The two registers that need
an awake GT (GPM timestamp, RPNSWREQ) are only used if the GT is in C0
before and after the read. The GT then idles normally with events open,
and the series as a whole removes more lines than it adds. It has two
costs:

 - gt-requested-frequency reads as 0 while the GT is in C6. Until now it
   always returned a request, because the event kept the GT awake.
 - It assumes that these registers read correctly without forcewake
   while the GT reports C0, and that the GT does not go through C6 and
   back to C0 between the two status checks. I could only verify the
   first assumption on Panther Lake.

The patches are stacked so that the series applies as a whole: patch 2
removes what patch 1 adds, and the result of both is the same as patch 2
on its own. If patch 2 is acceptable, patch 1 can be dropped or kept as
the part that is suitable for stable. If it is not, patch 1 stands
alone. I did not add stable tags for that reason.

Testing, all on the machine above with ksystemstats holding the events
open, on v7.3.6 with the patches applied (they apply with line offsets;
the two hooks in xe_pm.c needed adjusting by hand):

                               hw sleep in 45 s   gt-c6 residency,
                               of s2idle          idle desktop
  unpatched                    0 s                does not advance
  patch 1 (forcewake kept)     43.8 s             does not advance
  patches 1 + 2 (no forcewake) 43.7 s             ~9.7 s per 10 s

The last row was measured with patch 2 applied directly to v7.3.6,
which gives the same source as both patches together.

With patch 2 the reported engine utilization is 1-2 % when idle and
about 60 % under glxgears, the same as with patch 1, and
gt-requested-frequency follows gt-actual-frequency under load. On
drm-xe-next the series is compile-tested only (x86_64, W=1).

Not tested: other platforms, discrete GPUs, SR-IOV, S3, and the IGT
xe_pmu tests.

While testing I saw that engine-active-ticks can overshoot and step
back under load. That happens with and without this series, and I will
report it separately.

The analysis, the code and the text of this series were written with
the help of an AI coding assistant (Claude Code, model Claude Fable
5.2). I reviewed the result and ran the hardware tests myself.

[1] https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/9633
[2] https://bugs.kde.org/show_bug.cgi?id=527160

---
Michal Hlavac (2):
      drm/xe/pmu: Release forcewake across system suspend
      drm/xe/pmu: Don't hold forcewake while events are open

 drivers/gpu/drm/xe/xe_guc_engine_activity.c | 34 +++++++++++++-----
 drivers/gpu/drm/xe/xe_guc_pc.c              | 22 ++++++++++++
 drivers/gpu/drm/xe/xe_guc_pc.h              |  1 +
 drivers/gpu/drm/xe/xe_pmu.c                 | 55 +++--------------------------
 4 files changed, 52 insertions(+), 60 deletions(-)
---
base-commit: c6fe3bf08f392a35849e4eedba17ebacdd8d122d
change-id: 20261202-xe-pmu-forcewake-rfc-fc39c68818f1

Best regards,
--  
Michal Hlavac <miso@hlavki.eu>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-12-03 14:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-02 20:51 [PATCH RFC 0/2] drm/xe/pmu: Don't let open PMU events block S0ix and GT C6 Michal Hlavac
2026-12-02 20:51 ` [PATCH RFC 1/2] drm/xe/pmu: Release forcewake across system suspend Michal Hlavac
2026-12-02 20:51 ` [PATCH RFC 2/2] drm/xe/pmu: Don't hold forcewake while events are open Michal Hlavac
2026-12-03 13:45   ` sashiko-bot
2026-12-03 14:02 ` ✗ LGCI.VerificationFailed: failure for drm/xe/pmu: Don't let open PMU events block S0ix and GT C6 Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox