Skip to content

Commit 4395d9d

Browse files
Binary-EaterSaeed Mahameed
authored andcommitted
net/mlx5: Initialize clock->ptp_info inside mlx5_init_timer_clock
Configure the PHC inside mlx5_init_timer_clock for calling mlx5_ptp_settime later in the function. Would previously use mlx5_ptp_clock_info instance to invoke mlx5_ptp_settime to set the NIC real-time clock to be synchronized with the host system clock. Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com> Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
1 parent 330af90 commit 4395d9d

File tree

1 file changed

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

1 file changed

+5
-4
lines changed

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1002,10 +1002,12 @@ static void mlx5_init_timer_clock(struct mlx5_core_dev *mdev)
10021002
{
10031003
struct mlx5_clock *clock = &mdev->clock;
10041004

1005+
/* Configure the PHC */
1006+
clock->ptp_info = mlx5_ptp_clock_info;
1007+
10051008
mlx5_timecounter_init(mdev);
10061009
mlx5_init_clock_info(mdev);
10071010
mlx5_init_overflow_period(clock);
1008-
clock->ptp_info = mlx5_ptp_clock_info;
10091011

10101012
if (mlx5_real_time_mode(mdev)) {
10111013
struct timespec64 ts;
@@ -1036,11 +1038,10 @@ void mlx5_init_clock(struct mlx5_core_dev *mdev)
10361038
}
10371039

10381040
seqlock_init(&clock->lock);
1039-
mlx5_init_timer_clock(mdev);
10401041
INIT_WORK(&clock->pps_info.out_work, mlx5_pps_out);
10411042

1042-
/* Configure the PHC */
1043-
clock->ptp_info = mlx5_ptp_clock_info;
1043+
/* Initialize the device clock */
1044+
mlx5_init_timer_clock(mdev);
10441045

10451046
/* Initialize 1PPS data structures */
10461047
mlx5_init_pps(mdev);

0 commit comments

Comments
 (0)