Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: Gustavo Sousa <gustavo.sousa@intel.com>,
	intel-gfx@lists.freedesktop.org, 	intel-xe@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/dmc_wl: Do not check for DMC payload
Date: Thu, 30 Jan 2025 11:41:19 +0200	[thread overview]
Message-ID: <7219ed98d04dcf73c796d53d832750d63dffd0de.camel@coelho.fi> (raw)
In-Reply-To: <20250124191250.56833-1-gustavo.sousa@intel.com>

On Fri, 2025-01-24 at 16:12 -0300, Gustavo Sousa wrote:
> Enabling and disabling of DMC wakelock is already coupled with enabling
> and disabling of dynamic DC states, which already depend on the DMC
> being properly loaded. As such, we do not need to check if we already
> have a DMC payload parsed in __intel_dmc_wl_supported().
> 
> Furthermore, the presence of such a check causes inconsistencies in the
> refcount if the following sequence of events happen:
> 
>   1. A call to one of the register accessors from intel_de.h is done
>      before the DMC payload is parsed. That causes intel_dmc_wl_get() to
>      be called. Suppose the register offset qualifies as needing the
>      wakelock.
> 
>      In normal circumstances, the refcount would be incremented, but,
>      because __intel_dmc_wl_supported() returns false, the refcount is
>      untouched.
> 
>   2. In a separate worker thread, the DMC firmware is parsed. Parsing of
>      the DMC payload is finished before the corresponding
>      intel_dmc_wl_put() from (1) is called.
> 
>   3. When in the context of (1), intel_dmc_wl_put() gets called, now we
>      have __intel_dmc_wl_supported() returning true and we hit the
>      warning, because the code doesn't expect a zero refcount.
> 
> Let's remove that check, since it is unnecessary and causes the
> inconsistency illustrated above.
> 
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
> ---

Reviewed-by: Luca Coelho <luciano.coelho@intel.com>

--
Cheers,
Luca.

  parent reply	other threads:[~2025-01-30  9:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-24 19:12 [PATCH] drm/i915/dmc_wl: Do not check for DMC payload Gustavo Sousa
2025-01-24 21:36 ` ✓ CI.Patch_applied: success for " Patchwork
2025-01-24 21:36 ` ✓ CI.checkpatch: " Patchwork
2025-01-24 21:37 ` ✓ CI.KUnit: " Patchwork
2025-01-24 21:54 ` ✓ CI.Build: " Patchwork
2025-01-24 21:57 ` ✓ CI.Hooks: " Patchwork
2025-01-24 22:00 ` ✓ CI.checksparse: " Patchwork
2025-01-24 22:34 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-25  4:42 ` ✗ Xe.CI.Full: failure " Patchwork
2025-02-05 11:57   ` Gustavo Sousa
2025-01-30  9:41 ` Luca Coelho [this message]
2025-01-30 14:18 ` [PATCH] " Krzysztof Karas
2025-01-31 20:16   ` Gustavo Sousa
2025-01-31 23:49     ` Lucas De Marchi
2025-02-03 11:44       ` Gustavo Sousa
2025-02-05  9:07         ` Krzysztof Karas
2025-02-05 14:18 ` Gustavo Sousa

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=7219ed98d04dcf73c796d53d832750d63dffd0de.camel@coelho.fi \
    --to=luca@coelho.fi \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --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