Skip to content

Commit

Permalink
riscv: Fix kernel time_init()
Browse files Browse the repository at this point in the history
If of_clk_init() is not called in time_init(), clock providers defined
in the system device tree are not initialized, resulting in failures for
other devices to initialize due to missing clocks.
Similarly to other architectures and to the default kernel time_init()
implementation, call of_clk_init() before executing timer_probe() in
time_init().

Signed-off-by: Damien Le Moal <[email protected]>
Acked-by: Stephen Boyd <[email protected]>
Reviewed-by: Palmer Dabbelt <[email protected]>
Signed-off-by: Palmer Dabbelt <[email protected]>
  • Loading branch information
damien-lemoal authored and palmer-dabbelt committed Jan 8, 2021
1 parent cf7b2ae commit 11f4c2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/riscv/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
* Copyright (C) 2017 SiFive
*/

#include <linux/of_clk.h>
#include <linux/clocksource.h>
#include <linux/delay.h>
#include <asm/sbi.h>
Expand All @@ -24,6 +25,8 @@ void __init time_init(void)
riscv_timebase = prop;

lpj_fine = riscv_timebase / HZ;

of_clk_init(NULL);
timer_probe();
}

Expand Down

0 comments on commit 11f4c2e

Please sign in to comment.