All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nirmoy Das <nirmoy.das@linux.intel.com>
To: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>,
	intel-xe@lists.freedesktop.org
Cc: Matthew Brost <matthew.brost@intel.com>,
	Nirmoy Das <nirmoy.das@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/xe: Call invalidation_fence_fini for PT inval fences in error state
Date: Fri, 6 Dec 2024 23:32:18 +0100	[thread overview]
Message-ID: <2a16ca11-71fa-4daa-ab31-4ed3bbe2f04e@linux.intel.com> (raw)
In-Reply-To: <20241206015022.1567113-1-daniele.ceraolospurio@intel.com>


On 12/6/2024 2:50 AM, Daniele Ceraolo Spurio wrote:
> Invalidation_fence_init takes a PM reference, which is released in its
> _fini counterpart, so we need to make sure that the latter is called,
> even if the fence is in an error state.
>
> Since we already have a function that calls _fini() and signals the
> fence in the tlb inval code, we can expose that and call it from the PT
> code.
>
> Fixes: f002702290fc ("drm/xe: Hold a PM ref when GT TLB invalidations are inflight")

Cc: <stable@vger.kernel.org> # v6.11+

> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Nirmoy Das <nirmoy.das@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>

LGTM

Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c | 8 ++++++++
>  drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h | 1 +
>  drivers/gpu/drm/xe/xe_pt.c                  | 3 +--
>  3 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> index 4e9f89392160..665927b80e9e 100644
> --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.c
> @@ -65,6 +65,14 @@ invalidation_fence_signal(struct xe_device *xe, struct xe_gt_tlb_invalidation_fe
>  	__invalidation_fence_signal(xe, fence);
>  }
>  
> +void xe_gt_tlb_invalidation_fence_signal(struct xe_gt_tlb_invalidation_fence *fence)
> +{
> +	if (WARN_ON_ONCE(!fence->gt))
> +		return;
> +
> +	__invalidation_fence_signal(gt_to_xe(fence->gt), fence);
> +}
> +
>  static void xe_gt_tlb_fence_timeout(struct work_struct *work)
>  {
>  	struct xe_gt *gt = container_of(work, struct xe_gt,
> diff --git a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h
> index f430d5797af7..00b1c6c01e8d 100644
> --- a/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h
> +++ b/drivers/gpu/drm/xe/xe_gt_tlb_invalidation.h
> @@ -28,6 +28,7 @@ int xe_guc_tlb_invalidation_done_handler(struct xe_guc *guc, u32 *msg, u32 len);
>  void xe_gt_tlb_invalidation_fence_init(struct xe_gt *gt,
>  				       struct xe_gt_tlb_invalidation_fence *fence,
>  				       bool stack);
> +void xe_gt_tlb_invalidation_fence_signal(struct xe_gt_tlb_invalidation_fence *fence);
>  
>  static inline void
>  xe_gt_tlb_invalidation_fence_wait(struct xe_gt_tlb_invalidation_fence *fence)
> diff --git a/drivers/gpu/drm/xe/xe_pt.c b/drivers/gpu/drm/xe/xe_pt.c
> index 684dc075deac..65c3c1688710 100644
> --- a/drivers/gpu/drm/xe/xe_pt.c
> +++ b/drivers/gpu/drm/xe/xe_pt.c
> @@ -1334,8 +1334,7 @@ static void invalidation_fence_cb(struct dma_fence *fence,
>  		queue_work(system_wq, &ifence->work);
>  	} else {
>  		ifence->base.base.error = ifence->fence->error;
> -		dma_fence_signal(&ifence->base.base);
> -		dma_fence_put(&ifence->base.base);
> +		xe_gt_tlb_invalidation_fence_signal(&ifence->base);
>  	}
>  	dma_fence_put(ifence->fence);
>  }

  parent reply	other threads:[~2024-12-06 22:32 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-06  1:50 [PATCH] drm/xe: Call invalidation_fence_fini for PT inval fences in error state Daniele Ceraolo Spurio
2024-12-06  2:00 ` ✓ CI.Patch_applied: success for " Patchwork
2024-12-06  2:00 ` ✓ CI.checkpatch: " Patchwork
2024-12-06  2:03 ` ✓ CI.KUnit: " Patchwork
2024-12-06  2:21 ` ✓ CI.Build: " Patchwork
2024-12-06  2:24 ` ✓ CI.Hooks: " Patchwork
2024-12-06  2:25 ` ✓ CI.checksparse: " Patchwork
2024-12-06  2:45 ` ✓ Xe.CI.BAT: " Patchwork
2024-12-06  4:44 ` ✗ Xe.CI.Full: failure " Patchwork
2024-12-06 22:32 ` Nirmoy Das [this message]
2024-12-10 19:38 ` [PATCH] " Matthew Brost

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=2a16ca11-71fa-4daa-ab31-4ed3bbe2f04e@linux.intel.com \
    --to=nirmoy.das@linux.intel.com \
    --cc=daniele.ceraolospurio@intel.com \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=matthew.brost@intel.com \
    --cc=nirmoy.das@intel.com \
    --cc=rodrigo.vivi@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 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.