Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Deak, Imre" <imre.deak@intel.com>
Subject: Re: [PATCH] drm/i915: Fix assert on pending async-put power domain work when it requeues itself
Date: Tue, 4 Jun 2024 07:34:32 +0000	[thread overview]
Message-ID: <c0abc6e5fcf41450a4b3d92ceec6247c9308ab34.camel@intel.com> (raw)
In-Reply-To: <20240530105312.1016485-1-imre.deak@intel.com>

On Thu, 2024-05-30 at 13:53 +0300, Imre Deak wrote:
> Commit dd839aa857eb ("drm/i915: Fix incorrect assert about pending
> power domain async-put work")
> 
> fixed the assert about a pending work dropping a display power
> reference
> asynchronously, leading to the
> 
> drm_WARN_ON(!queue_delayed_work(&power_domains->async_put_work));
> 
> warn next time around a power reference was put asynchronously, due
> to a
> stale instance of the work still being pending. However the fix
> didn't
> consider the case where multiple power reference was acquired and
> put,
> requiring the work to requeue itself. Extend the fix for this case as
> well canceling the pending instance of the work before it requeues
> itself.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>

> 
> Closes: https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/10915
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display_power.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c
> b/drivers/gpu/drm/i915/display/intel_display_power.c
> index 34b6d843bc9ef..8c49ac053dfb0 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_power.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_power.c
> @@ -675,6 +675,12 @@ intel_display_power_put_async_work(struct
> work_struct *work)
>         release_async_put_domains(power_domains,
>                                   &power_domains-
> >async_put_domains[0]);
>  
> +       /*
> +        * Cancel the work that got queued after this one got
> dequeued,
> +        * since here we released the corresponding async-put
> reference.
> +        */
> +       cancel_async_put_work(power_domains, false);
> +
>         /* Requeue the work if more domains were async put meanwhile.
> */
>         if (!bitmap_empty(power_domains->async_put_domains[1].bits,
> POWER_DOMAIN_NUM)) {
>                 bitmap_copy(power_domains->async_put_domains[0].bits,
> @@ -686,12 +692,6 @@ intel_display_power_put_async_work(struct
> work_struct *work)
>                                             
> fetch_and_zero(&new_work_wakeref),
>                                              power_domains-
> >async_put_next_delay);
>                 power_domains->async_put_next_delay = 0;
> -       } else {
> -               /*
> -                * Cancel the work that got queued after this one got
> dequeued,
> -                * since here we released the corresponding async-put
> reference.
> -                */
> -               cancel_async_put_work(power_domains, false);
>         }
>  
>  out_verify:


      parent reply	other threads:[~2024-06-04  7:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-30 10:53 [PATCH] drm/i915: Fix assert on pending async-put power domain work when it requeues itself Imre Deak
2024-05-30 12:49 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2024-05-30 12:57 ` ✓ Fi.CI.BAT: success " Patchwork
2024-05-31  7:22 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-06-04 16:45   ` Imre Deak
2024-06-04  7:34 ` Hogander, Jouni [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=c0abc6e5fcf41450a4b3d92ceec6247c9308ab34.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@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