diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-06-18 18:11:16 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2018-06-27 19:10:25 +0300 |
commit | 3cade2f3d98a7fcfd36fcb0d743f5ed5cdffb119 (patch) | |
tree | 74e6333f84e32d38ed38fb8567d9869b5d2f3b55 /drivers/net/wireless/intel/ipw2x00/ipw2200.c | |
parent | 71e140b57151425829f87a0aaaa87636860dd7d2 (diff) | |
download | linux-3cade2f3d98a7fcfd36fcb0d743f5ed5cdffb119.tar.xz |
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>
Diffstat (limited to 'drivers/net/wireless/intel/ipw2x00/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/intel/ipw2x00/ipw2200.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/intel/ipw2x00/ipw2200.c b/drivers/net/wireless/intel/ipw2x00/ipw2200.c index 62140109d2ac..9644e7b93645 100644 --- a/drivers/net/wireless/intel/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/intel/ipw2x00/ipw2200.c @@ -11888,7 +11888,7 @@ static int ipw_pci_suspend(struct pci_dev *pdev, pm_message_t state) pci_disable_device(pdev); pci_set_power_state(pdev, pci_choose_state(pdev, state)); - priv->suspend_at = get_seconds(); + priv->suspend_at = ktime_get_boottime_seconds(); return 0; } @@ -11925,7 +11925,7 @@ static int ipw_pci_resume(struct pci_dev *pdev) * the queue of needed */ netif_device_attach(dev); - priv->suspend_time = get_seconds() - priv->suspend_at; + priv->suspend_time = ktime_get_boottime_seconds() - priv->suspend_at; /* Bring the device back up */ schedule_work(&priv->up); |