Skip to content

Commit 592025a

Browse files
jacob-kellerdavem330
authored andcommitted
renesas: reject unsupported external timestamp flags
Fix the renesas PTP support to explicitly reject any future flags that get added to the external timestamp request ioctl. In order to maintain currently functioning code, this patch accepts all three current flags. This is because the PTP_RISING_EDGE and PTP_FALLING_EDGE flags have unclear semantics and each driver seems to have interpreted them slightly differently. Cc: Sergei Shtylyov <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Richard Cochran <[email protected]> Reviewed-by: Sergei Shtylyov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 2e0645a commit 592025a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/net/ethernet/renesas/ravb_ptp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ static int ravb_ptp_extts(struct ptp_clock_info *ptp,
182182
struct net_device *ndev = priv->ndev;
183183
unsigned long flags;
184184

185+
/* Reject requests with unsupported flags */
186+
if (req->flags & ~(PTP_ENABLE_FEATURE |
187+
PTP_RISING_EDGE |
188+
PTP_FALLING_EDGE))
189+
return -EOPNOTSUPP;
190+
185191
if (req->index)
186192
return -EINVAL;
187193

0 commit comments

Comments
 (0)