Re: [PATCH] drm/i915: Convert timers to use timer_setup()

2017-10-17 Thread Joonas Lahtinen
On Mon, 2017-10-16 at 15:55 -0700, Kees Cook wrote:
> 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 
> Cc: Jani Nikula 
> Cc: David Airlie 
> Cc: Chris Wilson 
> Cc: Joonas Lahtinen 
> Cc: Tvrtko Ursulin 
> Cc: Oscar Mateo 
> Cc: intel-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Kees Cook 
> Reviewed-by: Joonas Lahtinen  # for 
> mock_engine

Reviewed-by: Joonas Lahtinen 

For some reason our CI didn't pick this up even though it was correctly
sent to the mailing list, so I will re-send with my refreshed R-b for
our CI and then we can merge this.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/i915: Convert timers to use timer_setup()

2017-10-06 Thread Jani Nikula
On Thu, 05 Oct 2017, Kees Cook  wrote:
> On Thu, Oct 5, 2017 at 6:45 AM, Joonas Lahtinen
>  wrote:
>> On Wed, 2017-10-04 at 17:54 -0700, Kees Cook wrote:
>>> 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 
>>> Cc: Jani Nikula 
>>> Cc: David Airlie 
>>> Cc: Chris Wilson 
>>> Cc: Joonas Lahtinen 
>>> Cc: Tvrtko Ursulin 
>>> Cc: Oscar Mateo 
>>> Cc: intel-...@lists.freedesktop.org
>>> Cc: dri-devel@lists.freedesktop.org
>>> Cc: Thomas Gleixner 
>>> Signed-off-by: Kees Cook 
>>
>> 
>>
>>> @@ -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);
>>
>> The order is bit strange to me, it's not same as with container_of, but
>> I guess GCC will complain for getting it wrong. It's also slightly
>> different doing the typeof for you, so I guess it makes sense, so:
>
> Yeah, this seemed to be the least bad of several options. Other things
> ended up being either very long, named unlike anything else already in
> the kernel, etc.
>
>> Reviewed-by: Joonas Lahtinen 
>
> Thanks!
>
>> Do you expect for us to merge or are you looking to merge all timer
>> changes from single tree?
>
> If you have -rc3 in your tree already, please take this into your
> tree. If you prefer the timer tree to carry it, that can happen too.
> tglx suggested to me that it was better for maintainers to carry the
> changes.

We'll pick this when we have -rc3.

Thanks,
Jani.



-- 
Jani Nikula, Intel Open Source Technology Center
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/i915: Convert timers to use timer_setup()

2017-10-06 Thread Kees Cook
On Thu, Oct 5, 2017 at 6:45 AM, Joonas Lahtinen
 wrote:
> On Wed, 2017-10-04 at 17:54 -0700, Kees Cook wrote:
>> 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 
>> Cc: Jani Nikula 
>> Cc: David Airlie 
>> Cc: Chris Wilson 
>> Cc: Joonas Lahtinen 
>> Cc: Tvrtko Ursulin 
>> Cc: Oscar Mateo 
>> Cc: intel-...@lists.freedesktop.org
>> Cc: dri-devel@lists.freedesktop.org
>> Cc: Thomas Gleixner 
>> Signed-off-by: Kees Cook 
>
> 
>
>> @@ -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);
>
> The order is bit strange to me, it's not same as with container_of, but
> I guess GCC will complain for getting it wrong. It's also slightly
> different doing the typeof for you, so I guess it makes sense, so:

Yeah, this seemed to be the least bad of several options. Other things
ended up being either very long, named unlike anything else already in
the kernel, etc.

> Reviewed-by: Joonas Lahtinen 

Thanks!

> Do you expect for us to merge or are you looking to merge all timer
> changes from single tree?

If you have -rc3 in your tree already, please take this into your
tree. If you prefer the timer tree to carry it, that can happen too.
tglx suggested to me that it was better for maintainers to carry the
changes.

-Kees

-- 
Kees Cook
Pixel Security
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


Re: [PATCH] drm/i915: Convert timers to use timer_setup()

2017-10-05 Thread Joonas Lahtinen
On Wed, 2017-10-04 at 17:54 -0700, Kees Cook wrote:
> 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 
> Cc: Jani Nikula 
> Cc: David Airlie 
> Cc: Chris Wilson 
> Cc: Joonas Lahtinen 
> Cc: Tvrtko Ursulin 
> Cc: Oscar Mateo 
> Cc: intel-...@lists.freedesktop.org
> Cc: dri-devel@lists.freedesktop.org
> Cc: Thomas Gleixner 
> Signed-off-by: Kees Cook 



> @@ -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);

The order is bit strange to me, it's not same as with container_of, but
I guess GCC will complain for getting it wrong. It's also slightly
different doing the typeof for you, so I guess it makes sense, so:

Reviewed-by: Joonas Lahtinen 

Do you expect for us to merge or are you looking to merge all timer
changes from single tree?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel