Skip to content

Commit

Permalink
net/mlx5: Decouple PHC .adjtime and .adjphase implementations
Browse files Browse the repository at this point in the history
[ Upstream commit fd64fd1 ]

When running a phase adjustment operation, the free running clock should
not be modified at all. The phase control keyword is intended to trigger an
internal servo on the device that will converge to the provided delta. A
free running counter cannot implement phase adjustment.

Fixes: 8e11a68 ("net/mlx5: Add adjphase function to support hardware-only offset control")
Signed-off-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Link: https://lore.kernel.org/r/20231114215846.5902-5-saeed@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Binary-Eater authored and gregkh committed Nov 28, 2023
1 parent e87fa62 commit 8b9491d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,12 @@ static int mlx5_ptp_adjtime(struct ptp_clock_info *ptp, s64 delta)

static int mlx5_ptp_adjphase(struct ptp_clock_info *ptp, s32 delta)
{
return mlx5_ptp_adjtime(ptp, delta);
struct mlx5_clock *clock = container_of(ptp, struct mlx5_clock, ptp_info);
struct mlx5_core_dev *mdev;

mdev = container_of(clock, struct mlx5_core_dev, clock);

return mlx5_ptp_adjtime_real_time(mdev, delta);
}

static int mlx5_ptp_freq_adj_real_time(struct mlx5_core_dev *mdev, long scaled_ppm)
Expand Down

0 comments on commit 8b9491d

Please sign in to comment.