From mboxrd@z Thu Jan 1 00:00:00 1970 From: mpeg.blue@free.fr (Mason) Date: Wed, 11 Feb 2015 13:58:45 -0800 Subject: Delays, clocks, timers, hrtimers, etc In-Reply-To: <20150211184515.GB11190@codeaurora.org> References: <54C8E125.3070905@free.fr> <54D52F84.9050600@free.fr> <266c7b1ff2d1a8ba0ae4866f4fb4eca5@agner.ch> <54D576B1.4000001@free.fr> <54D903F6.3050608@codeaurora.org> <54D93556.9050008@free.fr> <54D93FFA.3090506@codeaurora.org> <54D947B4.4080401@free.fr> <54DB94B0.8020000@free.fr> <20150211184515.GB11190@codeaurora.org> Message-ID: <54DBD095.3040800@free.fr> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org 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 > #include > > -#include > #include > > /* 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.