Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mlx5: Reject requests to enable time stamping on both edges.

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>

authored by

Richard Cochran and committed by
David S. Miller
ca12cf5a 5a450eb3

+6
+6
drivers/net/ethernet/mellanox/mlx5/core/lib/clock.c
··· 243 243 PTP_STRICT_FLAGS)) 244 244 return -EOPNOTSUPP; 245 245 246 + /* Reject requests to enable time stamping on both edges. */ 247 + if ((rq->extts.flags & PTP_STRICT_FLAGS) && 248 + (rq->extts.flags & PTP_ENABLE_FEATURE) && 249 + (rq->extts.flags & PTP_EXTTS_EDGES) == PTP_EXTTS_EDGES) 250 + return -EOPNOTSUPP; 251 + 246 252 if (rq->extts.index >= clock->ptp_info.n_pins) 247 253 return -EINVAL; 248 254