Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Matthew Auld <matthew.auld@intel.com>, intel-xe@lists.freedesktop.org
Cc: Matthew Brost <matthew.brost@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>
Subject: Re: [PATCH v2 2/2] drm/xe: fix unbalanced rpm put() with declare_wedged()
Date: Wed, 9 Oct 2024 10:57:17 +0200	[thread overview]
Message-ID: <8916b5eb-1880-460f-90e4-a9e3825f0064@linux.intel.com> (raw)
In-Reply-To: <20241009084808.204432-4-matthew.auld@intel.com>


On 10/9/2024 10:48 AM, Matthew Auld wrote:
> Technically the or_reset() means we call the action on failure, however
> that would lead to unbalanced rpm put(). Move the get() earlier to fix
> this. It should be extremely unlikely to ever trigger this in practice.
>
> Fixes: 452bca0edbd0 ("drm/xe: Don't suspend device upon wedge")
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
> ---
>  drivers/gpu/drm/xe/xe_device.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
> index cd241a8e1838..962751c966d1 100644
> --- a/drivers/gpu/drm/xe/xe_device.c
> +++ b/drivers/gpu/drm/xe/xe_device.c
> @@ -1016,13 +1016,13 @@ void xe_device_declare_wedged(struct xe_device *xe)
>  		return;
>  	}
>  
> +	xe_pm_runtime_get_noresume(xe);
> +
>  	if (drmm_add_action_or_reset(&xe->drm, xe_device_wedged_fini, xe)) {
>  		drm_err(&xe->drm, "Failed to register xe_device_wedged_fini clean-up. Although device is wedged.\n");
>  		return;
>  	}
>  
> -	xe_pm_runtime_get_noresume(xe);
> -
>  	if (!atomic_xchg(&xe->wedged.flag, 1)) {
>  		xe->needs_flr_on_fini = true;
>  		drm_err(&xe->drm,

  reply	other threads:[~2024-10-09  8:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-09  8:48 [PATCH v2 1/2] drm/xe: fix unbalanced rpm put() with fence_fini() Matthew Auld
2024-10-09  8:48 ` [PATCH v2 2/2] drm/xe: fix unbalanced rpm put() with declare_wedged() Matthew Auld
2024-10-09  8:57   ` Nirmoy Das [this message]
2024-10-09  8:50 ` [PATCH v2 1/2] drm/xe: fix unbalanced rpm put() with fence_fini() Nirmoy Das
2024-10-09 10:45 ` ✓ CI.Patch_applied: success for series starting with [v2,1/2] " Patchwork
2024-10-09 10:45 ` ✓ CI.checkpatch: " Patchwork
2024-10-09 10:46 ` ✓ CI.KUnit: " Patchwork
2024-10-09 10:58 ` ✓ CI.Build: " Patchwork
2024-10-09 11:00 ` ✓ CI.Hooks: " Patchwork
2024-10-09 11:02 ` ✓ CI.checksparse: " Patchwork
2024-10-09 11:28 ` ✓ CI.BAT: " Patchwork
2024-10-09 17:22 ` ✗ CI.FULL: failure " Patchwork

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=8916b5eb-1880-460f-90e4-a9e3825f0064@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    --cc=matthew.brost@intel.com \
    --cc=nirmoy.das@intel.com \
    /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