* [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
@ 2017-10-24 15:13 Kees Cook
2017-10-24 16:17 ` Chris Wilson
0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2017-10-24 15:13 UTC (permalink / raw)
To: Jani Nikula
Cc: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Tvrtko Ursulin,
Chris Wilson, linux-kernel, intel-gfx, dri-devel
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: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
drivers/gpu/drm/i915/selftests/lib_sw_fence.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/selftests/lib_sw_fence.c b/drivers/gpu/drm/i915/selftests/lib_sw_fence.c
index 3790fdf44a1a..b26f07b55d86 100644
--- a/drivers/gpu/drm/i915/selftests/lib_sw_fence.c
+++ b/drivers/gpu/drm/i915/selftests/lib_sw_fence.c
@@ -49,9 +49,9 @@ void onstack_fence_fini(struct i915_sw_fence *fence)
i915_sw_fence_fini(fence);
}
-static void timed_fence_wake(unsigned long data)
+static void timed_fence_wake(struct timer_list *t)
{
- struct timed_fence *tf = (struct timed_fence *)data;
+ struct timed_fence *tf = from_timer(tf, t, timer);
i915_sw_fence_commit(&tf->fence);
}
@@ -60,7 +60,7 @@ void timed_fence_init(struct timed_fence *tf, unsigned long expires)
{
onstack_fence_init(&tf->fence);
- setup_timer_on_stack(&tf->timer, timed_fence_wake, (unsigned long)tf);
+ timer_setup_on_stack(&tf->timer, timed_fence_wake, 0);
if (time_after(expires, jiffies))
mod_timer(&tf->timer, expires);
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
2017-10-24 15:13 [PATCH] drm/i915/selftests: Convert timers to use timer_setup() Kees Cook
@ 2017-10-24 16:17 ` Chris Wilson
2017-10-25 10:24 ` Chris Wilson
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2017-10-24 16:17 UTC (permalink / raw)
To: Kees Cook, Jani Nikula
Cc: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Tvrtko Ursulin,
linux-kernel, intel-gfx, dri-devel
Quoting Kees Cook (2017-10-24 16:13:44)
> 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: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
Thank you for saving me from having to do this myself,
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
2017-10-24 16:17 ` Chris Wilson
@ 2017-10-25 10:24 ` Chris Wilson
2017-10-25 13:11 ` Chris Wilson
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2017-10-25 10:24 UTC (permalink / raw)
To: Kees Cook, Jani Nikula
Cc: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Tvrtko Ursulin,
linux-kernel, intel-gfx, dri-devel
Quoting Chris Wilson (2017-10-24 17:17:09)
> Quoting Kees Cook (2017-10-24 16:13:44)
> > 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: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: David Airlie <airlied@linux.ie>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: intel-gfx@lists.freedesktop.org
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Thank you for saving me from having to do this myself,
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
I've a small batch of selftests patches queued, so added this one and
will push to drm-intel-next-queued shortly.
-Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
2017-10-25 10:24 ` Chris Wilson
@ 2017-10-25 13:11 ` Chris Wilson
2017-10-25 14:05 ` Kees Cook
0 siblings, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2017-10-25 13:11 UTC (permalink / raw)
To: Kees Cook, Jani Nikula
Cc: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Tvrtko Ursulin,
linux-kernel, intel-gfx, dri-devel
Quoting Chris Wilson (2017-10-25 11:24:19)
> Quoting Chris Wilson (2017-10-24 17:17:09)
> > Quoting Kees Cook (2017-10-24 16:13:44)
> > > 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: Jani Nikula <jani.nikula@linux.intel.com>
> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Cc: David Airlie <airlied@linux.ie>
> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: intel-gfx@lists.freedesktop.org
> > > Cc: dri-devel@lists.freedesktop.org
> > > Signed-off-by: Kees Cook <keescook@chromium.org>
> >
> > Thank you for saving me from having to do this myself,
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> I've a small batch of selftests patches queued, so added this one and
> will push to drm-intel-next-queued shortly.
Oh dear, major faux pas. There is no timer_setup_on_stack yet.
-Chris
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
2017-10-25 13:11 ` Chris Wilson
@ 2017-10-25 14:05 ` Kees Cook
[not found] ` <150894101376.15898.4850985227645404827@mail.alporthouse.com>
0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2017-10-25 14:05 UTC (permalink / raw)
To: Chris Wilson
Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
Tvrtko Ursulin, LKML, intel-gfx, Maling list - DRI developers
On Wed, Oct 25, 2017 at 3:11 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Chris Wilson (2017-10-25 11:24:19)
>> Quoting Chris Wilson (2017-10-24 17:17:09)
>> > Quoting Kees Cook (2017-10-24 16:13:44)
>> > > 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: Jani Nikula <jani.nikula@linux.intel.com>
>> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> > > Cc: David Airlie <airlied@linux.ie>
>> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> > > Cc: intel-gfx@lists.freedesktop.org
>> > > Cc: dri-devel@lists.freedesktop.org
>> > > Signed-off-by: Kees Cook <keescook@chromium.org>
>> >
>> > Thank you for saving me from having to do this myself,
>> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>>
>> I've a small batch of selftests patches queued, so added this one and
>> will push to drm-intel-next-queued shortly.
>
> Oh dear, major faux pas. There is no timer_setup_on_stack yet.
Argh. Right, sorry. That's only in -next. Since this is mainly a
mechanical change, should I carry this in the timer tree, or wait
until the merge window for it to go via i915?
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
[not found] ` <150894101376.15898.4850985227645404827@mail.alporthouse.com>
@ 2017-10-25 14:27 ` Kees Cook
2017-10-25 14:32 ` Jani Nikula
0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2017-10-25 14:27 UTC (permalink / raw)
To: Chris Wilson
Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
Tvrtko Ursulin, LKML, intel-gfx, Maling list - DRI developers
On Wed, Oct 25, 2017 at 4:16 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> Quoting Kees Cook (2017-10-25 15:05:13)
>> On Wed, Oct 25, 2017 at 3:11 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> > Quoting Chris Wilson (2017-10-25 11:24:19)
>> >> Quoting Chris Wilson (2017-10-24 17:17:09)
>> >> > Quoting Kees Cook (2017-10-24 16:13:44)
>> >> > > 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: Jani Nikula <jani.nikula@linux.intel.com>
>> >> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> >> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> >> > > Cc: David Airlie <airlied@linux.ie>
>> >> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>> >> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> >> > > Cc: intel-gfx@lists.freedesktop.org
>> >> > > Cc: dri-devel@lists.freedesktop.org
>> >> > > Signed-off-by: Kees Cook <keescook@chromium.org>
>> >> >
>> >> > Thank you for saving me from having to do this myself,
>> >> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>> >>
>> >> I've a small batch of selftests patches queued, so added this one and
>> >> will push to drm-intel-next-queued shortly.
>> >
>> > Oh dear, major faux pas. There is no timer_setup_on_stack yet.
>>
>> Argh. Right, sorry. That's only in -next. Since this is mainly a
>> mechanical change, should I carry this in the timer tree, or wait
>> until the merge window for it to go via i915?
>
> Jani has the final word, but my understanding is that there will be no
> more from i915 towards the 4.15 merge. Hmm, the origin of this timer,
>
> commit 214707fc2ce08d09982bc4fe4b7a1c1f010e82be
> Author: Chris Wilson <chris@chris-wilson.co.uk>
> Date: Thu Oct 12 13:57:25 2017 +0100
>
> drm/i915/selftests: Wrap a timer into a i915_sw_fence
>
> did make it into 4.15, so it would have been better to put into a
> separate tree for the 4.15 merge window anyway. In hindsight, yes this
> probably wants to be carried in the timer tree to be applied after i915.
> (I guess there will be a few other stragglers that need to be converted
> at the end of the merge window anyway.)
Yeah, it's going to be messy, but I'll manage. I'll be carrying a lot
of other stuff as well. Avoiding conflicts will be the trick. Wheee.
:)
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/i915/selftests: Convert timers to use timer_setup()
2017-10-25 14:27 ` Kees Cook
@ 2017-10-25 14:32 ` Jani Nikula
0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2017-10-25 14:32 UTC (permalink / raw)
To: Kees Cook, Chris Wilson
Cc: Joonas Lahtinen, Rodrigo Vivi, David Airlie, Tvrtko Ursulin, LKML,
intel-gfx, Maling list - DRI developers
On Wed, 25 Oct 2017, Kees Cook <keescook@chromium.org> wrote:
> On Wed, Oct 25, 2017 at 4:16 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> Quoting Kees Cook (2017-10-25 15:05:13)
>>> On Wed, Oct 25, 2017 at 3:11 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>>> > Quoting Chris Wilson (2017-10-25 11:24:19)
>>> >> Quoting Chris Wilson (2017-10-24 17:17:09)
>>> >> > Quoting Kees Cook (2017-10-24 16:13:44)
>>> >> > > 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: Jani Nikula <jani.nikula@linux.intel.com>
>>> >> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>>> >> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>>> >> > > Cc: David Airlie <airlied@linux.ie>
>>> >> > > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> >> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>> >> > > Cc: intel-gfx@lists.freedesktop.org
>>> >> > > Cc: dri-devel@lists.freedesktop.org
>>> >> > > Signed-off-by: Kees Cook <keescook@chromium.org>
>>> >> >
>>> >> > Thank you for saving me from having to do this myself,
>>> >> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> >>
>>> >> I've a small batch of selftests patches queued, so added this one and
>>> >> will push to drm-intel-next-queued shortly.
>>> >
>>> > Oh dear, major faux pas. There is no timer_setup_on_stack yet.
>>>
>>> Argh. Right, sorry. That's only in -next. Since this is mainly a
>>> mechanical change, should I carry this in the timer tree, or wait
>>> until the merge window for it to go via i915?
>>
>> Jani has the final word, but my understanding is that there will be no
>> more from i915 towards the 4.15 merge. Hmm, the origin of this timer,
>>
>> commit 214707fc2ce08d09982bc4fe4b7a1c1f010e82be
>> Author: Chris Wilson <chris@chris-wilson.co.uk>
>> Date: Thu Oct 12 13:57:25 2017 +0100
>>
>> drm/i915/selftests: Wrap a timer into a i915_sw_fence
>>
>> did make it into 4.15, so it would have been better to put into a
>> separate tree for the 4.15 merge window anyway. In hindsight, yes this
>> probably wants to be carried in the timer tree to be applied after i915.
>> (I guess there will be a few other stragglers that need to be converted
>> at the end of the merge window anyway.)
>
> Yeah, it's going to be messy, but I'll manage. I'll be carrying a lot
> of other stuff as well. Avoiding conflicts will be the trick. Wheee.
> :)
Acked-by: Jani Nikula <jani.nikula@intel.com>
for merging via timer tree. Otherwise we'll need to wait for the changes
to hit Linus' tree, then get backmerges to our tree, and it's v4.16
before you know it. ;)
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-10-25 14:31 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 15:13 [PATCH] drm/i915/selftests: Convert timers to use timer_setup() Kees Cook
2017-10-24 16:17 ` Chris Wilson
2017-10-25 10:24 ` Chris Wilson
2017-10-25 13:11 ` Chris Wilson
2017-10-25 14:05 ` Kees Cook
[not found] ` <150894101376.15898.4850985227645404827@mail.alporthouse.com>
2017-10-25 14:27 ` Kees Cook
2017-10-25 14:32 ` Jani Nikula
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox