Skip to contentSkip to conversation

Patch "clocksource/drivers/riscv: Fix clocksource mask" has been added to the 5.0-stable tree

PATCH [email protected] 1 participant 1 message Mar 24, 2019

Subsystems (2)
lore
Share & tools
lore

[email protected]

author Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

clocksource/drivers/riscv: Fix clocksource mask

to the 5.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
clocksource-drivers-riscv-fix-clocksource-mask.patch
and it can be found in the queue-5.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From 32d0be018f6f5ee2d5d19c4795304613560814cf Mon Sep 17 00:00:00 2001
From: Atish Patra <[email protected]>
Date: Fri, 22 Mar 2019 14:54:11 -0700
Subject: clocksource/drivers/riscv: Fix clocksource mask

From: Atish Patra <[email protected]>

commit 32d0be018f6f5ee2d5d19c4795304613560814cf upstream.

For all riscv architectures (RV32, RV64 and RV128), the clocksource is a 64 bit incrementing counter.

Fix the clock source mask accordingly.

Tested on both 64bit and 32 bit virt machine in QEMU.

Fixes 62b019436814 ("clocksource: new RISC-V SBI timer driver")
Cc Albert Ou <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Palmer Dabbelt <[email protected]>
Cc Anup Patel <[email protected]>
Cc Damien Le Moal <[email protected]>
---
 drivers/clocksource/timer-riscv.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/clocksource/timer-riscv.c +2 -3
@@ -58,7 +58,7 @@ static u64 riscv_sched_clock(void)
 static DEFINE_PER_CPU(struct clocksource, riscv_clocksource) = {
 	.name		= "riscv_clocksource",
 	.rating		= 300,
-	.mask		= CLOCKSOURCE_MASK(BITS_PER_LONG),
+	.mask		= CLOCKSOURCE_MASK(64),
 	.flags		= CLOCK_SOURCE_IS_CONTINUOUS,
 	.read		= riscv_clocksource_rdtime,
 };
@@ -103,8 +103,7 @@ static int __init riscv_timer_init_dt(st
 	cs = per_cpu_ptr(&riscv_clocksource, cpuid);
 	clocksource_register_hz(cs, riscv_timebase);
 
-	sched_clock_register(riscv_sched_clock,
-			BITS_PER_LONG, riscv_timebase);
+	sched_clock_register(riscv_sched_clock, 64, riscv_timebase);
 
 	error = cpuhp_setup_state(CPUHP_AP_RISCV_TIMER_STARTING,
 			 "clockevents/riscv/timer:starting",

Patches currently in stable-queue which might be from [email protected] are

queue-5.0/clocksource-drivers-riscv-fix-clocksource-mask.patch

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv