Re: [PATCH v2 04/17] clocksource: Add Owl timer

From: Andreas FÃrber
Date: Sun Feb 26 2017 - 09:43:39 EST


Am 25.02.2017 um 22:59 schrieb Daniel Lezcano:
> On Sat, Feb 25, 2017 at 12:25:32AM +0100, Andreas FÃrber wrote:
>> Am 24.02.2017 um 23:29 schrieb Daniel Lezcano:
>>> On Fri, Feb 24, 2017 at 04:40:42AM +0100, Andreas FÃrber wrote:
>>>> +static struct clock_event_device owl_clockevent = {
>>>> + .name = "owl_tick",
>>>> + .rating = 200,
>>>> + .features = CLOCK_EVT_FEAT_ONESHOT,
>>>
>>> Did you consider adding CLOCK_EVT_FEAT_DYNIRQ ?
>>
>> No, it was not present downstream. Got a good example?
>
> https://lwn.net/Articles/541000/

Looking at your current Nomadik code, it seems I can literally should
just add this flag (done), without needing to implement any new hooks.

On a related topic, how do we determine the cpumask? Downstream and some
in-tree drivers use cpumask_of(0), others use cpu_possible_mask.

>> Do you spot anything functionally wrong in this driver? Despite adding
>> this new driver, I am only getting the following additional earlycon output:
>>
>> [ 0.000029] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps
>> every 89478484971ns
>> [ 0.007888] clocksource: timer: mask: 0xffffffff max_cycles:
>> 0xffffffff, max_idle_ns: 79635851949 ns
>> [ 0.017748] Console: colour dummy device 80x30
>> [ 0.022243] Calibrating delay loop...
>> [ 0.030895] random: fast init done
>> [ 0.231021] random: crng init done
>>
>> For S900 I'm using the generic timer instead.
>
> I don't get the issue, can you elaborate ?

Found it myself: I forgot to clear the interrupt pending bit in the
interrupt handler routine.

+ writel(OWL_Tx_CTL_PD, owl_timer_base + OWL_T1_CTL);

Now it goes past this point, initializes the real serial driver and
boots up to not finding the rootfs:

[ 0.000032] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps
every 89478484971ns
[ 0.007898] clocksource: timer: mask: 0xffffffff max_cycles:
0xffffffff, max_idle_ns: 79635851949 ns
[ 0.017886] Console: colour dummy device 80x30
[ 0.022386] Calibrating delay loop... 405.50 BogoMIPS (lpj=2027520)
[ 0.083523] pid_max: default: 32768 minimum: 301
...

Regards,
Andreas

--
SUSE Linux GmbH, Maxfeldstr. 5, 90409 NÃrnberg, Germany
GF: Felix ImendÃrffer, Jane Smithard, Graham Norton
HRB 21284 (AG NÃrnberg)