All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	Intel graphics driver community testing & development
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [CI] drm/i915: Convert timers to use timer_setup()
Date: Thu, 19 Oct 2017 10:10:21 +0300	[thread overview]
Message-ID: <87h8uvhaua.fsf@intel.com> (raw)
In-Reply-To: <20171017065304.3358-1-joonas.lahtinen@linux.intel.com>

On Tue, 17 Oct 2017, Joonas Lahtinen <joonas.lahtinen@linux.intel.com> wrote:
> From: Kees Cook <keescook@chromium.org>
>
> In preparation for unconditionally passing the struct timer_list pointer to
> all timer callbacks, switch to using the new timer_setup() and from_timer()
> to pass the timer pointer explicitly.
>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Oscar Mateo <oscar.mateo@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Failed to mention I pushed this yesterday. Thanks for the patch and
review.

BR,
Jani.

> ---
>  drivers/gpu/drm/i915/i915_sw_fence.c         |  8 +++-----
>  drivers/gpu/drm/i915/intel_breadcrumbs.c     | 18 ++++++++----------
>  drivers/gpu/drm/i915/selftests/mock_engine.c |  8 +++-----
>  3 files changed, 14 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c b/drivers/gpu/drm/i915/i915_sw_fence.c
> index ca33cc08cb07..e8ca67a129d2 100644
> --- a/drivers/gpu/drm/i915/i915_sw_fence.c
> +++ b/drivers/gpu/drm/i915/i915_sw_fence.c
> @@ -369,9 +369,9 @@ struct i915_sw_dma_fence_cb {
>  	struct irq_work work;
>  };
>  
> -static void timer_i915_sw_fence_wake(unsigned long data)
> +static void timer_i915_sw_fence_wake(struct timer_list *t)
>  {
> -	struct i915_sw_dma_fence_cb *cb = (struct i915_sw_dma_fence_cb *)data;
> +	struct i915_sw_dma_fence_cb *cb = from_timer(cb, t, timer);
>  	struct i915_sw_fence *fence;
>  
>  	fence = xchg(&cb->fence, NULL);
> @@ -434,9 +434,7 @@ int i915_sw_fence_await_dma_fence(struct i915_sw_fence *fence,
>  	i915_sw_fence_await(fence);
>  
>  	cb->dma = NULL;
> -	__setup_timer(&cb->timer,
> -		      timer_i915_sw_fence_wake, (unsigned long)cb,
> -		      TIMER_IRQSAFE);
> +	timer_setup(&cb->timer, timer_i915_sw_fence_wake, TIMER_IRQSAFE);
>  	init_irq_work(&cb->work, irq_i915_sw_fence_work);
>  	if (timeout) {
>  		cb->dma = dma_fence_get(dma);
> diff --git a/drivers/gpu/drm/i915/intel_breadcrumbs.c b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> index 29c62d481cef..48e1ba01ccf8 100644
> --- a/drivers/gpu/drm/i915/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/intel_breadcrumbs.c
> @@ -74,9 +74,10 @@ static noinline void missed_breadcrumb(struct intel_engine_cs *engine)
>  	set_bit(engine->id, &engine->i915->gpu_error.missed_irq_rings);
>  }
>  
> -static void intel_breadcrumbs_hangcheck(unsigned long data)
> +static void intel_breadcrumbs_hangcheck(struct timer_list *t)
>  {
> -	struct intel_engine_cs *engine = (struct intel_engine_cs *)data;
> +	struct intel_engine_cs *engine = from_timer(engine, t,
> +						    breadcrumbs.hangcheck);
>  	struct intel_breadcrumbs *b = &engine->breadcrumbs;
>  
>  	if (!b->irq_armed)
> @@ -108,9 +109,10 @@ static void intel_breadcrumbs_hangcheck(unsigned long data)
>  	}
>  }
>  
> -static void intel_breadcrumbs_fake_irq(unsigned long data)
> +static void intel_breadcrumbs_fake_irq(struct timer_list *t)
>  {
> -	struct intel_engine_cs *engine = (struct intel_engine_cs *)data;
> +	struct intel_engine_cs *engine = from_timer(engine, t,
> +						    breadcrumbs.fake_irq);
>  	struct intel_breadcrumbs *b = &engine->breadcrumbs;
>  
>  	/* The timer persists in case we cannot enable interrupts,
> @@ -787,12 +789,8 @@ int intel_engine_init_breadcrumbs(struct intel_engine_cs *engine)
>  	spin_lock_init(&b->rb_lock);
>  	spin_lock_init(&b->irq_lock);
>  
> -	setup_timer(&b->fake_irq,
> -		    intel_breadcrumbs_fake_irq,
> -		    (unsigned long)engine);
> -	setup_timer(&b->hangcheck,
> -		    intel_breadcrumbs_hangcheck,
> -		    (unsigned long)engine);
> +	timer_setup(&b->fake_irq, intel_breadcrumbs_fake_irq, 0);
> +	timer_setup(&b->hangcheck, intel_breadcrumbs_hangcheck, 0);
>  
>  	/* Spawn a thread to provide a common bottom-half for all signals.
>  	 * As this is an asynchronous interface we cannot steal the current
> diff --git a/drivers/gpu/drm/i915/selftests/mock_engine.c b/drivers/gpu/drm/i915/selftests/mock_engine.c
> index fc0fd7498689..331c2b09869e 100644
> --- a/drivers/gpu/drm/i915/selftests/mock_engine.c
> +++ b/drivers/gpu/drm/i915/selftests/mock_engine.c
> @@ -32,9 +32,9 @@ static struct mock_request *first_request(struct mock_engine *engine)
>  					link);
>  }
>  
> -static void hw_delay_complete(unsigned long data)
> +static void hw_delay_complete(struct timer_list *t)
>  {
> -	struct mock_engine *engine = (typeof(engine))data;
> +	struct mock_engine *engine = from_timer(engine, t, hw_delay);
>  	struct mock_request *request;
>  
>  	spin_lock(&engine->hw_lock);
> @@ -161,9 +161,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
>  
>  	/* fake hw queue */
>  	spin_lock_init(&engine->hw_lock);
> -	setup_timer(&engine->hw_delay,
> -		    hw_delay_complete,
> -		    (unsigned long)engine);
> +	timer_setup(&engine->hw_delay, hw_delay_complete, 0);
>  	INIT_LIST_HEAD(&engine->hw_queue);
>  
>  	return &engine->base;

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      parent reply	other threads:[~2017-10-19  7:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-17  6:53 [CI] drm/i915: Convert timers to use timer_setup() Joonas Lahtinen
2017-10-17  7:13 ` ✓ Fi.CI.BAT: success for " Patchwork
2017-10-17 19:04 ` ✓ Fi.CI.IGT: " Patchwork
2017-10-19  7:10 ` Jani Nikula [this message]

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=87h8uvhaua.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@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 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.