diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-06-18 17:28:23 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-06-26 18:00:27 +0200 |
commit | c4d6204dc1742581c0450d2ff6a058f61ea4f4ce (patch) | |
tree | f8bc84056c7d3c0530a0d899a434ed4a161ff064 /drivers/scsi/lpfc/lpfc_sli.c | |
parent | scsi: scsi_transport_fc: use 64-bit timestamps consistently (diff) | |
download | linux-c4d6204dc1742581c0450d2ff6a058f61ea4f4ce.tar.xz linux-c4d6204dc1742581c0450d2ff6a058f61ea4f4ce.zip |
scsi: lpfc: use monotonic timestamps for statistics
The get_seconds() function suffers from a possible overflow in 2038 or
2106, as well as jitter due to settimeofday or leap second updates, and is
deprecated.
As we are interested in elapsed time only, using ktime_get_seconds() to
read the CLOCK_MONOTONIC timebase is ideal here. This also lets us remove
the hack that tries to deal with get_seconds() going slightly backwards,
which cannot happen with montonic timestamps.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 6f3c00a233ec..e6786a5db502 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -4591,7 +4591,7 @@ lpfc_sli_brdrestart_s3(struct lpfc_hba *phba) spin_unlock_irq(&phba->hbalock); memset(&psli->lnk_stat_offsets, 0, sizeof(psli->lnk_stat_offsets)); - psli->stats_start = get_seconds(); + psli->stats_start = ktime_get_seconds(); /* Give the INITFF and Post time to settle. */ mdelay(100); @@ -4638,7 +4638,7 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba) spin_unlock_irq(&phba->hbalock); memset(&psli->lnk_stat_offsets, 0, sizeof(psli->lnk_stat_offsets)); - psli->stats_start = get_seconds(); + psli->stats_start = ktime_get_seconds(); /* Reset HBA AER if it was enabled, note hba_flag was reset above */ if (hba_aer_enabled) |