seqprop_sequence() is not intended for use outside seqlock.h.
Although it is accessible as a macro, it is meant to be used only
internally within the header.

Replace it with its proper wrapper, raw_read_seqcount().

Signed-off-by: Andi Shyti <[email protected]>
Co-developed-by: Jani Nikula <[email protected]>
Signed-off-by: Jani Nikula <[email protected]>
Cc: Christoph Lameter (Ampere) <[email protected]>
---
Hi,

this patch fixes an issue that came up during Christoph's
work[*], which made his series trickier to move forward.

I also added Jani to the chain of tags, since I later noticed he
had suggested the same thing. Joonas had some concerns about this
approach possibly introducing locking issues, so I ran a few
tests before posting to make sure everything behaves as
expected[**].

There could still be a more refined way to handle the seqcount
for TLB invalidation using raw_seqcount_try_begin() and
read_seqcount_retry(), but that would need a fair bit of
refactoring, and I am not sure it would bring enough benefit.

Thanks,
Andi

[*] 
https://lore.kernel.org/all/[email protected]/
[**] https://patchwork.freedesktop.org/series/155638/

 drivers/gpu/drm/i915/gt/intel_tlb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_tlb.h 
b/drivers/gpu/drm/i915/gt/intel_tlb.h
index 337327af92ac..ec7612216248 100644
--- a/drivers/gpu/drm/i915/gt/intel_tlb.h
+++ b/drivers/gpu/drm/i915/gt/intel_tlb.h
@@ -18,7 +18,7 @@ void intel_gt_fini_tlb(struct intel_gt *gt);
 
 static inline u32 intel_gt_tlb_seqno(const struct intel_gt *gt)
 {
-       return seqprop_sequence(&gt->tlb.seqno);
+       return raw_read_seqcount(&gt->tlb.seqno);
 }
 
 static inline u32 intel_gt_next_invalidate_tlb_full(const struct intel_gt *gt)
-- 
2.51.0

Reply via email to