linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/vc4: Convert timers to use timer_setup()
@ 2017-10-24 15:16 Kees Cook
  2017-10-30 23:49 ` Eric Anholt
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2017-10-24 15:16 UTC (permalink / raw)
  To: Eric Anholt; +Cc: David Airlie, linux-kernel, 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: Eric Anholt <eric@anholt.net>
Cc: David Airlie <airlied@linux.ie>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 drivers/gpu/drm/vc4/vc4_bo.c  |  9 +++------
 drivers/gpu/drm/vc4/vc4_gem.c | 10 ++++------
 2 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c
index 3afdbf4bc10b..ee07e072cd2a 100644
--- a/drivers/gpu/drm/vc4/vc4_bo.c
+++ b/drivers/gpu/drm/vc4/vc4_bo.c
@@ -461,10 +461,9 @@ static void vc4_bo_cache_time_work(struct work_struct *work)
 	mutex_unlock(&vc4->bo_lock);
 }
 
-static void vc4_bo_cache_time_timer(unsigned long data)
+static void vc4_bo_cache_time_timer(struct timer_list *t)
 {
-	struct drm_device *dev = (struct drm_device *)data;
-	struct vc4_dev *vc4 = to_vc4_dev(dev);
+	struct vc4_dev *vc4 = from_timer(vc4, t, bo_cache.time_timer);
 
 	schedule_work(&vc4->bo_cache.time_work);
 }
@@ -768,9 +767,7 @@ int vc4_bo_cache_init(struct drm_device *dev)
 	INIT_LIST_HEAD(&vc4->bo_cache.time_list);
 
 	INIT_WORK(&vc4->bo_cache.time_work, vc4_bo_cache_time_work);
-	setup_timer(&vc4->bo_cache.time_timer,
-		    vc4_bo_cache_time_timer,
-		    (unsigned long)dev);
+	timer_setup(&vc4->bo_cache.time_timer, vc4_bo_cache_time_timer, 0);
 
 	return 0;
 }
diff --git a/drivers/gpu/drm/vc4/vc4_gem.c b/drivers/gpu/drm/vc4/vc4_gem.c
index d0c6bfb68c4e..ce6bca06f937 100644
--- a/drivers/gpu/drm/vc4/vc4_gem.c
+++ b/drivers/gpu/drm/vc4/vc4_gem.c
@@ -281,10 +281,10 @@ vc4_reset_work(struct work_struct *work)
 }
 
 static void
-vc4_hangcheck_elapsed(unsigned long data)
+vc4_hangcheck_elapsed(struct timer_list *t)
 {
-	struct drm_device *dev = (struct drm_device *)data;
-	struct vc4_dev *vc4 = to_vc4_dev(dev);
+	struct vc4_dev *vc4 = from_timer(vc4, t, hangcheck.timer);
+	struct drm_device *dev = vc4->dev;
 	uint32_t ct0ca, ct1ca;
 	unsigned long irqflags;
 	struct vc4_exec_info *bin_exec, *render_exec;
@@ -1091,9 +1091,7 @@ vc4_gem_init(struct drm_device *dev)
 	spin_lock_init(&vc4->job_lock);
 
 	INIT_WORK(&vc4->hangcheck.reset_work, vc4_reset_work);
-	setup_timer(&vc4->hangcheck.timer,
-		    vc4_hangcheck_elapsed,
-		    (unsigned long)dev);
+	timer_setup(&vc4->hangcheck.timer, vc4_hangcheck_elapsed, 0);
 
 	INIT_WORK(&vc4->job_done_work, vc4_job_done_work);
 
-- 
2.7.4


-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] drm/vc4: Convert timers to use timer_setup()
  2017-10-24 15:16 [PATCH] drm/vc4: Convert timers to use timer_setup() Kees Cook
@ 2017-10-30 23:49 ` Eric Anholt
  2017-11-03 19:27   ` Kees Cook
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Anholt @ 2017-10-30 23:49 UTC (permalink / raw)
  To: Kees Cook; +Cc: David Airlie, linux-kernel, dri-devel

[-- Attachment #1: Type: text/plain, Size: 288 bytes --]

Kees Cook <keescook@chromium.org> writes:

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

Reviewed and applied to drm-misc-next.  Thanks!

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH] drm/vc4: Convert timers to use timer_setup()
  2017-10-30 23:49 ` Eric Anholt
