summaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/time.c
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2025-01-25 18:51:33 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2025-01-25 18:51:33 +0800
commit98e720f77dba6bb702a57f3d8479e6445e34f38c (patch)
tree09e72d98a3a749f0400e88f5f3949f1c4d514d61 /arch/loongarch/kernel/time.c
parent341cf992d331a34d764bf943e4e177daff94fc92 (diff)
LoongArch: Derive timer max_delta from PRCFG1's timer_bits
As per arch spec, maximum timer bits is configurable and should not be hardcoded in any way. Probe timer bits from PRCFG1 and use that to determine the clockevent's max_delta to be conformance. Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/time.c')
-rw-r--r--arch/loongarch/kernel/time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/loongarch/kernel/time.c b/arch/loongarch/kernel/time.c
index a07d7eff4dc5..e2d3bfeb6366 100644
--- a/arch/loongarch/kernel/time.c
+++ b/arch/loongarch/kernel/time.c
@@ -132,7 +132,7 @@ int constant_clockevent_init(void)
#else
unsigned long min_delta = 1000;
#endif
- unsigned long max_delta = (1UL << 48) - 1;
+ unsigned long max_delta = GENMASK_ULL(boot_cpu_data.timerbits, 0);
struct clock_event_device *cd;
static int irq = 0, timer_irq_installed = 0;