Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Xiong <james.xiong@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>,
	<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 1/1] drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load
Date: Thu, 7 May 2026 09:38:05 -0700	[thread overview]
Message-ID: <9a43e108-53c8-454c-aa7c-bcc9118cbeee@intel.com> (raw)
In-Reply-To: <878q9v8eqt.fsf@intel.com>


On 5/7/26 07:40, Gustavo Sousa wrote:
> James Xiong <james.xiong@intel.com> writes:
>
>> 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, it sees
>> parsed payload but stale HW registers, triggering a ~20% intermittent
>> WARNING on ADL-N warm boot.
>>
>> Fix this by adding a 'loaded' flag to struct intel_dmc, set with
>> WRITE_ONCE() after intel_dmc_load_program() completes. Check it with
>> READ_ONCE() in intel_dmc_enable_pipe() and intel_dmc_disable_pipe()
>> as an additional guard before has_dmc_id_fw().
> Making intel_dmc_enable_pipe() bail if the DMC is not yet loaded doesn't
> look like the correct solution here.
>
> Does the warning come from intel_modeset_setup_hw_state()'s call stack?
> If so, I wonder if adding a call to intel_dmc_wait_fw_load() before
> iterating the crtcs would be a saner approach.
>
> --
> Gustavo Sousa

Yes, the warning comes from intel_modeset_setup_hw_state() →
intel_dmc_enable_pipe() → assert_dmc_loaded().

You're right, adding intel_dmc_wait_fw_load() before the CRTC loop
is a much saner approach. I've updated the patch to do exactly that
— the loaded flag machinery is dropped entirely, and instead
intel_modeset_setup_hw_state() now calls intel_dmc_wait_fw_load(display)
before for_each_intel_crtc(), following the same pattern as intel_flipq_init().

Will send v2

James


      parent reply	other threads:[~2026-05-07 16:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-07  0:46 [PATCH 1/1] drm/i915/dmc: fix assert_dmc_loaded WARN during async firmware load James Xiong
2026-05-07  0:53 ` ✓ CI.KUnit: success for series starting with [1/1] " Patchwork
2026-05-07  1:48 ` ✓ Xe.CI.BAT: " Patchwork
2026-05-07  8:07 ` ✗ Xe.CI.FULL: failure " Patchwork
2026-05-07 14:40 ` [PATCH 1/1] " Gustavo Sousa
2026-05-07 14:50   ` Saarinen, Jani
2026-05-07 15:10     ` Gustavo Sousa
2026-05-07 16:38   ` James Xiong [this message]

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=9a43e108-53c8-454c-aa7c-bcc9118cbeee@intel.com \
    --to=james.xiong@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    /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