[PATCH v2] drm/i915/display: Implement wa_14024400148
Kahola, Mika
mika.kahola at intel.com
Tue Apr 22 15:32:56 UTC 2025
> -----Original Message-----
> From: Garg, Nemesa <nemesa.garg at intel.com>
> Sent: Wednesday, 16 April 2025 18.21
> To: intel-gfx at lists.freedesktop.org; intel-xe at lists.freedesktop.org; Kahola, Mika
> <mika.kahola at intel.com>
> Cc: Garg, Nemesa <nemesa.garg at intel.com>
> Subject: [PATCH v2] drm/i915/display: Implement wa_14024400148
>
> Workaround recommend use polling method
> for pm_demand to finish as to avoid timeout.
>
> v2: Add polling method within pmdemand_wait.
> Update error message[Jani]
>
> Signed-off-by: Nemesa Garg <nemesa.garg at intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_pmdemand.c | 31 ++++++++++++++++---
> 1 file changed, 26 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_pmdemand.c
> b/drivers/gpu/drm/i915/display/intel_pmdemand.c
> index d22b5469672d..1253376c7654 100644
> --- a/drivers/gpu/drm/i915/display/intel_pmdemand.c
> +++ b/drivers/gpu/drm/i915/display/intel_pmdemand.c
> @@ -478,13 +478,34 @@ static bool intel_pmdemand_req_complete(struct
> intel_display *display)
> XELPDP_PMDEMAND_REQ_ENABLE);
> }
>
> -static void intel_pmdemand_wait(struct intel_display *display)
> +static void intel_pmdemand_poll(struct intel_display *display)
> {
> - if (!wait_event_timeout(display->pmdemand.waitqueue,
> - intel_pmdemand_req_complete(display),
> - msecs_to_jiffies_timeout(10)))
> + const unsigned int timeout_ms = 10;
> + u32 status;
> + int ret;
> +
> + ret = intel_de_wait_custom(display,
> XELPDP_INITIATE_PMDEMAND_REQUEST(1),
> + XELPDP_PMDEMAND_REQ_ENABLE, 0,
> + 50, timeout_ms, &status);
> +
> + if (ret == -ETIMEDOUT)
> drm_err(display->drm,
> - "timed out waiting for Punit PM Demand Response\n");
> + "timed out waiting for Punit PM Demand Response
> within %ums (status 0x%08x)\n",
> + timeout_ms, status);
> +}
> +
> +static void intel_pmdemand_wait(struct intel_display *display) {
> + /* Wa_14024400148 For lnl use polling method */
> + if (DISPLAY_VER(display) == 20) {
> + intel_pmdemand_poll(display);
> + } else {
Maybe this else branch could be written as its own function as with if branch. Anyway, this might be a topic for follow up patch.
Reviewed-by: Mika Kahola <mika.kahola at intel.com>
> + if (!wait_event_timeout(display->pmdemand.waitqueue,
> +
> intel_pmdemand_req_complete(display),
> + msecs_to_jiffies_timeout(10)))
> + drm_err(display->drm,
> + "timed out waiting for Punit PM Demand
> Response\n");
> + }
> }
>
> /* Required to be programmed during Display Init Sequences. */
> --
> 2.25.1
More information about the Intel-gfx
mailing list