All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load
@ 2026-05-11 17:31 James Xiong
  2026-05-11 20:48 ` ✓ i915.CI.BAT: success for drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load (rev3) Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: James Xiong @ 2026-05-11 17:31 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: gustavo.sousa, jani.nikula, imre.deak, James Xiong

During driver probe, DMC firmware is loaded asynchronously via a
workqueue. There is a race between parse_dmc_fw() setting the payload
pointer (making has_dmc_id_fw() return true) and intel_dmc_load_program()
writing the firmware to hardware registers. If the probe thread calls
intel_dmc_enable_pipe() -> assert_dmc_loaded() in this window via
intel_modeset_setup_hw_state(), it sees parsed payload but stale HW
registers, triggering a ~20% intermittent WARNING on ADL-N warm boot.

v2: Fix by calling intel_dmc_wait_fw_load() in
    intel_modeset_setup_hw_state() before iterating the CRTCs (Gustavo
    Sousa).

v3: Move intel_dmc_wait_fw_load() into intel_dmc_enable_pipe() itself
    so the function is self-contained (Jani Nikula, Gustavo Sousa).

Fixes: 3af2ff0840be ("drm/i915: Enable a PIPEDMC whenever its corresponding pipe is enabled")
Signed-off-by: James Xiong <james.xiong@intel.com>
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dmc.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index 0df4f42ba3e3..4151eae92744 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -786,7 +786,12 @@ void intel_dmc_enable_pipe(const struct intel_crtc_state *crtc_state)
 	enum pipe pipe = crtc->pipe;
 	enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(pipe);
 
-	if (!is_valid_dmc_id(dmc_id) || !has_dmc_id_fw(display, dmc_id))
+	if (!is_valid_dmc_id(dmc_id))
+		return;
+
+	intel_dmc_wait_fw_load(display);
+
+	if (!has_dmc_id_fw(display, dmc_id))
 		return;
 
 	if (!can_enable_pipedmc(crtc_state)) {
-- 
2.34.1


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

end of thread, other threads:[~2026-06-01 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-11 17:31 [PATCH v4] drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load James Xiong
2026-05-11 20:48 ` ✓ i915.CI.BAT: success for drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load (rev3) Patchwork
2026-05-12  4:12 ` ✗ i915.CI.Full: failure " Patchwork
2026-05-12  5:59 ` ✓ CI.KUnit: success " Patchwork
2026-05-12  7:11 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-12 14:27 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-29 15:40 ` [PATCH v4] drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load Ville Syrjälä
2026-06-01 16:06   ` Jani Nikula

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.