scsi: lpfc: use monotonic timestamps for statistics
authorArnd Bergmann <arnd@arndb.de>
Mon, 18 Jun 2018 15:28:23 +0000 (17:28 +0200)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 26 Jun 2018 16:00:27 +0000 (12:00 -0400)
commitc4d6204dc1742581c0450d2ff6a058f61ea4f4ce
treef8bc84056c7d3c0530a0d899a434ed4a161ff064
parentfe7f4e5d11541402f54ebd777a4f49caee891401
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>
drivers/scsi/lpfc/lpfc_attr.c
drivers/scsi/lpfc/lpfc_sli.c
drivers/scsi/lpfc/lpfc_sli.h