Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2 1/2] drm/i915: Wrap our timer_list.expires checking
Date: Thu, 7 Jan 2021 09:25:44 +0000	[thread overview]
Message-ID: <8734de99-93eb-54a6-035f-75023180b13a@linux.intel.com> (raw)
In-Reply-To: <20210106163642.4405-1-chris@chris-wilson.co.uk>


On 06/01/2021 16:36, Chris Wilson wrote:
> 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);
>   }
>   
>   /*
> 

Don't know really, it's a bit dodgy to prefix with generic timer_ when 
semantics are i915 specific and apply only to timers managed with our 
set_timer_ms().

Have it for now and perhaps we can revisit to tidy later.

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

  parent reply	other threads:[~2021-01-07  9:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Tvrtko Ursulin [this message]
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

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=8734de99-93eb-54a6-035f-75023180b13a@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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