]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit1f81677b0b9a80acaa3fe9b9f2c20564aa92b077
treef8bc84056c7d3c0530a0d899a434ed4a161ff064
parent803d3cf6fe3ba58e4094d7da01b07e03693a8c15
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