linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Damien Le Moal <damien.lemoal@wdc.com>
To: Palmer Dabbelt <palmer@dabbelt.com>,
	linux-riscv@lists.infradead.org, Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, Stephen Boyd <sboyd@kernel.org>,
	linux-clk@vger.kernel.org,
	Linus Walleij <linus.walleij@linaro.org>,
	linux-gpio@vger.kernel.org,
	Philipp Zabel <p.zabel@pengutronix.de>
Cc: Sean Anderson <seanga2@gmail.com>
Subject: [PATCH v8 01/22] riscv: Fix kernel time_init()
Date: Thu, 10 Dec 2020 23:02:52 +0900	[thread overview]
Message-ID: <20201210140313.258739-2-damien.lemoal@wdc.com> (raw)
In-Reply-To: <20201210140313.258739-1-damien.lemoal@wdc.com>

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 <damien.lemoal@wdc.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
---
 arch/riscv/kernel/time.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
index 4d3a1048ad8b..8a5cf99c0776 100644
--- a/arch/riscv/kernel/time.c
+++ b/arch/riscv/kernel/time.c
@@ -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>
@@ -24,6 +25,8 @@ void __init time_init(void)
 	riscv_timebase = prop;
 
 	lpj_fine = riscv_timebase / HZ;
+
+	of_clk_init(NULL);
 	timer_probe();
 }
 
-- 
2.29.2


  reply	other threads:[~2020-12-10 14:05 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-10 14:02 [PATCH v8 00/22] RISC-V Kendryte K210 support improvements Damien Le Moal
2020-12-10 14:02 ` Damien Le Moal [this message]
2020-12-11  2:09   ` [PATCH v8 01/22] riscv: Fix kernel time_init() Palmer Dabbelt
2020-12-10 14:02 ` [PATCH v8 02/22] riscv: Fix sifive serial driver Damien Le Moal
2020-12-11  2:09   ` Palmer Dabbelt
2020-12-11  4:34     ` Damien Le Moal
2020-12-10 14:02 ` [PATCH v8 03/22] riscv: Enable interrupts during syscalls with M-Mode Damien Le Moal
2020-12-11  2:09   ` Palmer Dabbelt
2020-12-10 14:02 ` [PATCH v8 04/22] riscv: Fix builtin DTB handling Damien Le Moal
2020-12-10 14:02 ` [PATCH v8 05/22] riscv: Use vendor name for K210 SoC support Damien Le Moal
2020-12-10 14:02 ` [PATCH v8 06/22] riscv: cleanup Canaan Kendryte K210 sysctl driver Damien Le Moal
2020-12-10 14:02 ` [PATCH v8 07/22] dt-bindings: Add Canaan vendor prefix Damien Le Moal
2020-12-11  3:47   ` Rob Herring
2020-12-10 14:02 ` [PATCH v8 08/22] dt-binding: clock: Document canaan,k210-clk bindings Damien Le Moal
2020-12-11  3:48   ` Rob Herring
2020-12-10 14:03 ` [PATCH v8 09/22] dt-bindings: reset: Document canaan,k210-rst bindings Damien Le Moal
2020-12-11  3:48   ` Rob Herring
2020-12-10 14:03 ` [PATCH v8 10/22] dt-bindings: pinctrl: Document canaan,k210-fpioa bindings Damien Le Moal
2020-12-11  3:51   ` Rob Herring
2020-12-10 14:03 ` [PATCH v8 11/22] dt-binding: mfd: Document canaan,k210-sysctl bindings Damien Le Moal
2020-12-11  3:54   ` Rob Herring
2020-12-10 14:03 ` [PATCH v8 12/22] riscv: Add Canaan Kendryte K210 clock driver Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 13/22] riscv: Add Canaan Kendryte K210 reset controller Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 14/22] riscv: Add Canaan Kendryte K210 FPIOA driver Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 15/22] riscv: Update Canaan Kendryte K210 device tree Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 16/22] riscv: Add SiPeed MAIX BiT board " Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 17/22] riscv: Add SiPeed MAIX DOCK " Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 18/22] riscv: Add SiPeed MAIX GO " Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 19/22] riscv: Add SiPeed MAIXDUINO " Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 20/22] riscv: Add Kendryte KD233 " Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 21/22] riscv: Update Canaan Kendryte K210 defconfig Damien Le Moal
2020-12-10 14:03 ` [PATCH v8 22/22] riscv: Add Canaan Kendryte K210 SD card defconfig Damien Le Moal
2020-12-13  6:04 ` [PATCH v8 00/22] RISC-V Kendryte K210 support improvements Stephen Boyd
2020-12-13  8:06   ` Damien Le Moal
2020-12-16  1:42     ` Palmer Dabbelt
2020-12-16  2:12       ` Damien Le Moal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201210140313.258739-2-damien.lemoal@wdc.com \
    --to=damien.lemoal@wdc.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=seanga2@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).