All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] APEI/ERST: use 64-bit timestamps
@ 2017-11-02 11:42 Arnd Bergmann
  2017-11-07 20:17 ` Thomas Gleixner
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-11-02 11:42 UTC (permalink / raw)
  To: Rafael J. Wysocki, Len Brown
  Cc: Arnd Bergmann, Kees Cook, Anton Vorontsov, Colin Cross,
	Tony Luck, Borislav Petkov, Michal Hocko, Andrew Morton,
	Leon Romanovsky, Dan Williams, linux-acpi, linux-kernel

32-bit timestamps are deprecated in the kernel, so we should not use
get_seconds(). In this case, the 'struct cper_record_header' structure
already contains a 64-bit field, so the only required change is to use
the safe ktime_get_real_seconds() interface as a replacement.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/acpi/apei/erst.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
index 2c462beee551..6742f6c68034 100644
--- a/drivers/acpi/apei/erst.c
+++ b/drivers/acpi/apei/erst.c
@@ -1061,7 +1061,7 @@ static int erst_writer(struct pstore_record *record)
 	rcd->hdr.error_severity = CPER_SEV_FATAL;
 	/* timestamp valid. platform_id, partition_id are invalid */
 	rcd->hdr.validation_bits = CPER_VALID_TIMESTAMP;
-	rcd->hdr.timestamp = get_seconds();
+	rcd->hdr.timestamp = ktime_get_real_seconds();
 	rcd->hdr.record_length = sizeof(*rcd) + record->size;
 	rcd->hdr.creator_id = CPER_CREATOR_PSTORE;
 	rcd->hdr.notification_type = CPER_NOTIFY_MCE;
-- 
2.9.0


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

* Re: [PATCH] APEI/ERST: use 64-bit timestamps
  2017-11-02 11:42 [PATCH] APEI/ERST: use 64-bit timestamps Arnd Bergmann
@ 2017-11-07 20:17 ` Thomas Gleixner
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2017-11-07 20:17 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Rafael J. Wysocki, Len Brown, Kees Cook, Anton Vorontsov,
	Colin Cross, Tony Luck, Borislav Petkov, Michal Hocko,
	Andrew Morton, Leon Romanovsky, Dan Williams, linux-acpi,
	linux-kernel

On Thu, 2 Nov 2017, Arnd Bergmann wrote:

> 32-bit timestamps are deprecated in the kernel, so we should not use
> get_seconds(). In this case, the 'struct cper_record_header' structure
> already contains a 64-bit field, so the only required change is to use
> the safe ktime_get_real_seconds() interface as a replacement.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  drivers/acpi/apei/erst.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c
> index 2c462beee551..6742f6c68034 100644
> --- a/drivers/acpi/apei/erst.c
> +++ b/drivers/acpi/apei/erst.c
> @@ -1061,7 +1061,7 @@ static int erst_writer(struct pstore_record *record)
>  	rcd->hdr.error_severity = CPER_SEV_FATAL;
>  	/* timestamp valid. platform_id, partition_id are invalid */
>  	rcd->hdr.validation_bits = CPER_VALID_TIMESTAMP;
> -	rcd->hdr.timestamp = get_seconds();
> +	rcd->hdr.timestamp = ktime_get_real_seconds();
>  	rcd->hdr.record_length = sizeof(*rcd) + record->size;
>  	rcd->hdr.creator_id = CPER_CREATOR_PSTORE;
>  	rcd->hdr.notification_type = CPER_NOTIFY_MCE;
> -- 
> 2.9.0
> 
> 

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

end of thread, other threads:[~2017-11-07 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-02 11:42 [PATCH] APEI/ERST: use 64-bit timestamps Arnd Bergmann
2017-11-07 20:17 ` Thomas Gleixner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.