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@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Link: https://lore.kernel.org/r/20250416152044.2668249-1-nemesa.garg@intel.com
This commit is contained in:
Nemesa Garg
2025-04-16 20:50:44 +05:30
committed by Ankit Nautiyal
parent 5530c1e48a
commit d7e83da125

View File

@@ -478,13 +478,34 @@ static bool intel_pmdemand_req_complete(struct intel_display *display)
XELPDP_PMDEMAND_REQ_ENABLE);
}
static void intel_pmdemand_poll(struct intel_display *display)
{
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 within %ums (status 0x%08x)\n",
timeout_ms, status);
}
static void intel_pmdemand_wait(struct intel_display *display)
{
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");
/* Wa_14024400148 For lnl use polling method */
if (DISPLAY_VER(display) == 20) {
intel_pmdemand_poll(display);
} else {
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. */