diff mbox series

powerpc: xmon: use ktime_get_coarse_boottime64

Message ID 20180618095653.1538471-1-arnd@arndb.de
State Superseded
Headers show
Series powerpc: xmon: use ktime_get_coarse_boottime64 | expand

Commit Message

Arnd Bergmann June 18, 2018, 9:56 a.m. UTC
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(-)

-- 
2.9.0

Comments

Balbir Singh June 19, 2018, 1:53 a.m. UTC | #1
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
Michael Ellerman July 11, 2018, 1:24 p.m. UTC | #2
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
diff mbox series

Patch

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