Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Arun R Murthy" <arun.r.murthy@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCHv2] drm/i915/pps: reconcile a BIOS-enabled VDD without leaking its wakeref
Date: Mon, 31 Aug 2026 09:58:24 +0000	[thread overview]
Message-ID: <20260831095825.26C9A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260831093854.1427305-1-arun.r.murthy@intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Early return in intel_pps_vdd_off_sync_unlocked() skips wakeref cleanup and permanently leaks vdd_wakeref if the hardware VDD bit is reset externally.
--

commit 74c15e0ea248699dfcba4c3a0009676b770c8241
Author: Arun R Murthy <arun.r.murthy@intel.com>
Subject: drm/i915/pps: reconcile a BIOS-enabled VDD without leaking its wakeref

When the BIOS leaves the eDP VDD force bit enabled at boot, pps_vdd_init()
adopts that state by taking an AUX power-domain reference into vdd_wakeref.
This commit explicitly tracks this handover to prevent blindly reusing or
leaking the wakeref when the HW force bit is reset under the driver.

Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/work_items/8477

[ ... ]
> diff --git a/drivers/gpu/drm/i915/display/intel_pps.c b/drivers/gpu/drm/i915/display/intel_pps.c
> index d4c98b150fa2b..4152880774395 100644
> --- a/drivers/gpu/drm/i915/display/intel_pps.c
> +++ b/drivers/gpu/drm/i915/display/intel_pps.c
> @@ -758,9 +758,22 @@ 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));
> +	/*
> +	 * pps_vdd_init() may have taken a reference at the BIOS->driver handover
> +	 * for an already-on VDD whose HW force bit was since reset under us (DC
> +	 * states, DMC, BIOS). Only in that boot/resume handover case reuse the
> +	 * held reference instead of overwriting and leaking it. At runtime a
> +	 * held wakeref here is a real imbalance, so keep asserting it and depend
> +	 * on the HW read.
> +	 */
> +	if (intel_dp->pps.vdd_wakeref_boot) {
> +		intel_dp->pps.vdd_wakeref_boot = false;
> +	} else {
> +		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));

[Severity: High]
This is a pre-existing issue, but does this overwrite and permanently leak
the runtime vdd_wakeref if the hardware VDD bit is reset externally?

As the commit message acknowledges, the hardware VDD bit can be cleared
externally by DMC, DC states, or BIOS independently of the driver.

If this happens while a runtime wakeref is held, and the delayed VDD off
timer expires, intel_pps_vdd_off_sync_unlocked() appears to return early
without dropping the wakeref:

drivers/gpu/drm/i915/display/intel_pps.c:intel_pps_vdd_off_sync_unlocked() {
    ...
    if (!edp_have_panel_vdd(intel_dp))
        return;
    ...
}

If intel_pps_vdd_on_unlocked() is subsequently called, it triggers this
WARN_ON and overwrites the non-NULL wakeref pointer with a new allocation.
This makes the original leaked wakeref unrecoverable.

Is there a way to safely clean up the existing runtime wakeref before
allocating a new one?

> +	}
>  
>  	pp_stat_reg = _pp_stat_reg(intel_dp);
>  	pp_ctrl_reg = _pp_ctrl_reg(intel_dp);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260831093854.1427305-1-arun.r.murthy@intel.com?part=1

  reply	other threads:[~2026-08-31  9:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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=20260831095825.26C9A1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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