Skip to content

Commit

Permalink
mlx5: Reject requests to enable time stamping on both edges.
Browse files Browse the repository at this point in the history
This driver enables rising edge or falling edge, but not both, and so
this patch validates that the request contains only one of the two
edges.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
richardcochran authored and davem330 committed Nov 15, 2019
1 parent 5a450eb commit ca12cf5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ static int mlx5_extts_configure(struct ptp_clock_info *ptp,
PTP_STRICT_FLAGS))
return -EOPNOTSUPP;

/* Reject requests to enable time stamping on both edges. */
if ((rq->extts.flags & PTP_STRICT_FLAGS) &&
(rq->extts.flags & PTP_ENABLE_FEATURE) &&
(rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES)
return -EOPNOTSUPP;

if (rq->extts.index >= clock->ptp_info.n_pins)
return -EINVAL;

Expand Down

0 comments on commit ca12cf5

Please sign in to comment.