Commit 55affa97 authored by Aya Levin's avatar Aya Levin Committed by Saeed Mahameed

net/mlx5: Fix turn-off PPS command

Fix a bug of uninitialized pin index when trying to turn off PPS out.

Fixes: de19cd6c ("net/mlx5: Move some PPS logic into helper functions")
Signed-off-by: default avatarAya Levin <ayal@nvidia.com>
Reviewed-by: default avatarEran Ben Elisha <eranbe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 385d40b0
...@@ -495,15 +495,15 @@ static int mlx5_perout_configure(struct ptp_clock_info *ptp, ...@@ -495,15 +495,15 @@ static int mlx5_perout_configure(struct ptp_clock_info *ptp,
return -EINVAL; return -EINVAL;
field_select = MLX5_MTPPS_FS_ENABLE; field_select = MLX5_MTPPS_FS_ENABLE;
pin = ptp_find_pin(clock->ptp, PTP_PF_PEROUT, rq->perout.index);
if (pin < 0)
return -EBUSY;
if (on) { if (on) {
bool rt_mode = mlx5_real_time_mode(mdev); bool rt_mode = mlx5_real_time_mode(mdev);
u32 nsec; u32 nsec;
s64 sec; s64 sec;
pin = ptp_find_pin(clock->ptp, PTP_PF_PEROUT, rq->perout.index);
if (pin < 0)
return -EBUSY;
pin_mode = MLX5_PIN_MODE_OUT; pin_mode = MLX5_PIN_MODE_OUT;
pattern = MLX5_OUT_PATTERN_PERIODIC; pattern = MLX5_OUT_PATTERN_PERIODIC;
ts.tv_sec = rq->perout.period.sec; ts.tv_sec = rq->perout.period.sec;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment