linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: xmon: use ktime_get_coarse_boottime64
@ 2018-06-18  9:56 Arnd Bergmann
  2018-06-19  1:53 ` Balbir Singh
  2018-07-11 13:24 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-06-18  9:56 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman
  Cc: y2038, Arnd Bergmann, Balbir Singh, Nicholas Piggin,
	Vaibhav Jain, linuxppc-dev, linux-kernel

get_monotonic_boottime() is deprecated, and may not be safe to call in
every context, as it has to read a hardware clocksource.

This changes xmon to print the time using ktime_get_coarse_boottime64()
instead, which avoids the old timespec type and the HW access.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/xmon/xmon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/xmon/xmon.c b/arch/powerpc/xmon/xmon.c
index 47166ad2a669..45e3d0ec1246 100644
--- a/arch/powerpc/xmon/xmon.c
+++ b/arch/powerpc/xmon/xmon.c
@@ -918,13 +918,13 @@ static void remove_cpu_bpts(void)
 static void
 show_uptime(void)
 {
-	struct timespec uptime;
+	struct timespec64 uptime;
 
 	if (setjmp(bus_error_jmp) == 0) {
 		catch_memory_errors = 1;
 		sync();
 
-		get_monotonic_boottime(&uptime);
+		ktime_get_coarse_boottime_ts64(&uptime);
 		printf("Uptime: %lu.%.2lu seconds\n", (unsigned long)uptime.tv_sec,
 			((unsigned long)uptime.tv_nsec / (NSEC_PER_SEC/100)));
 
-- 
2.9.0


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

* Re: [PATCH] powerpc: xmon: use ktime_get_coarse_boottime64
  2018-06-18  9:56 [PATCH] powerpc: xmon: use ktime_get_coarse_boottime64 Arnd Bergmann
@ 2018-06-19  1:53 ` Balbir Singh
  2018-07-11 13:24 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Balbir Singh @ 2018-06-19  1:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman, y2038,
	Nicholas Piggin, Vaibhav Jain,
	open list:LINUX FOR POWERPC (32-BIT AND 64-BIT),
	linux-kernel

On Mon, Jun 18, 2018 at 7:56 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> get_monotonic_boottime() is deprecated, and may not be safe to call in
> every context, as it has to read a hardware clocksource.
>
> This changes xmon to print the time using ktime_get_coarse_boottime64()
> instead, which avoids the old timespec type and the HW access.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Looks good to me!

Acked-by: Balbir Singh <bsingharora@gmail.com>

Balbir Singh

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

* Re: powerpc: xmon: use ktime_get_coarse_boottime64
  2018-06-18  9:56 [PATCH] powerpc: xmon: use ktime_get_coarse_boottime64 Arnd Bergmann
  2018-06-19  1:53 ` Balbir Singh
@ 2018-07-11 13:24 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2018-07-11 13:24 UTC (permalink / raw)
  To: Arnd Bergmann, Benjamin Herrenschmidt, Paul Mackerras
  Cc: Arnd Bergmann, y2038, Vaibhav Jain, Nicholas Piggin,
	linux-kernel, linuxppc-dev

On Mon, 2018-06-18 at 09:56:24 UTC, Arnd Bergmann wrote:
> get_monotonic_boottime() is deprecated, and may not be safe to call in
> every context, as it has to read a hardware clocksource.
> 
> This changes xmon to print the time using ktime_get_coarse_boottime64()
> instead, which avoids the old timespec type and the HW access.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Balbir Singh <bsingharora@gmail.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/f6bd74fa084eb9ad573ffbb236a095

cheers

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

end of thread, other threads:[~2018-07-11 13:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18  9:56 [PATCH] powerpc: xmon: use ktime_get_coarse_boottime64 Arnd Bergmann
2018-06-19  1:53 ` Balbir Singh
2018-07-11 13:24 ` Michael Ellerman

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).