Delays, clocks, timers, hrtimers, etc

Mason mpeg.blue at free.fr
Wed Feb 11 13:58:45 PST 2015


Stephen Boyd wrote:

> Mason wrote:
>
>> Also, you wrote "I don't see any problem with the TWD dropping the
>> dependency on SMP." Would something as simple as this be acceptable?
>> (Most probably NOT; there are a lot of smp* occurrences in smp_twd.c
>> even the file name.) What is the rationale for the dependency?
>>
>>
>> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
>> index a34698d..47b02c8 100644
>> --- a/arch/arm/Kconfig
>> +++ b/arch/arm/Kconfig
>> @@ -1565,7 +1565,6 @@ config HAVE_ARM_ARCH_TIMER
>>   config HAVE_ARM_TWD
>>          bool
>> -       depends on SMP
>>          select CLKSRC_OF if OF
>>          help
>>            This options enables support for the ARM timer and watchdog unit
>>
>
> Hmm it looks like we would also need to add this to the patch. It
> looks like a holdover from when the local timer APIs were around.
> Back then twd_local_timer_common_register() would fail if
> is_smp() was false or setup_max_cpus was 0. Now it will just
> register a clockevent that may or may not be used depending on
> what other clockevents are in the system and the ratings of those
> other clockevents.
>
> ----8<----
> diff --git a/arch/arm/kernel/smp_twd.c b/arch/arm/kernel/smp_twd.c
> index 172c6a05d27f..e8f6d241881f 100644
> --- a/arch/arm/kernel/smp_twd.c
> +++ b/arch/arm/kernel/smp_twd.c
> @@ -23,7 +23,6 @@
>   #include <linux/of_irq.h>
>   #include <linux/of_address.h>
>
> -#include <asm/smp_plat.h>
>   #include <asm/smp_twd.h>
>
>   /* set up by the platform code */
> @@ -388,9 +387,6 @@ static void __init twd_local_timer_of_register(struct device_node *np)
>   {
>   	int err;
>
> -	if (!is_smp() || !setup_max_cpus)
> -		return;
> -
>   	twd_ppi = irq_of_parse_and_map(np, 0);
>   	if (!twd_ppi) {
>   		err = -EINVAL;

Looking at the difference between OF and !OF registration functions
in smp_twd.c

!OF
   if (twd_base || twd_evt) return -EBUSY;
   assign twd_ppi and twd_base
   twd_local_timer_common_register(NULL)

OF
   if (!is_smp() || !setup_max_cpus) return; // TO BE DELETED
   assign twd_ppi and twd_base
   twd_local_timer_common_register(np)

I suppose OF guarantees that the init code is called only once?
(Hence the !OF guard code would be unnecessary.)

Regards.




More information about the linux-arm-kernel mailing list