* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
@ 2012-01-04 10:21 Linus Walleij
2012-01-12 16:10 ` Kristoffer Ericson
0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2012-01-04 10:21 UTC (permalink / raw)
To: linux-arm-kernel
This gets rid of the hairy mult/shift calculation for SA1100
timers and relies on clockevent core to figure this out, and removes
the hard-coded rate constant in favor of the CLOCK_TICK_RATE
already used by the clocksource.
Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
arch/arm/mach-sa1100/time.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
index 69e3353..5cb8c7b 100644
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -88,20 +88,14 @@ static void __init sa1100_timer_init(void)
OIER = 0;
OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
- setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
-
- clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
- ckevt_sa1100_osmr0.max_delta_ns =
- clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
- ckevt_sa1100_osmr0.min_delta_ns =
- clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
+ setup_sched_clock(sa1100_read_sched_clock, 32, CLOCK_TICK_RATE);
ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
-
setup_irq(IRQ_OST0, &sa1100_timer_irq);
clocksource_mmio_init(&OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
clocksource_mmio_readl_up);
- clockevents_register_device(&ckevt_sa1100_osmr0);
+ clockevents_config_and_register(&ckevt_sa1100_osmr0, CLOCK_TICK_RATE,
+ MIN_OSCR_DELTA * 2, 0x7fffffff);
}
#ifdef CONFIG_PM
--
1.7.6.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-04 10:21 [PATCH 2/2] mach-sa1100: modernize and cleanup timer code Linus Walleij
@ 2012-01-12 16:10 ` Kristoffer Ericson
2012-01-14 7:33 ` Linus Walleij
0 siblings, 1 reply; 8+ messages in thread
From: Kristoffer Ericson @ 2012-01-12 16:10 UTC (permalink / raw)
To: linux-arm-kernel
Urs?kta f?rseningen, fick n?got minne kring att cpu klockningen inte fungerade korrekt
om man inte satte direkt systemklock v?rde. Var n?got som pratade med russell om
f?r n?got ?r sedan.
Ska bara kika lite snabbt.
On Wed, Jan 04, 2012 at 11:21:53AM +0100, Linus Walleij wrote:
> This gets rid of the hairy mult/shift calculation for SA1100
> timers and relies on clockevent core to figure this out, and removes
> the hard-coded rate constant in favor of the CLOCK_TICK_RATE
> already used by the clocksource.
>
> Cc: Kristoffer Ericson <kristoffer.ericson@gmail.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> arch/arm/mach-sa1100/time.c | 12 +++---------
> 1 files changed, 3 insertions(+), 9 deletions(-)
>
> diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
> index 69e3353..5cb8c7b 100644
> --- a/arch/arm/mach-sa1100/time.c
> +++ b/arch/arm/mach-sa1100/time.c
> @@ -88,20 +88,14 @@ static void __init sa1100_timer_init(void)
> OIER = 0;
> OSSR = OSSR_M0 | OSSR_M1 | OSSR_M2 | OSSR_M3;
>
> - setup_sched_clock(sa1100_read_sched_clock, 32, 3686400);
> -
> - clockevents_calc_mult_shift(&ckevt_sa1100_osmr0, 3686400, 4);
> - ckevt_sa1100_osmr0.max_delta_ns =
> - clockevent_delta2ns(0x7fffffff, &ckevt_sa1100_osmr0);
> - ckevt_sa1100_osmr0.min_delta_ns =
> - clockevent_delta2ns(MIN_OSCR_DELTA * 2, &ckevt_sa1100_osmr0) + 1;
> + setup_sched_clock(sa1100_read_sched_clock, 32, CLOCK_TICK_RATE);
> ckevt_sa1100_osmr0.cpumask = cpumask_of(0);
> -
> setup_irq(IRQ_OST0, &sa1100_timer_irq);
>
> clocksource_mmio_init(&OSCR, "oscr", CLOCK_TICK_RATE, 200, 32,
> clocksource_mmio_readl_up);
> - clockevents_register_device(&ckevt_sa1100_osmr0);
> + clockevents_config_and_register(&ckevt_sa1100_osmr0, CLOCK_TICK_RATE,
> + MIN_OSCR_DELTA * 2, 0x7fffffff);
> }
>
> #ifdef CONFIG_PM
> --
> 1.7.6.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-12 16:10 ` Kristoffer Ericson
@ 2012-01-14 7:33 ` Linus Walleij
2012-01-14 8:42 ` Russell King - ARM Linux
0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2012-01-14 7:33 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, Jan 12, 2012 at 5:10 PM, Kristoffer Ericson
<kristoffer.ericson@gmail.com> wrote:
> Urs?kta f?rseningen, fick n?got minne kring att cpu klockningen inte fungerade korrekt
> om man inte satte direkt systemklock v?rde. Var n?got som pratade med russell om
> f?r n?got ?r sedan.
Menar du detta:
MIN_OSCR_DELTA * 2
S? ?r det ju med i den nya koden oxo, det ?r ingen semantisk skillnad
s? vitt jag kan se...
Det enda som egentligen ?ndras ?r att minimum lapse mellan tv? events
(mult+shift) ber?knas av clockevent core.
Linus
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-14 7:33 ` Linus Walleij
@ 2012-01-14 8:42 ` Russell King - ARM Linux
2012-01-14 11:41 ` Linus Walleij
0 siblings, 1 reply; 8+ messages in thread
From: Russell King - ARM Linux @ 2012-01-14 8:42 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jan 14, 2012 at 08:33:54AM +0100, Linus Walleij wrote:
> On Thu, Jan 12, 2012 at 5:10 PM, Kristoffer Ericson
> <kristoffer.ericson@gmail.com> wrote:
>
> > Urs?kta f?rseningen, fick n?got minne kring att cpu klockningen inte fungerade korrekt
> > om man inte satte direkt systemklock v?rde. Var n?got som pratade med russell om
> > f?r n?got ?r sedan.
>
> Menar du detta:
> MIN_OSCR_DELTA * 2
>
> S? ?r det ju med i den nya koden oxo, det ?r ingen semantisk skillnad
> s? vitt jag kan se...
>
> Det enda som egentligen ?ndras ?r att minimum lapse mellan tv? events
> (mult+shift) ber?knas av clockevent core.
If you speak english on these lists, other people might be able to
understand what you're saying.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-14 8:42 ` Russell King - ARM Linux
@ 2012-01-14 11:41 ` Linus Walleij
2012-01-14 12:09 ` Russell King - ARM Linux
0 siblings, 1 reply; 8+ messages in thread
From: Linus Walleij @ 2012-01-14 11:41 UTC (permalink / raw)
To: linux-arm-kernel
2012/1/14 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Sat, Jan 14, 2012 at 08:33:54AM +0100, Linus Walleij wrote:
>> On Thu, Jan 12, 2012 at 5:10 PM, Kristoffer Ericson
>> <kristoffer.ericson@gmail.com> wrote:
>>
>> > Urs?kta f?rseningen, fick n?got minne kring att cpu klockningen inte fungerade korrekt
>> > om man inte satte direkt systemklock v?rde. Var n?got som pratade med russell om
>> > f?r n?got ?r sedan.
>>
>> Menar du detta:
>> MIN_OSCR_DELTA * 2
>>
>> S? ?r det ju med i den nya koden oxo, det ?r ingen semantisk skillnad
>> s? vitt jag kan se...
>>
>> Det enda som egentligen ?ndras ?r att minimum lapse mellan tv? events
>> (mult+shift) ber?knas av clockevent core.
>
> If you speak english on these lists, other people might be able to
> understand what you're saying.
Haha sorry Russell I didn't notice that the response was in LAKML :-)
So Kristoffer remarked that the CPU clocking was sensitive on the
SA1100 so he wanted to test it first.
And I said that apart from the minimum scheduling interval now
handled by the clockevent core it should be semantically equivalent.
But it never hurts to test it so I'll wait for Kristoffers ACK.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-14 11:41 ` Linus Walleij
@ 2012-01-14 12:09 ` Russell King - ARM Linux
2012-01-14 12:59 ` Kristoffer Ericson
2012-01-14 19:34 ` Linus Walleij
0 siblings, 2 replies; 8+ messages in thread
From: Russell King - ARM Linux @ 2012-01-14 12:09 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jan 14, 2012 at 12:41:21PM +0100, Linus Walleij wrote:
> 2012/1/14 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > On Sat, Jan 14, 2012 at 08:33:54AM +0100, Linus Walleij wrote:
> >> On Thu, Jan 12, 2012 at 5:10 PM, Kristoffer Ericson
> >> <kristoffer.ericson@gmail.com> wrote:
> >>
> >> > Urs?kta f?rseningen, fick n?got minne kring att cpu klockningen inte fungerade korrekt
> >> > om man inte satte direkt systemklock v?rde. Var n?got som pratade med russell om
> >> > f?r n?got ?r sedan.
> >>
> >> Menar du detta:
> >> MIN_OSCR_DELTA * 2
> >>
> >> S? ?r det ju med i den nya koden oxo, det ?r ingen semantisk skillnad
> >> s? vitt jag kan se...
> >>
> >> Det enda som egentligen ?ndras ?r att minimum lapse mellan tv? events
> >> (mult+shift) ber?knas av clockevent core.
> >
> > If you speak english on these lists, other people might be able to
> > understand what you're saying.
>
> Haha sorry Russell I didn't notice that the response was in LAKML :-)
>
> So Kristoffer remarked that the CPU clocking was sensitive on the
> SA1100 so he wanted to test it first.
>
> And I said that apart from the minimum scheduling interval now
> handled by the clockevent core it should be semantically equivalent.
>
> But it never hurts to test it so I'll wait for Kristoffers ACK.
The only point I have on the patch is that it shouldn't use CLOCK_TICK_RATE
lets try to get away from this horrible definition in mach/timex.h.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-14 12:09 ` Russell King - ARM Linux
@ 2012-01-14 12:59 ` Kristoffer Ericson
2012-01-14 19:34 ` Linus Walleij
1 sibling, 0 replies; 8+ messages in thread
From: Kristoffer Ericson @ 2012-01-14 12:59 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jan 14, 2012 at 12:09:24PM +0000, Russell King - ARM Linux wrote:
> On Sat, Jan 14, 2012 at 12:41:21PM +0100, Linus Walleij wrote:
> > 2012/1/14 Russell King - ARM Linux <linux@arm.linux.org.uk>:
> > > On Sat, Jan 14, 2012 at 08:33:54AM +0100, Linus Walleij wrote:
> > >> On Thu, Jan 12, 2012 at 5:10 PM, Kristoffer Ericson
> > >> <kristoffer.ericson@gmail.com> wrote:
> > >>
> > >> > Urs?kta f?rseningen, fick n?got minne kring att cpu klockningen inte fungerade korrekt
> > >> > om man inte satte direkt systemklock v?rde. Var n?got som pratade med russell om
> > >> > f?r n?got ?r sedan.
> > >>
> > >> Menar du detta:
> > >> MIN_OSCR_DELTA * 2
> > >>
> > >> S? ?r det ju med i den nya koden oxo, det ?r ingen semantisk skillnad
> > >> s? vitt jag kan se...
> > >>
> > >> Det enda som egentligen ?ndras ?r att minimum lapse mellan tv? events
> > >> (mult+shift) ber?knas av clockevent core.
> > >
> > > If you speak english on these lists, other people might be able to
> > > understand what you're saying.
> >
Sorry, same mistake here :)
> > Haha sorry Russell I didn't notice that the response was in LAKML :-)
> >
> > So Kristoffer remarked that the CPU clocking was sensitive on the
> > SA1100 so he wanted to test it first.
> >
> > And I said that apart from the minimum scheduling interval now
> > handled by the clockevent core it should be semantically equivalent.
> >
> > But it never hurts to test it so I'll wait for Kristoffers ACK.
>
Ive looked at it and it checks out as you said. So acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
After Russels suggestion of course.
> The only point I have on the patch is that it shouldn't use CLOCK_TICK_RATE
> lets try to get away from this horrible definition in mach/timex.h.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/2] mach-sa1100: modernize and cleanup timer code
2012-01-14 12:09 ` Russell King - ARM Linux
2012-01-14 12:59 ` Kristoffer Ericson
@ 2012-01-14 19:34 ` Linus Walleij
1 sibling, 0 replies; 8+ messages in thread
From: Linus Walleij @ 2012-01-14 19:34 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jan 14, 2012 at 1:09 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> The only point I have on the patch is that it shouldn't use CLOCK_TICK_RATE
> lets try to get away from this horrible definition in mach/timex.h.
OK I'll replace that with (clockrate / HZ) as is custom.
Thanks!
Linus Walleij
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-01-14 19:34 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-04 10:21 [PATCH 2/2] mach-sa1100: modernize and cleanup timer code Linus Walleij
2012-01-12 16:10 ` Kristoffer Ericson
2012-01-14 7:33 ` Linus Walleij
2012-01-14 8:42 ` Russell King - ARM Linux
2012-01-14 11:41 ` Linus Walleij
2012-01-14 12:09 ` Russell King - ARM Linux
2012-01-14 12:59 ` Kristoffer Ericson
2012-01-14 19:34 ` Linus Walleij
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).