diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/include/asm/rtas.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/nvram_64.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/nvram.c | 10 |
3 files changed, 10 insertions, 9 deletions
diff --git a/arch/powerpc/include/asm/rtas.h b/arch/powerpc/include/asm/rtas.h index d1bd001566df..c3c99eb35448 100644 --- a/arch/powerpc/include/asm/rtas.h +++ b/arch/powerpc/include/asm/rtas.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/spinlock.h> | 5 | #include <linux/spinlock.h> |
6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
7 | #include <linux/time.h> | ||
7 | 8 | ||
8 | /* | 9 | /* |
9 | * Definitions for talking to the RTAS on CHRP machines. | 10 | * Definitions for talking to the RTAS on CHRP machines. |
@@ -343,7 +344,7 @@ extern int early_init_dt_scan_rtas(unsigned long node, | |||
343 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); | 344 | extern void pSeries_log_error(char *buf, unsigned int err_type, int fatal); |
344 | 345 | ||
345 | #ifdef CONFIG_PPC_PSERIES | 346 | #ifdef CONFIG_PPC_PSERIES |
346 | extern unsigned long last_rtas_event; | 347 | extern time64_t last_rtas_event; |
347 | extern int clobbering_unread_rtas_event(void); | 348 | extern int clobbering_unread_rtas_event(void); |
348 | extern int pseries_devicetree_update(s32 scope); | 349 | extern int pseries_devicetree_update(s32 scope); |
349 | extern void post_mobility_fixup(void); | 350 | extern void post_mobility_fixup(void); |
diff --git a/arch/powerpc/kernel/nvram_64.c b/arch/powerpc/kernel/nvram_64.c index 293da889055b..1e703f8ebad4 100644 --- a/arch/powerpc/kernel/nvram_64.c +++ b/arch/powerpc/kernel/nvram_64.c | |||
@@ -376,7 +376,7 @@ static int zip_oops(size_t text_len) | |||
376 | } | 376 | } |
377 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); | 377 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); |
378 | oops_hdr->report_length = cpu_to_be16(zipped_len); | 378 | oops_hdr->report_length = cpu_to_be16(zipped_len); |
379 | oops_hdr->timestamp = cpu_to_be64(get_seconds()); | 379 | oops_hdr->timestamp = cpu_to_be64(ktime_get_real_seconds()); |
380 | return 0; | 380 | return 0; |
381 | } | 381 | } |
382 | 382 | ||
@@ -423,7 +423,7 @@ static int nvram_pstore_write(enum pstore_type_id type, | |||
423 | 423 | ||
424 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); | 424 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); |
425 | oops_hdr->report_length = cpu_to_be16(size); | 425 | oops_hdr->report_length = cpu_to_be16(size); |
426 | oops_hdr->timestamp = cpu_to_be64(get_seconds()); | 426 | oops_hdr->timestamp = cpu_to_be64(ktime_get_real_seconds()); |
427 | 427 | ||
428 | if (compressed) | 428 | if (compressed) |
429 | err_type = ERR_TYPE_KERNEL_PANIC_GZ; | 429 | err_type = ERR_TYPE_KERNEL_PANIC_GZ; |
@@ -721,7 +721,7 @@ static void oops_to_nvram(struct kmsg_dumper *dumper, | |||
721 | err_type = ERR_TYPE_KERNEL_PANIC; | 721 | err_type = ERR_TYPE_KERNEL_PANIC; |
722 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); | 722 | oops_hdr->version = cpu_to_be16(OOPS_HDR_VERSION); |
723 | oops_hdr->report_length = cpu_to_be16(text_len); | 723 | oops_hdr->report_length = cpu_to_be16(text_len); |
724 | oops_hdr->timestamp = cpu_to_be64(get_seconds()); | 724 | oops_hdr->timestamp = cpu_to_be64(ktime_get_real_seconds()); |
725 | } | 725 | } |
726 | 726 | ||
727 | (void) nvram_write_os_partition(&oops_log_partition, oops_buf, | 727 | (void) nvram_write_os_partition(&oops_log_partition, oops_buf, |
diff --git a/arch/powerpc/platforms/pseries/nvram.c b/arch/powerpc/platforms/pseries/nvram.c index 533807efed61..9f8184175c86 100644 --- a/arch/powerpc/platforms/pseries/nvram.c +++ b/arch/powerpc/platforms/pseries/nvram.c | |||
@@ -36,10 +36,10 @@ static DEFINE_SPINLOCK(nvram_lock); | |||
36 | 36 | ||
37 | /* See clobbering_unread_rtas_event() */ | 37 | /* See clobbering_unread_rtas_event() */ |
38 | #define NVRAM_RTAS_READ_TIMEOUT 5 /* seconds */ | 38 | #define NVRAM_RTAS_READ_TIMEOUT 5 /* seconds */ |
39 | static unsigned long last_unread_rtas_event; /* timestamp */ | 39 | static time64_t last_unread_rtas_event; /* timestamp */ |
40 | 40 | ||
41 | #ifdef CONFIG_PSTORE | 41 | #ifdef CONFIG_PSTORE |
42 | unsigned long last_rtas_event; | 42 | time64_t last_rtas_event; |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) | 45 | static ssize_t pSeries_nvram_read(char *buf, size_t count, loff_t *index) |
@@ -144,9 +144,9 @@ int nvram_write_error_log(char * buff, int length, | |||
144 | int rc = nvram_write_os_partition(&rtas_log_partition, buff, length, | 144 | int rc = nvram_write_os_partition(&rtas_log_partition, buff, length, |
145 | err_type, error_log_cnt); | 145 | err_type, error_log_cnt); |
146 | if (!rc) { | 146 | if (!rc) { |
147 | last_unread_rtas_event = get_seconds(); | 147 | last_unread_rtas_event = ktime_get_real_seconds(); |
148 | #ifdef CONFIG_PSTORE | 148 | #ifdef CONFIG_PSTORE |
149 | last_rtas_event = get_seconds(); | 149 | last_rtas_event = ktime_get_real_seconds(); |
150 | #endif | 150 | #endif |
151 | } | 151 | } |
152 | 152 | ||
@@ -200,7 +200,7 @@ int clobbering_unread_rtas_event(void) | |||
200 | { | 200 | { |
201 | return (oops_log_partition.index == rtas_log_partition.index | 201 | return (oops_log_partition.index == rtas_log_partition.index |
202 | && last_unread_rtas_event | 202 | && last_unread_rtas_event |
203 | && get_seconds() - last_unread_rtas_event <= | 203 | && ktime_get_real_seconds() - last_unread_rtas_event <= |
204 | NVRAM_RTAS_READ_TIMEOUT); | 204 | NVRAM_RTAS_READ_TIMEOUT); |
205 | } | 205 | } |
206 | 206 | ||