intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v2 1/2] drm/i915: Wrap our timer_list.expires checking
@ 2021-01-06 16:36 Chris Wilson
  2021-01-06 16:36 ` [Intel-gfx] [PATCH v2 2/2] drm/i915/gt: Remove timeslice suppression Chris Wilson
                   ` (7 more replies)
  0 siblings, 8 replies; 13+ messages in thread
From: Chris Wilson @ 2021-01-06 16:36 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

Refactor our timer_list.expires checking into its own timer_active()
helper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 drivers/gpu/drm/i915/i915_utils.c | 2 +-
 drivers/gpu/drm/i915/i915_utils.h | 7 ++++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_utils.c b/drivers/gpu/drm/i915/i915_utils.c
index 4c305d838016..f9e780dee9de 100644
--- a/drivers/gpu/drm/i915/i915_utils.c
+++ b/drivers/gpu/drm/i915/i915_utils.c
@@ -87,7 +87,7 @@ bool i915_error_injected(void)
 
 void cancel_timer(struct timer_list *t)
 {
-	if (!READ_ONCE(t->expires))
+	if (!timer_active(t))
 		return;
 
 	del_timer(t);
diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index 54773371e6bd..abd4dcd9f79c 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -438,9 +438,14 @@ static inline void __add_taint_for_CI(unsigned int taint)
 void cancel_timer(struct timer_list *t);
 void set_timer_ms(struct timer_list *t, unsigned long timeout);
 
+static inline bool timer_active(const struct timer_list *t)
+{
+	return READ_ONCE(t->expires);
+}
+
 static inline bool timer_expired(const struct timer_list *t)
 {
-	return READ_ONCE(t->expires) && !timer_pending(t);
+	return timer_active(t) && !timer_pending(t);
 }
 
 /*
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-01-07 21:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-06 16:36 [Intel-gfx] [PATCH v2 1/2] drm/i915: Wrap our timer_list.expires checking Chris Wilson
2021-01-06 16:36 ` [Intel-gfx] [PATCH v2 2/2] drm/i915/gt: Remove timeslice suppression Chris Wilson
2021-01-07 11:01   ` [Intel-gfx] [PATCH v3] " Chris Wilson
2021-01-07 11:05   ` Chris Wilson
2021-01-07 11:34     ` Andi Shyti
2021-01-07 12:53     ` Tvrtko Ursulin
2021-01-06 16:49 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v2,1/2] drm/i915: Wrap our timer_list.expires checking Patchwork
2021-01-06 17:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-07  1:55 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2021-01-07  9:25 ` [Intel-gfx] [PATCH v2 1/2] " Tvrtko Ursulin
2021-01-07 16:47 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [v2,1/2] drm/i915: Wrap our timer_list.expires checking (rev3) Patchwork
2021-01-07 17:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-07 21:37 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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).