* [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
@ 2017-10-16 23:47 Kees Cook
2017-10-17 2:52 ` Nicholas Piggin
2017-10-17 3:49 ` Michael Ellerman
0 siblings, 2 replies; 7+ messages in thread
From: Kees Cook @ 2017-10-16 23:47 UTC (permalink / raw)
To: Michael Ellerman
Cc: Benjamin Herrenschmidt, Paul Mackerras, Nicholas Piggin,
linuxppc-dev, linux-kernel
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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Kees Cook <keescook@chromium.org>
---
arch/powerpc/kernel/watchdog.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
index 15e209a37c2d..50797528b5e1 100644
--- a/arch/powerpc/kernel/watchdog.c
+++ b/arch/powerpc/kernel/watchdog.c
@@ -263,9 +263,8 @@ static void wd_timer_reset(unsigned int cpu, struct timer_list *t)
add_timer_on(t, cpu);
}
-static void wd_timer_fn(unsigned long data)
+static void wd_timer_fn(struct timer_list *t)
{
- struct timer_list *t = this_cpu_ptr(&wd_timer);
int cpu = smp_processor_id();
watchdog_timer_interrupt(cpu);
@@ -292,7 +291,7 @@ static void start_watchdog_timer_on(unsigned int cpu)
per_cpu(wd_timer_tb, cpu) = get_tb();
- setup_pinned_timer(t, wd_timer_fn, 0);
+ timer_setup(t, wd_timer_fn, TIMER_PINNED);
wd_timer_reset(cpu, t);
}
--
2.7.4
--
Kees Cook
Pixel Security
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
2017-10-16 23:47 [PATCH] powerpc/watchdog: Convert timers to use timer_setup() Kees Cook
@ 2017-10-17 2:52 ` Nicholas Piggin
2017-10-17 12:29 ` Michael Ellerman
2017-10-17 3:49 ` Michael Ellerman
1 sibling, 1 reply; 7+ messages in thread
From: Nicholas Piggin @ 2017-10-17 2:52 UTC (permalink / raw)
To: Kees Cook
Cc: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev, linux-kernel
On Mon, 16 Oct 2017 16:47:10 -0700
Kees Cook <keescook@chromium.org> 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
Looks fine to me. Is this intended to be merged via the powerpc tree
in the next merge window?
Acked-by: Nicholas Piggin <npiggin@gmail.com>
> ---
> arch/powerpc/kernel/watchdog.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
> index 15e209a37c2d..50797528b5e1 100644
> --- a/arch/powerpc/kernel/watchdog.c
> +++ b/arch/powerpc/kernel/watchdog.c
> @@ -263,9 +263,8 @@ static void wd_timer_reset(unsigned int cpu, struct timer_list *t)
> add_timer_on(t, cpu);
> }
>
> -static void wd_timer_fn(unsigned long data)
> +static void wd_timer_fn(struct timer_list *t)
> {
> - struct timer_list *t = this_cpu_ptr(&wd_timer);
> int cpu = smp_processor_id();
>
> watchdog_timer_interrupt(cpu);
> @@ -292,7 +291,7 @@ static void start_watchdog_timer_on(unsigned int cpu)
>
> per_cpu(wd_timer_tb, cpu) = get_tb();
>
> - setup_pinned_timer(t, wd_timer_fn, 0);
> + timer_setup(t, wd_timer_fn, TIMER_PINNED);
> wd_timer_reset(cpu, t);
> }
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
2017-10-16 23:47 [PATCH] powerpc/watchdog: Convert timers to use timer_setup() Kees Cook
2017-10-17 2:52 ` Nicholas Piggin
@ 2017-10-17 3:49 ` Michael Ellerman
1 sibling, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2017-10-17 3:49 UTC (permalink / raw)
To: Kees Cook
Cc: Benjamin Herrenschmidt, Paul Mackerras, Nicholas Piggin,
linuxppc-dev, linux-kernel
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.
>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Paul Mackerras <paulus@samba.org>
> Cc: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Cc: linuxppc-dev@lists.ozlabs.org
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> arch/powerpc/kernel/watchdog.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/arch/powerpc/kernel/watchdog.c b/arch/powerpc/kernel/watchdog.c
> index 15e209a37c2d..50797528b5e1 100644
> --- a/arch/powerpc/kernel/watchdog.c
> +++ b/arch/powerpc/kernel/watchdog.c
> @@ -263,9 +263,8 @@ static void wd_timer_reset(unsigned int cpu, struct timer_list *t)
> add_timer_on(t, cpu);
> }
>
> -static void wd_timer_fn(unsigned long data)
> +static void wd_timer_fn(struct timer_list *t)
At first glance this looks like it will break, changing the signature,
but the new timer_setup() force-casts to the old signature (for now),
and we can fit a pointer in an unsigned long so it's OK.
> {
> - struct timer_list *t = this_cpu_ptr(&wd_timer);
> int cpu = smp_processor_id();
>
> watchdog_timer_interrupt(cpu);
> @@ -292,7 +291,7 @@ static void start_watchdog_timer_on(unsigned int cpu)
>
> per_cpu(wd_timer_tb, cpu) = get_tb();
>
> - setup_pinned_timer(t, wd_timer_fn, 0);
> + timer_setup(t, wd_timer_fn, TIMER_PINNED);
> wd_timer_reset(cpu, t);
> }
>
Acked-by: Michael Ellerman <mpe@ellerman.id.au>
cheers
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
2017-10-17 2:52 ` Nicholas Piggin
@ 2017-10-17 12:29 ` Michael Ellerman
2017-10-17 15:23 ` Kees Cook
0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2017-10-17 12:29 UTC (permalink / raw)
To: Nicholas Piggin, Kees Cook
Cc: Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev,
linux-kernel
Nicholas Piggin <npiggin@gmail.com> writes:
> On Mon, 16 Oct 2017 16:47:10 -0700
> Kees Cook <keescook@chromium.org> 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>> Cc: Paul Mackerras <paulus@samba.org>
>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>> Cc: Nicholas Piggin <npiggin@gmail.com>
>> Cc: linuxppc-dev@lists.ozlabs.org
>> Signed-off-by: Kees Cook <keescook@chromium.org>
>
> Looks fine to me. Is this intended to be merged via the powerpc tree
> in the next merge window?
It relies on the new timer_setup(), which is in one of tglx's trees (I
think). So I expect it to go via that tree.
cheers
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
2017-10-17 12:29 ` Michael Ellerman
@ 2017-10-17 15:23 ` Kees Cook
2017-10-18 12:22 ` Michael Ellerman
0 siblings, 1 reply; 7+ messages in thread
From: Kees Cook @ 2017-10-17 15:23 UTC (permalink / raw)
To: Michael Ellerman
Cc: Nicholas Piggin, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev@lists.ozlabs.org, LKML
On Tue, Oct 17, 2017 at 5:29 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Nicholas Piggin <npiggin@gmail.com> writes:
>
>> On Mon, 16 Oct 2017 16:47:10 -0700
>> Kees Cook <keescook@chromium.org> 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>> Cc: Paul Mackerras <paulus@samba.org>
>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>> Cc: Nicholas Piggin <npiggin@gmail.com>
>>> Cc: linuxppc-dev@lists.ozlabs.org
>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>
>> Looks fine to me. Is this intended to be merged via the powerpc tree
>> in the next merge window?
>
> It relies on the new timer_setup(), which is in one of tglx's trees (I
> think). So I expect it to go via that tree.
It's in -rc3, but the timer tree can carry it if you want. Which do you prefer?
-Kees
--
Kees Cook
Pixel Security
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
2017-10-17 15:23 ` Kees Cook
@ 2017-10-18 12:22 ` Michael Ellerman
2017-10-19 1:05 ` Michael Ellerman
0 siblings, 1 reply; 7+ messages in thread
From: Michael Ellerman @ 2017-10-18 12:22 UTC (permalink / raw)
To: Kees Cook
Cc: Nicholas Piggin, Benjamin Herrenschmidt, Paul Mackerras,
linuxppc-dev@lists.ozlabs.org, LKML
Kees Cook <keescook@chromium.org> writes:
> On Tue, Oct 17, 2017 at 5:29 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> Nicholas Piggin <npiggin@gmail.com> writes:
>>
>>> On Mon, 16 Oct 2017 16:47:10 -0700
>>> Kees Cook <keescook@chromium.org> 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>> Cc: Paul Mackerras <paulus@samba.org>
>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>>> Cc: Nicholas Piggin <npiggin@gmail.com>
>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>>
>>> Looks fine to me. Is this intended to be merged via the powerpc tree
>>> in the next merge window?
>>
>> It relies on the new timer_setup(), which is in one of tglx's trees (I
>> think). So I expect it to go via that tree.
>
> It's in -rc3, but the timer tree can carry it if you want. Which do
> you prefer?
Oh sorry, I assumed it was in only in linux-next.
I'll take this. Thanks.
cheers
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] powerpc/watchdog: Convert timers to use timer_setup()
2017-10-18 12:22 ` Michael Ellerman
@ 2017-10-19 1:05 ` Michael Ellerman
0 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2017-10-19 1:05 UTC (permalink / raw)
To: Kees Cook
Cc: Paul Mackerras, linuxppc-dev@lists.ozlabs.org, Nicholas Piggin,
LKML
Michael Ellerman <mpe@ellerman.id.au> writes:
> Kees Cook <keescook@chromium.org> writes:
>> On Tue, Oct 17, 2017 at 5:29 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>>> Nicholas Piggin <npiggin@gmail.com> writes:
>>>> On Mon, 16 Oct 2017 16:47:10 -0700
>>>> Kees Cook <keescook@chromium.org> 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: Benjamin Herrenschmidt <benh@kernel.crashing.org>
>>>>> Cc: Paul Mackerras <paulus@samba.org>
>>>>> Cc: Michael Ellerman <mpe@ellerman.id.au>
>>>>> Cc: Nicholas Piggin <npiggin@gmail.com>
>>>>> Cc: linuxppc-dev@lists.ozlabs.org
>>>>> Signed-off-by: Kees Cook <keescook@chromium.org>
>>>>
>>>> Looks fine to me. Is this intended to be merged via the powerpc tree
>>>> in the next merge window?
>>>
>>> It relies on the new timer_setup(), which is in one of tglx's trees (I
>>> think). So I expect it to go via that tree.
>>
>> It's in -rc3, but the timer tree can carry it if you want. Which do
>> you prefer?
>
> Oh sorry, I assumed it was in only in linux-next.
>
> I'll take this. Thanks.
Ugh, I'm an <expletive deleted>.
My next is based on rc2, so I can't take this.
Can you please pick it up.
cheers
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2017-10-19 1:05 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-16 23:47 [PATCH] powerpc/watchdog: Convert timers to use timer_setup() Kees Cook
2017-10-17 2:52 ` Nicholas Piggin
2017-10-17 12:29 ` Michael Ellerman
2017-10-17 15:23 ` Kees Cook
2017-10-18 12:22 ` Michael Ellerman
2017-10-19 1:05 ` Michael Ellerman
2017-10-17 3:49 ` Michael Ellerman
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).