@ 2017-11-03 19:27   ` Kees Cook
  2017-11-03 20:07     ` Eric Anholt
  0 siblings, 1 reply; 5+ messages in thread
From: Kees Cook @ 2017-11-03 19:27 UTC (permalink / raw)
  To: Eric Anholt; +Cc: David Airlie, LKML, Maling list - DRI developers

On Mon, Oct 30, 2017 at 4:49 PM, Eric Anholt <eric@anholt.net> wrote:
> Kees Cook <keescook@chromium.org> writes:
>
>> 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.
>
> Reviewed and applied to drm-misc-next.  Thanks!

Thanks!

I happened to notice that this was in next-20171102, but missing in
next-20171103. Did it get removed, or am I misunderstanding something?

-Kees

-- 
Kees Cook
Pixel Security

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

* Re: [PATCH] drm/vc4: Convert timers to use timer_setup()
  2017-11-03 19:27   ` Kees Cook
@ 2017-11-03 20:07     ` Eric Anholt
  2017-11-06  8:39       ` Daniel Vetter
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Anholt @ 2017-11-03 20:07 UTC (permalink / raw)
  To: Kees Cook; +Cc: David Airlie, LKML, Maling list - DRI developers

[-- Attachment #1: Type: text/plain, Size: 671 bytes --]

Kees Cook <keescook@chromium.org> writes:

> On Mon, Oct 30, 2017 at 4:49 PM, Eric Anholt <eric@anholt.net> wrote:
>> Kees Cook <keescook@chromium.org> writes:
>>
>>> 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.
>>
>> Reviewed and applied to drm-misc-next.  Thanks!
>
> Thanks!
>
> I happened to notice that this was in next-20171102, but missing in
> next-20171103. Did it get removed, or am I misunderstanding something?

I don't know.  It's in drm-misc-next, though, so it'll flow upstream
without my intervention.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

* Re: [PATCH] drm/vc4: Convert timers to use timer_setup()
  2017-11-03 20:07     ` Eric Anholt
@ 2017-11-06  8:39       ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2017-11-06  8:39 UTC (permalink / raw)
  To: Eric Anholt; +Cc: Kees Cook, David Airlie, LKML, Maling list - DRI developers

On Fri, Nov 03, 2017 at 01:07:57PM -0700, Eric Anholt wrote:
> Kees Cook <keescook@chromium.org> writes:
> 
> > On Mon, Oct 30, 2017 at 4:49 PM, Eric Anholt <eric@anholt.net> wrote:
> >> Kees Cook <keescook@chromium.org> writes:
> >>
> >>> 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.
> >>
> >> Reviewed and applied to drm-misc-next.  Thanks!
> >
> > Thanks!
> >
> > I happened to notice that this was in next-20171102, but missing in
> > next-20171103. Did it get removed, or am I misunderstanding something?
> 
> I don't know.  It's in drm-misc-next, though, so it'll flow upstream
> without my intervention.

I'll make 4.16. Again, our merge cutoff is -rc6, hence why they all
missed. I guess one more to cherry-pick for you, or time to give up?
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

end of thread, other threads:[~2017-11-06  8:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 15:16 [PATCH] drm/vc4: Convert timers to use timer_setup() Kees Cook
2017-10-30 23:49 ` Eric Anholt
2017-11-03 19:27   ` Kees Cook
2017-11-03 20:07     ` Eric Anholt
2017-11-06  8:39       ` Daniel Vetter

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