Skip to content

Commit 8a07546

Browse files
vladimirolteankuba-moo
authored andcommitted
net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP
The ocelot driver, when asked to timestamp all receiving packets, 1588 v1 or NTP, says "nah, here's 1588 v2 for you". According to this discussion: https://patchwork.kernel.org/project/netdevbpf/patch/[email protected]/#24577647 drivers that downgrade from a wider request to a narrower response (or even a response where the intersection with the request is empty) are buggy, and should return -ERANGE instead. This patch fixes that. Fixes: 4e3b046 ("net: mscc: PTP Hardware Clock (PHC) support") Suggested-by: Richard Cochran <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Acked-by: Richard Cochran <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent b32e521 commit 8a07546

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

drivers/net/ethernet/mscc/ocelot.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,12 +1320,6 @@ int ocelot_hwstamp_set(struct ocelot *ocelot, int port, struct ifreq *ifr)
13201320
switch (cfg.rx_filter) {
13211321
case HWTSTAMP_FILTER_NONE:
13221322
break;
1323-
case HWTSTAMP_FILTER_ALL:
1324-
case HWTSTAMP_FILTER_SOME:
1325-
case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
1326-
case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
1327-
case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
1328-
case HWTSTAMP_FILTER_NTP_ALL:
13291323
case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
13301324
case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
13311325
case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:

0 commit comments

Comments
 (0)