summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/board/clock.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-04-25 11:48:57 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-04-25 12:34:48 +0200
commiteec09d7b9edc8f740c78d545d918ecd8f6efba4f (patch)
treeb4d91cf974500ccec63abeea59c995b5a881a44b /arch/sandbox/board/clock.c
parent8194c6a8aab370fe38a9b9ca41a9965ad9de4c57 (diff)
downloadbarebox-eec09d7b9edc8f740c78d545d918ecd8f6efba4f.tar.gz
barebox-eec09d7b9edc8f740c78d545d918ecd8f6efba4f.tar.xz
clocksource: assign non-zero priorities to all clocksources
Most barebox clocksources have a zero priority and if multiple of them exist, but no higher priority ones, the first to call init_clock wins. Some supported boards like the Raspberry Pi additionally depended on initcall ordering to favor one zero-priority clocksource over another. With the move to deep probe and with Commit b641580deb8c ("of: platform: Ensure timers are probed early"), device tree blob iteration order could now dictate which clocksource is ultimately used. This led to a 20 times slower clock source being chosen on the Raspberry Pi, because the ARM architected timer was taken instead of the bcm2835 timer. Fix the root cause by assigning priorities to all clocksource drivers. Priorities chosen are: 50: device_initcall 60: coredevice_initcall 70: postcore_initcall 80: core_initcall These priorities are all below 100, which was previously the lowest positive priority and as they are positive, they win against the dummy clocksource. This should ensure no priority inversion happens. Fixes: b641580deb8c ("of: platform: Ensure timers are probed early") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220425094857.674044-4-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/sandbox/board/clock.c')
-rw-r--r--arch/sandbox/board/clock.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/sandbox/board/clock.c b/arch/sandbox/board/clock.c
index b005e71633..1787fb5786 100644
--- a/arch/sandbox/board/clock.c
+++ b/arch/sandbox/board/clock.c
@@ -28,6 +28,7 @@ static struct clocksource cs = {
.read = linux_clocksource_read,
.mask = CLOCKSOURCE_MASK(32),
.shift = 10,
+ .priority = 80,
};
static int clocksource_init (void)