Skip to content

Commit 7d9465e

Browse files
jacob-kellerdavem330
authored andcommitted
mv88e6xxx: reject unsupported external timestamp flags
Fix the mv88e6xxx 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. For the record, the semantics of this driver are: flags Meaning ---------------------------------------------------- -------------------------- PTP_ENABLE_FEATURE Time stamp falling edge PTP_ENABLE_FEATURE|PTP_RISING_EDGE Time stamp rising edge PTP_ENABLE_FEATURE|PTP_FALLING_EDGE Time stamp falling edge PTP_ENABLE_FEATURE|PTP_RISING_EDGE|PTP_FALLING_EDGE Time stamp rising edge Cc: Brandon Streiff <[email protected]> Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Richard Cochran <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7f9048f commit 7d9465e

File tree

1 file changed

+6
-0
lines changed
  • drivers/net/dsa/mv88e6xxx

1 file changed

+6
-0
lines changed

drivers/net/dsa/mv88e6xxx/ptp.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ static int mv88e6352_ptp_enable_extts(struct mv88e6xxx_chip *chip,
273273
int pin;
274274
int err;
275275

276+
/* Reject requests with unsupported flags */
277+
if (rq->extts.flags & ~(PTP_ENABLE_FEATURE |
278+
PTP_RISING_EDGE |
279+
PTP_FALLING_EDGE))
280+
return -EOPNOTSUPP;
281+
276282
pin = ptp_find_pin(chip->ptp_clock, PTP_PF_EXTTS, rq->extts.index);
277283

278284
if (pin < 0)

0 commit comments

Comments
 (0)