Skip to contentSkip to conversation

powerpc: xmon: use ktime_get_coarse_boottime64

PATCH Applied Arnd Bergmann 3 participants 3 messages Jun 18, 2018 – Jul 11, 2018 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc: xmon: use ktime_get_coarse_boottime64

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.

---
 arch/powerpc/xmon/xmon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/xmon/xmon.c +2 -2
index 47166ad2a669..45e3d0ec1246 100644
@@ -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)));
 
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Arnd Bergmann

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.

---

Looks good to me!

Balbir Singh

#2 lore raw
In reply to Arnd Bergmann
Quoted 8 lines · Arnd Bergmann

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.

Applied to powerpc next, thanks.

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

cheers