From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: "Thomas Hellström" <thomas.hellstrom@linux.intel.com>,
"Michael Cheng" <michael.cheng@intel.com>,
"Andi Shyti" <andi.shyti@linux.intel.com>,
"David Airlie" <airlied@linux.ie>,
dri-devel@lists.freedesktop.org,
"Lucas De Marchi" <lucas.demarchi@intel.com>,
linux-kernel@vger.kernel.org,
"Chris Wilson" <chris.p.wilson@intel.com>,
"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
"Niranjana Vishwanathapura" <niranjana.vishwanathapura@intel.com>,
intel-gfx@lists.freedesktop.org,
"Matthew Auld" <matthew.auld@intel.com>
Subject: Re: [PATCH v3 1/3] drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb()
Date: Thu, 4 Aug 2022 09:18:01 +0100 [thread overview]
Message-ID: <aa323022-f54c-23e2-92b9-87191209177e@linux.intel.com> (raw)
In-Reply-To: <f9550e6bacea10131ff40dd8981b69eb9251cdcd.1659598090.git.mchehab@kernel.org>
On 04/08/2022 08:37, Mauro Carvalho Chehab wrote:
> WRITE_ONCE() should happen at the original var, not on a local
> copy of it.
>
> Fixes: 5d36acb7198b ("drm/i915/gt: Batch TLB invalidations")
Cc: stable I think, since the above one was. So both hit 5.21 (or 6.1)
together.
Regards,
Tvrtko
> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> ---
>
> To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
> See [PATCH v3 0/3] at: https://lore.kernel.org/all/cover.1659598090.git.mchehab@kernel.org/
>
> drivers/gpu/drm/i915/gt/intel_ppgtt.c | 2 +-
> drivers/gpu/drm/i915/i915_vma.c | 6 +++---
> drivers/gpu/drm/i915/i915_vma.h | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_ppgtt.c b/drivers/gpu/drm/i915/gt/intel_ppgtt.c
> index 2da6c82a8bd2..6ee8d1127016 100644
> --- a/drivers/gpu/drm/i915/gt/intel_ppgtt.c
> +++ b/drivers/gpu/drm/i915/gt/intel_ppgtt.c
> @@ -211,7 +211,7 @@ void ppgtt_unbind_vma(struct i915_address_space *vm,
>
> vm->clear_range(vm, vma_res->start, vma_res->vma_size);
> if (vma_res->tlb)
> - vma_invalidate_tlb(vm, *vma_res->tlb);
> + vma_invalidate_tlb(vm, vma_res->tlb);
> }
>
> static unsigned long pd_count(u64 size, int shift)
> diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
> index 84a9ccbc5fc5..260371716490 100644
> --- a/drivers/gpu/drm/i915/i915_vma.c
> +++ b/drivers/gpu/drm/i915/i915_vma.c
> @@ -1308,7 +1308,7 @@ I915_SELFTEST_EXPORT int i915_vma_get_pages(struct i915_vma *vma)
> return err;
> }
>
> -void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb)
> +void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb)
> {
> /*
> * Before we release the pages that were bound by this vma, we
> @@ -1318,7 +1318,7 @@ void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb)
> * the most recent TLB invalidation seqno, and if we have not yet
> * flushed the TLBs upon release, perform a full invalidation.
> */
> - WRITE_ONCE(tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
> + WRITE_ONCE(*tlb, intel_gt_next_invalidate_tlb_full(vm->gt));
> }
>
> static void __vma_put_pages(struct i915_vma *vma, unsigned int count)
> @@ -1971,7 +1971,7 @@ struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async)
> dma_fence_put(unbind_fence);
> unbind_fence = NULL;
> }
> - vma_invalidate_tlb(vma->vm, vma->obj->mm.tlb);
> + vma_invalidate_tlb(vma->vm, &vma->obj->mm.tlb);
> }
>
> /*
> diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
> index 5048eed536da..33a58f605d75 100644
> --- a/drivers/gpu/drm/i915/i915_vma.h
> +++ b/drivers/gpu/drm/i915/i915_vma.h
> @@ -213,7 +213,7 @@ bool i915_vma_misplaced(const struct i915_vma *vma,
> u64 size, u64 alignment, u64 flags);
> void __i915_vma_set_map_and_fenceable(struct i915_vma *vma);
> void i915_vma_revoke_mmap(struct i915_vma *vma);
> -void vma_invalidate_tlb(struct i915_address_space *vm, u32 tlb);
> +void vma_invalidate_tlb(struct i915_address_space *vm, u32 *tlb);
> struct dma_fence *__i915_vma_evict(struct i915_vma *vma, bool async);
> int __i915_vma_unbind(struct i915_vma *vma);
> int __must_check i915_vma_unbind(struct i915_vma *vma);
next prev parent reply other threads:[~2022-08-04 8:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-04 7:37 [PATCH v3 0/3] Move TLB invalidation code for its own file and document it Mauro Carvalho Chehab
2022-08-04 7:37 ` [PATCH v3 1/3] drm/i915: pass a pointer for tlb seqno at vma_invalidate_tlb() Mauro Carvalho Chehab
2022-08-04 8:18 ` Tvrtko Ursulin [this message]
2022-08-08 16:37 ` Andi Shyti
2022-08-08 19:04 ` [Intel-gfx] " Rodrigo Vivi
2022-08-08 23:09 ` Andi Shyti
2022-08-09 0:15 ` Vivi, Rodrigo
2022-08-09 6:29 ` Mauro Carvalho Chehab
2022-08-04 7:37 ` [PATCH v3 2/3] drm/i915/gt: Move TLB invalidation to its own file Mauro Carvalho Chehab
2022-08-04 7:37 ` [PATCH v3 3/3] drm/i915/gt: document TLB cache invalidation functions Mauro Carvalho Chehab
2022-08-04 19:00 ` Randy Dunlap
2022-08-05 9:08 ` Andi Shyti
2022-08-05 9:24 ` Tvrtko Ursulin
2022-08-05 10:30 ` [Intel-gfx] " Mauro Carvalho Chehab
2022-08-08 16:58 ` Andi Shyti
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=aa323022-f54c-23e2-92b9-87191209177e@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=airlied@linux.ie \
--cc=andi.shyti@linux.intel.com \
--cc=chris.p.wilson@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucas.demarchi@intel.com \
--cc=matthew.auld@intel.com \
--cc=mchehab@kernel.org \
--cc=michael.cheng@intel.com \
--cc=niranjana.vishwanathapura@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=thomas.hellstrom@linux.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;
as well as URLs for NNTP newsgroup(s).