mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Anup Patel <apatel@ventanamicro.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Paul Walmsley <paul.walmsley@sifive.com>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Andrew Jones <ajones@ventanamicro.com>,
	Atish Patra <atishp@atishpatra.org>,
	Samuel Holland <samuel@sholland.org>,
	Conor Dooley <conor.dooley@microchip.com>,
	Anup Patel <anup@brainfault.org>,
	devicetree@vger.kernel.org, linux-riscv@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	Palmer Dabbelt <palmer@rivosinc.com>
Subject: Re: [PATCH v5 1/3] RISC-V: time: initialize hrtimer based broadcast clock event device
Date: Mon, 05 Dec 2022 00:10:34 +0000	[thread overview]
Message-ID: <04CBEBD4-3EDC-4FA0-BB11-DDD6B710C60C@kernel.org> (raw)
In-Reply-To: <20221201123954.1111603-2-apatel@ventanamicro.com>



On 1 December 2022 12:39:52 GMT, Anup Patel <apatel@ventanamicro.com> wrote:
>From: Conor Dooley <conor.dooley@microchip.com>
>
>Similarly to commit 022eb8ae8b5e ("ARM: 8938/1: kernel: initialize
>broadcast hrtimer based clock event device"), RISC-V needs to initiate
>hrtimer based broadcast clock event device before C3STOP can be used.
>Otherwise, the introduction of C3STOP for the RISC-V arch timer in
>commit 232ccac1bd9b ("clocksource/drivers/riscv: Events are stopped
>during CPU suspend") leaves us without any broadcast timer registered.
>This prevents the kernel from entering oneshot mode, which breaks timer
>behaviour, for example clock_nanosleep().
>
>A test app that sleeps each cpu for 6, 5, 4, 3 ms respectively, HZ=250
>& C3STOP enabled, the sleep times are rounded up to the next jiffy:
>== CPU: 1 ==      == CPU: 2 ==      == CPU: 3 ==      == CPU: 4 ==
>Mean: 7.974992    Mean: 7.976534    Mean: 7.962591    Mean: 3.952179
>Std Dev: 0.154374 Std Dev: 0.156082 Std Dev: 0.171018 Std Dev: 0.076193
>Hi: 9.472000      Hi: 10.495000     Hi: 8.864000      Hi: 4.736000
>Lo: 6.087000      Lo: 6.380000      Lo: 4.872000      Lo: 3.403000
>Samples: 521      Samples: 521      Samples: 521      Samples: 521
>
>Link: https://lore.kernel.org/linux-riscv/YzYTNQRxLr7Q9JR0@spud/
>Fixes: 232ccac1bd9b ("clocksource/drivers/riscv: Events are stopped during CPU suspend")
>Suggested-by: Samuel Holland <samuel@sholland.org>
>Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
>Reviewed-by: Samuel Holland <samuel@sholland.org>
>Acked-by: Palmer Dabbelt <palmer@rivosinc.com>

Huh, thought I replied already but I just have forgotten to...
Since you've added this patch to your series,  it needs your SoB appended.

Thanks,
Conor.

>---
> 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 8217b0f67c6c..1cf21db4fcc7 100644
>--- a/arch/riscv/kernel/time.c
>+++ b/arch/riscv/kernel/time.c
>@@ -5,6 +5,7 @@
>  */
> 
> #include <linux/of_clk.h>
>+#include <linux/clockchips.h>
> #include <linux/clocksource.h>
> #include <linux/delay.h>
> #include <asm/sbi.h>
>@@ -29,6 +30,8 @@ void __init time_init(void)
> 
> 	of_clk_init(NULL);
> 	timer_probe();
>+
>+	tick_setup_hrtimer_broadcast();
> }
> 
> void clocksource_arch_init(struct clocksource *cs)

  reply	other threads:[~2022-12-05  0:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 12:39 [PATCH v5 0/3] Improve CLOCK_EVT_FEAT_C3STOP feature setting Anup Patel
2022-12-01 12:39 ` [PATCH v5 1/3] RISC-V: time: initialize hrtimer based broadcast clock event device Anup Patel
2022-12-05  0:10   ` Conor Dooley [this message]
2022-12-01 12:39 ` [PATCH v5 2/3] dt-bindings: timer: Add bindings for the RISC-V timer device Anup Patel
2022-12-05 16:16   ` Rob Herring
2022-12-01 12:39 ` [PATCH v5 3/3] clocksource: timer-riscv: Set CLOCK_EVT_FEAT_C3STOP based on DT Anup Patel
2022-12-02  0:06   ` Rob Herring
2022-12-02  6:33     ` Anup Patel
2022-12-04 23:34       ` Conor Dooley
2022-12-05  8:17         ` Samuel Holland
2022-12-05  8:33           ` Conor Dooley
2022-12-28 11:59             ` Conor Dooley
2022-12-06 22:02         ` Lad, Prabhakar

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=04CBEBD4-3EDC-4FA0-BB11-DDD6B710C60C@kernel.org \
    --to=conor@kernel.org \
    --cc=ajones@ventanamicro.com \
    --cc=anup@brainfault.org \
    --cc=apatel@ventanamicro.com \
    --cc=atishp@atishpatra.org \
    --cc=conor.dooley@microchip.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=palmer@dabbelt.com \
    --cc=palmer@rivosinc.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh+dt@kernel.org \
    --cc=samuel@sholland.org \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®