diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-04-25 11:48:57 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-04-25 12:34:48 +0200 |
commit | eec09d7b9edc8f740c78d545d918ecd8f6efba4f (patch) | |
tree | b4d91cf974500ccec63abeea59c995b5a881a44b /drivers/clocksource/timer-ti-dm.c | |
parent | 8194c6a8aab370fe38a9b9ca41a9965ad9de4c57 (diff) | |
download | barebox-eec09d7b9edc8f740c78d545d918ecd8f6efba4f.tar.gz |
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 'drivers/clocksource/timer-ti-dm.c')
-rw-r--r-- | drivers/clocksource/timer-ti-dm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clocksource/timer-ti-dm.c b/drivers/clocksource/timer-ti-dm.c index d43609ad19..cdd297f10c 100644 --- a/drivers/clocksource/timer-ti-dm.c +++ b/drivers/clocksource/timer-ti-dm.c @@ -62,6 +62,7 @@ static struct clocksource dmtimer_cs = { .read = dmtimer_read, .mask = CLOCKSOURCE_MASK(32), .shift = 10, + .priority = 70, }; static int omap_dmtimer_probe(struct device_d *dev) |