All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arun R Murthy <arun.r.murthy@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Arun R Murthy <arun.r.murthy@intel.com>,
	Adharsh K <adharshkandath@gmail.com>
Subject: [PATCH] drm/i915/pps: don't orphan the VDD wakeref when the HW force bit is reset
Date: Mon, 31 Aug 2026 10:10:36 +0530	[thread overview]
Message-ID: <20260831044036.1236136-1-arun.r.murthy@intel.com> (raw)

pps_vdd_init() takes an AUX power-domain reference into
intel_dp->pps.vdd_wakeref when it finds EDP_FORCE_VDD already enabled by
the BIOS, and defers dropping it to a later scheduled VDD off.

intel_pps_vdd_on_unlocked() decides whether it already owns that reference
by reading the live EDP_FORCE_VDD bit via edp_have_panel_vdd(). That bit
can be reset under the driver (DC states, DMC, BIOS) while we still hold
vdd_wakeref. When that happens the function believes it holds nothing,
overwrites vdd_wakeref with a freshly acquired reference and orphans the
original one. The leak surfaces at suspend-late as:

  i915 raw-wakerefs=1 wakelocks=1 on cleanup

with the leaked wakeref's backtrace pointing at pps_vdd_init() ->
intel_pps_init() from driver probe.

Make vdd_wakeref the authoritative record of the reference: only acquire
a new one when we don't already hold it, and re-assert the HW bit either
way. This keeps the reference balanced regardless of the volatile HW
state and drops the now-incorrect WARN_ON().

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/8477
Assisted-by: Claude:claude-3-opus
Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
Tested-by: Adharsh K <adharshkandath@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_pps.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
index d4c98b150fa2..43e89aaf419f 100644
--- a/drivers/gpu/drm/i915/display/intel_pps.c
+++ b/drivers/gpu/drm/i915/display/intel_pps.c
@@ -758,9 +758,10 @@ bool intel_pps_vdd_on_unlocked(struct intel_dp *intel_dp)
 	if (edp_have_panel_vdd(intel_dp))
 		return need_to_disable;
 
-	drm_WARN_ON(display->drm, intel_dp->pps.vdd_wakeref);
-	intel_dp->pps.vdd_wakeref = intel_display_power_get(display,
-							    intel_aux_power_domain(dig_port));
+	if (!intel_dp->pps.vdd_wakeref)
+		intel_dp->pps.vdd_wakeref =
+			intel_display_power_get(display,
+						intel_aux_power_domain(dig_port));
 
 	pp_stat_reg = _pp_stat_reg(intel_dp);
 	pp_ctrl_reg = _pp_ctrl_reg(intel_dp);
-- 
2.25.1


             reply	other threads:[~2026-08-31  4:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31  4:40 Arun R Murthy [this message]
2026-08-31  4:57 ` [PATCH] drm/i915/pps: don't orphan the VDD wakeref when the HW force bit is reset sashiko-bot
2026-08-31  5:22 ` ✓ i915.CI.BAT: success for " Patchwork
2026-08-31  6:32 ` [PATCH] " Jani Nikula
2026-09-02  8:52   ` Murthy, Arun R
2026-08-31  7:33 ` ✗ i915.CI.Full: failure for " Patchwork
2026-08-31  9:38 ` [PATCHv2] drm/i915/pps: reconcile a BIOS-enabled VDD without leaking its wakeref Arun R Murthy
2026-08-31  9:58   ` sashiko-bot
2026-08-31 15:26 ` ✓ i915.CI.BAT: success for drm/i915/pps: don't orphan the VDD wakeref when the HW force bit is reset (rev2) Patchwork
2026-08-31 21:21 ` ✓ i915.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=20260831044036.1236136-1-arun.r.murthy@intel.com \
    --to=arun.r.murthy@intel.com \
    --cc=adharshkandath@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.