This series does two improvements to the RISC-V timer driver:
1) Keep timer interrupt enable state in-sync with interrupt subsystem
2) Increase rating of clock event device when Sstc is available
These patches can also be found in the riscv_timer_imp_v1 branch at:
https://github.com/avpatel/linux.git
Anup Patel (2):
clocksource: timer-riscv: Don't enable/disable timer interrupt
clocksource: timer-riscv: Increase rating of clock_event_device for
Sstc
drivers/clocksource/timer-riscv.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
--
2.34.1
When Sstc is available the RISC-V timer clock_event_device should be
the preferred clock_event_device hence we increase clock_event_device
rating for Sstc.
Signed-off-by: Anup Patel <[email protected]>
---
drivers/clocksource/timer-riscv.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index f2ea2b3d2d43..9c8f3e2decc2 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -105,6 +105,8 @@ static int riscv_timer_starting_cpu(unsigned int cpu)
ce->irq = riscv_clock_event_irq;
if (riscv_timer_cannot_wake_cpu)
ce->features |= CLOCK_EVT_FEAT_C3STOP;
+ if (static_branch_likely(&riscv_sstc_available))
+ ce->rating = 450;
clockevents_config_and_register(ce, riscv_timebase, 100, 0x7fffffff);
enable_percpu_irq(riscv_clock_event_irq,
--
2.34.1
On Mon, Jul 10, 2023 at 06:49:00PM +0530, Anup Patel wrote:
> This series does two improvements to the RISC-V timer driver:
> 1) Keep timer interrupt enable state in-sync with interrupt subsystem
> 2) Increase rating of clock event device when Sstc is available
>
> These patches can also be found in the riscv_timer_imp_v1 branch at:
> https://github.com/avpatel/linux.git
Other than wondering why you opted for 450 (curiosity really), this
stuff looks fine to me.
Reviewed-by: Conor Dooley <[email protected]>
Cheers,
Conor.
On Tue, Jul 11, 2023 at 4:51 PM Conor Dooley <[email protected]> wrote:
>
> On Mon, Jul 10, 2023 at 06:49:00PM +0530, Anup Patel wrote:
> > This series does two improvements to the RISC-V timer driver:
> > 1) Keep timer interrupt enable state in-sync with interrupt subsystem
> > 2) Increase rating of clock event device when Sstc is available
> >
> > These patches can also be found in the riscv_timer_imp_v1 branch at:
> > https://github.com/avpatel/linux.git
>
> Other than wondering why you opted for 450 (curiosity really), this
> stuff looks fine to me.
It is the same as the rating for clock_event_device used by ARM arch timer.
(Refer, __arch_timer_setup() in drivers/clocksource/arm_arch_timer.c)
>
> Reviewed-by: Conor Dooley <[email protected]>
>
> Cheers,
> Conor.
Regards,
Anup
On Tue, Jul 11, 2023 at 05:07:11PM +0530, Anup Patel wrote:
> On Tue, Jul 11, 2023 at 4:51 PM Conor Dooley <[email protected]> wrote:
> > Other than wondering why you opted for 450 (curiosity really), this
> > stuff looks fine to me.
>
> It is the same as the rating for clock_event_device used by ARM arch timer.
That's what I figured, thanks!
Hello:
This series was applied to riscv/linux.git (for-next)
by Palmer Dabbelt <[email protected]>:
On Mon, 10 Jul 2023 18:49:00 +0530 you wrote:
> This series does two improvements to the RISC-V timer driver:
> 1) Keep timer interrupt enable state in-sync with interrupt subsystem
> 2) Increase rating of clock event device when Sstc is available
>
> These patches can also be found in the riscv_timer_imp_v1 branch at:
> https://github.com/avpatel/linux.git
>
> [...]
Here is the summary with links:
- [1/2] clocksource: timer-riscv: Don't enable/disable timer interrupt
https://git.kernel.org/riscv/c/d39d86e3e78b
- [2/2] clocksource: timer-riscv: Increase rating of clock_event_device for Sstc
https://git.kernel.org/riscv/c/fde893ef7084
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html