Skip to content

Commit 6d85558

Browse files
committed
mlx5_en: use read sequence for gettimex64
jira LE-3615 Rebuild_History Non-Buildable kernel-5.14.0-570.28.1.el9_6 commit-author Vadim Fedorenko <[email protected]> commit 0452a2d The gettimex64() doesn't modify values in timecounter, that's why there is no need to update sequence counter. Reduce the contention on sequence lock for multi-thread PHC reading use-case. Signed-off-by: Vadim Fedorenko <[email protected]> Reviewed-by: Rahul Rameshbabu <[email protected]> Acked-by: Tariq Toukan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]> (cherry picked from commit 0452a2d) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 27edcc5 commit 6d85558

File tree

1 file changed

+1
-5
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/lib

1 file changed

+1
-5
lines changed

drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,7 @@ static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts,
402402
struct ptp_system_timestamp *sts)
403403
{
404404
struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info);
405-
struct mlx5_timer *timer = &clock->timer;
406405
struct mlx5_core_dev *mdev;
407-
unsigned long flags;
408406
u64 cycles, ns;
409407

410408
mdev = container_of(clock, struct mlx5_core_dev, clock);
@@ -413,10 +411,8 @@ static int mlx5_ptp_gettimex(struct ptp_clock_info *ptp, struct timespec64 *ts,
413411
goto out;
414412
}
415413

416-
write_seqlock_irqsave(&clock->lock, flags);
417414
cycles = mlx5_read_time(mdev, sts, false);
418-
ns = timecounter_cyc2time(&timer->tc, cycles);
419-
write_sequnlock_irqrestore(&clock->lock, flags);
415+
ns = mlx5_timecounter_cyc2time(clock, cycles);
420416
*ts = ns_to_timespec64(ns);
421417
out:
422418
return 0;

0 commit comments

Comments
 (0)