]> git.baikalelectronics.ru Git - kernel.git/commit
net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 26 Nov 2021 17:28:41 +0000 (19:28 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 26 Nov 2021 19:38:20 +0000 (11:38 -0800)
commitd52fec3dfad69cc4d30f2a8d0b80e5b46b73602d
tree9a2b8934dd7993cbee1a2332f804ff704860bf78
parenta5db0978dae4a852316294262561f7d8d40f5907
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/20211104133204.19757-8-martin.kaistra@linutronix.de/#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: c9a4992060bc ("net: mscc: PTP Hardware Clock (PHC) support")
Suggested-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mscc/ocelot.c