diff options
author | Geert Uytterhoeven <geert+renesas@glider.be> | 2024-03-20 11:30:07 +0100 |
---|---|---|
committer | Daniel Lezcano <daniel.lezcano@linaro.org> | 2024-05-10 10:41:52 +0200 |
commit | 37385c0772a4fc6b89605b9701fa934fa2beb2cc (patch) | |
tree | 2f4ef0ed2080f87e8f5da75612e0a86344901bb4 | |
parent | 0f63c95aebf11d87b166a5dfd389957c67fef9c0 (diff) | |
download | lwn-37385c0772a4fc6b89605b9701fa934fa2beb2cc.tar.gz lwn-37385c0772a4fc6b89605b9701fa934fa2beb2cc.zip |
clocksource/drivers/renesas-ostm: Avoid reprobe after successful early probe
The Renesas OS Timer (OSTM) driver contains two probe points, of which
only one should complete:
1. Early probe, using TIMER_OF_DECLARE(), to provide the sole
clocksource on (arm32) RZ/A1 and RZ/A2 SoCs,
2. Normal probe, using a platform driver, to provide additional timers
on (arm64 + riscv) RZ/G2L and similar SoCs.
The latter is needed because using OSTM on RZ/G2L requires manipulation
of its reset signal, which is not yet available at the time of early
probe, causing early probe to fail with -EPROBE_DEFER. It is only
enabled when building a kernel with support for the RZ/G2L family, so it
does not impact RZ/A1 and RZ/A2. Hence only one probe method can
complete on all affected systems.
As relying on the order of initialization of subsystems inside the
kernel is fragile, set the DT node's OF_POPULATED flag after a succesful
early probe. This makes sure the platform driver's probe is never
called after a successful early probe.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviwed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/bd027379713cbaafa21ffe9e848ebb7f475ca0e7.1710930542.git.geert+renesas@glider.be
-rw-r--r-- | drivers/clocksource/renesas-ostm.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/clocksource/renesas-ostm.c b/drivers/clocksource/renesas-ostm.c index 39487d05a009..3fcbd02b2483 100644 --- a/drivers/clocksource/renesas-ostm.c +++ b/drivers/clocksource/renesas-ostm.c @@ -210,6 +210,7 @@ static int __init ostm_init(struct device_node *np) pr_info("%pOF: used for clock events\n", np); } + of_node_set_flag(np, OF_POPULATED); return 0; err_cleanup: |