Commit 749da8ca authored by Yubo Xie's avatar Yubo Xie Committed by Thomas Gleixner

clocksource/drivers/hyper-v: Make sched clock return nanoseconds correctly

The sched clock read functions return the HV clock (100ns granularity)
without converting it to nanoseconds.

Add the missing conversion.

Fixes: bd00cd52 ("clocksource/drivers/hyperv: Add Hyper-V specific sched clock function")
Signed-off-by: default avatarYubo Xie <>
Signed-off-by: default avatarTianyu Lan <>
Signed-off-by: default avatarThomas Gleixner <>
Reviewed-by: default avatarVitaly Kuznetsov <>
parent 5ad0ec0b
......@@ -343,7 +343,8 @@ static u64 notrace read_hv_clock_tsc_cs(struct clocksource *arg)
static u64 read_hv_sched_clock_tsc(void)
return read_hv_clock_tsc() - hv_sched_clock_offset;
return (read_hv_clock_tsc() - hv_sched_clock_offset) *
static void suspend_hv_clock_tsc(struct clocksource *arg)
......@@ -398,7 +399,8 @@ static u64 notrace read_hv_clock_msr_cs(struct clocksource *arg)
static u64 read_hv_sched_clock_msr(void)
return read_hv_clock_msr() - hv_sched_clock_offset;
return (read_hv_clock_msr() - hv_sched_clock_offset) *
static struct clocksource hyperv_cs_msr = {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment