stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] clocksource/drivers/hyper-v: Make sched clock return" failed to apply to 5.5-stable tree
@ 2020-03-30 12:14 gregkh
  2020-03-30 15:47 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: gregkh @ 2020-03-30 12:14 UTC (permalink / raw)
  To: yuboxie, Tianyu.Lan, tglx, vkuznets; +Cc: stable


The patch below does not apply to the 5.5-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 749da8ca978f19710aba496208c480ad42d37f79 Mon Sep 17 00:00:00 2001
From: Yubo Xie <yuboxie@microsoft.com>
Date: Thu, 26 Mar 2020 19:11:59 -0700
Subject: [PATCH] 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: bd00cd52d5be ("clocksource/drivers/hyperv: Add Hyper-V specific sched clock function")
Signed-off-by: Yubo Xie <yuboxie@microsoft.com>
Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200327021159.31429-1-Tianyu.Lan@microsoft.com

diff --git a/drivers/clocksource/hyperv_timer.c b/drivers/clocksource/hyperv_timer.c
index 9d808d595ca8..eb0ba7818eb0 100644
--- a/drivers/clocksource/hyperv_timer.c
+++ b/drivers/clocksource/hyperv_timer.c
@@ -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) *
+		(NSEC_PER_SEC / HV_CLOCK_HZ);
 }
 
 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) *
+		(NSEC_PER_SEC / HV_CLOCK_HZ);
 }
 
 static struct clocksource hyperv_cs_msr = {


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: FAILED: patch "[PATCH] clocksource/drivers/hyper-v: Make sched clock return" failed to apply to 5.5-stable tree
  2020-03-30 12:14 FAILED: patch "[PATCH] clocksource/drivers/hyper-v: Make sched clock return" failed to apply to 5.5-stable tree gregkh
@ 2020-03-30 15:47 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2020-03-30 15:47 UTC (permalink / raw)
  To: gregkh; +Cc: yuboxie, Tianyu.Lan, tglx, vkuznets, stable

On Mon, Mar 30, 2020 at 02:14:18PM +0200, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 5.5-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 749da8ca978f19710aba496208c480ad42d37f79 Mon Sep 17 00:00:00 2001
>From: Yubo Xie <yuboxie@microsoft.com>
>Date: Thu, 26 Mar 2020 19:11:59 -0700
>Subject: [PATCH] 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: bd00cd52d5be ("clocksource/drivers/hyperv: Add Hyper-V specific sched clock function")
>Signed-off-by: Yubo Xie <yuboxie@microsoft.com>
>Signed-off-by: Tianyu Lan <Tianyu.Lan@microsoft.com>
>Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
>Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
>Cc: stable@vger.kernel.org
>Link: https://lkml.kernel.org/r/20200327021159.31429-1-Tianyu.Lan@microsoft.com

We don't have 0af3e137c144 ("clocksource/drivers/hyper-v: Untangle
stimers and timesync from clocksources") on 5.5 and older. I've adjusted
this patch and queued it for 5.5 and 5.4.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-03-30 15:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-30 12:14 FAILED: patch "[PATCH] clocksource/drivers/hyper-v: Make sched clock return" failed to apply to 5.5-stable tree gregkh
2020-03-30 15:47 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).