Skip to content

Commit

Permalink
powerpc: xmon: use ktime_get_coarse_boottime64
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Arnd Bergmann authored and Michael Ellerman committed Jul 2, 2018
1 parent ee8c446 commit f6bd74f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/xmon/xmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down

0 comments on commit f6bd74f

Please sign in to comment.