Skip to contentSkip to conversation

ath10k: use 64-bit crash dump timestamps

PATCH In review Arnd Bergmann 2 participants 2 messages Nov 27, 2017 – Dec 7, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ath10k: use 64-bit crash dump timestamps

The dump format uses 64-bit timestamps already, but calling getnstimeofday() only returns a 32-bit number on 32-bit architectures, so that will overflow in y2038.

This changes it to use ktime_get_real_ts64() instead.

---
 drivers/net/wireless/ath/ath10k/core.h  | 2 +-
 drivers/net/wireless/ath/ath10k/debug.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath10k/core.h +1 -1
index 643041ef3271..dd3c6c63aae1 100644
@@ -463,7 +463,7 @@ struct ath10k_fw_crash_data {
 	bool crashed_since_read;
 
 	guid_t guid;
-	struct timespec timestamp;
+	struct timespec64 timestamp;
 	__le32 registers[REG_DUMP_COUNT_QCA988X];
 	struct ath10k_ce_crash_data ce_crash_data[CE_COUNT_MAX];
 };
drivers/net/wireless/ath/ath10k/debug.c +1 -1
index df514507d3f1..66498e3c0f91 100644
@@ -720,7 +720,7 @@ ath10k_debug_get_new_fw_crash_data(struct ath10k *ar)
 
 	crash_data->crashed_since_read = true;
 	guid_gen(&crash_data->guid);
-	getnstimeofday(&crash_data->timestamp);
+	ktime_get_real_ts64(&crash_data->timestamp);
 
 	return crash_data;
 }
Signature · 6 lines
2.9.0

_______________________________________________
Y2038 mailing list
[email protected]
https://lists.linaro.org/mailman/listinfo/y2038
#1 lore raw
Quoted 8 lines · Arnd Bergmann

The dump format uses 64-bit timestamps already, but calling getnstimeofday() only returns a 32-bit number on 32-bit architectures, so that will overflow in y2038.

This changes it to use ktime_get_real_ts64() instead.

Patch applied to ath-next branch of ath.git, thanks.

dafa42036012 ath10k: use 64-bit crash dump timestamps

Signature · 3 lines
https://patchwork.kernel.org/patch/10076697/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches