Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/pps: don't orphan the VDD wakeref when the HW force bit is reset
@ 2026-08-31  4:40 Arun R Murthy
  2026-08-31  4:57 ` sashiko-bot
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Arun R Murthy @ 2026-08-31  4:40 UTC (permalink / raw)
  To: intel-gfx; +Cc: Arun R Murthy, Adharsh K

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


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

end of thread, other threads:[~2026-09-02  8:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  4:40 [PATCH] drm/i915/pps: don't orphan the VDD wakeref when the HW force bit is reset Arun R Murthy
2026-08-31  4:57 ` 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

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