diff options
author | Abhilash Jindal <klock.android@gmail.com> | 2016-01-31 13:53:31 -0500 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-02-29 17:11:40 -0500 |
commit | 571e09eeff544e5562bd2a704f1fe91083f7592f (patch) | |
tree | 0bf067a3323e5dcc5bf439284cf0a278fdcfd4c7 | |
parent | fc77dbd34c5c99bce46d40a2491937c3bcbd10af (diff) |
IB/mlx4: Use boottime
Wall time obtained from ktime_get_real_ns is susceptible to sudden jumps due to
user setting the time or due to NTP. Boot time is constantly increasing time
better suited for comparing two timestamps.
Signed-off-by: Abhilash Jindal <klock.android@gmail.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/mlx4/alias_GUID.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/alias_GUID.c b/drivers/infiniband/hw/mlx4/alias_GUID.c index 21cb41a60fe8..c74ef2620b85 100644 --- a/drivers/infiniband/hw/mlx4/alias_GUID.c +++ b/drivers/infiniband/hw/mlx4/alias_GUID.c | |||
@@ -310,7 +310,7 @@ static void aliasguid_query_handler(int status, | |||
310 | if (status) { | 310 | if (status) { |
311 | pr_debug("(port: %d) failed: status = %d\n", | 311 | pr_debug("(port: %d) failed: status = %d\n", |
312 | cb_ctx->port, status); | 312 | cb_ctx->port, status); |
313 | rec->time_to_run = ktime_get_real_ns() + 1 * NSEC_PER_SEC; | 313 | rec->time_to_run = ktime_get_boot_ns() + 1 * NSEC_PER_SEC; |
314 | goto out; | 314 | goto out; |
315 | } | 315 | } |
316 | 316 | ||
@@ -416,7 +416,7 @@ next_entry: | |||
416 | be64_to_cpu((__force __be64)rec->guid_indexes), | 416 | be64_to_cpu((__force __be64)rec->guid_indexes), |
417 | be64_to_cpu((__force __be64)applied_guid_indexes), | 417 | be64_to_cpu((__force __be64)applied_guid_indexes), |
418 | be64_to_cpu((__force __be64)declined_guid_indexes)); | 418 | be64_to_cpu((__force __be64)declined_guid_indexes)); |
419 | rec->time_to_run = ktime_get_real_ns() + | 419 | rec->time_to_run = ktime_get_boot_ns() + |
420 | resched_delay_sec * NSEC_PER_SEC; | 420 | resched_delay_sec * NSEC_PER_SEC; |
421 | } else { | 421 | } else { |
422 | rec->status = MLX4_GUID_INFO_STATUS_SET; | 422 | rec->status = MLX4_GUID_INFO_STATUS_SET; |
@@ -708,7 +708,7 @@ static int get_low_record_time_index(struct mlx4_ib_dev *dev, u8 port, | |||
708 | } | 708 | } |
709 | } | 709 | } |
710 | if (resched_delay_sec) { | 710 | if (resched_delay_sec) { |
711 | u64 curr_time = ktime_get_real_ns(); | 711 | u64 curr_time = ktime_get_boot_ns(); |
712 | 712 | ||
713 | *resched_delay_sec = (low_record_time < curr_time) ? 0 : | 713 | *resched_delay_sec = (low_record_time < curr_time) ? 0 : |
714 | div_u64((low_record_time - curr_time), NSEC_PER_SEC); | 714 | div_u64((low_record_time - curr_time), NSEC_PER_SEC); |