ipw2x00: track time using boottime
The ipw2x00 driver family uses get_seconds() to read the current time for various purposes. This function is deprecated because of the 32-bit time_t overflow, and it can cause unexpected behavior when the time changes due to settimeofday() calls or leap second updates. In many cases, we want to use monotonic time instead, however ipw2x00 explicitly tracks the time spent in suspend, so this changes the driver over to use ktime_get_boottime_seconds(), which is slightly slower, but not used in a fastpath here. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:

committed by
Kalle Valo

parent
71e140b571
commit
3cade2f3d9
@@ -1343,9 +1343,9 @@ struct ipw_priv {
|
||||
|
||||
s8 tx_power;
|
||||
|
||||
/* Track time in suspend */
|
||||
unsigned long suspend_at;
|
||||
unsigned long suspend_time;
|
||||
/* Track time in suspend using CLOCK_BOOTIME */
|
||||
time64_t suspend_at;
|
||||
time64_t suspend_time;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
u32 pm_state[16];
|
||||
|
Reference in New Issue
Block a user