clocksource: arm_arch_timer: Set arch_mem_timer cpumask to cpu_possible_mask
authorSudeep Holla <[email protected]>
Mon, 9 Jul 2018 15:45:36 +0000 (16:45 +0100)
committerThomas Gleixner <[email protected]>
Tue, 10 Jul 2018 20:12:47 +0000 (22:12 +0200)
Currently, arch_mem_timer cpumask is set to cpu_all_mask which should be
fine. However, cpu_possible_mask is more accurate and if there are other
clockevent source in the system which are set to cpu_possible_mask, then
having cpu_all_mask may result in issue.

E.g. on a platform with arm,sp804 timer with rating 300 and
cpu_possible_mask and this arch_mem_timer timer with rating 400 and
cpu_all_mask, tick_check_preferred may choose both preferred as the
cpumasks are not equal though they must be.

This issue was root caused incorrectly initially and a fix was merged as
commit 1332a9055801 ("tick: Prefer a lower rating device only if it's CPU
local device").

Signed-off-by: Sudeep Holla <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Tested-by: Martin Blumenstingl <[email protected]>
Cc: [email protected]
Cc: Marc Zyngier <[email protected]>
Cc: Mark Rutland <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
drivers/clocksource/arm_arch_timer.c

index 57cb2f00fc07ce7f5ffb526bd9bb03ed11287626..d8c7f5750cdb025dfd3eae42d691318fc472e29b 100644 (file)
@@ -735,7 +735,7 @@ static void __arch_timer_setup(unsigned type,
                clk->features |= CLOCK_EVT_FEAT_DYNIRQ;
                clk->name = "arch_mem_timer";
                clk->rating = 400;
-               clk->cpumask = cpu_all_mask;
+               clk->cpumask = cpu_possible_mask;
                if (arch_timer_mem_use_virtual) {
                        clk->set_state_shutdown = arch_timer_shutdown_virt_mem;
                        clk->set_state_oneshot_stopped = arch_timer_shutdown_virt_mem;