]> git.proxmox.com Git - mirror_ubuntu-jammy-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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:49:02 +0000 (09:49 +0100)
commitf2f8cfb5ee6260c4df1536ff2ee2932aba80532f
tree19dd5f859b15436c1c72b3e470bb78cc133a67f9
parentada2965f05a251aa304783d9f2179e4f512a1413
net: mscc: ocelot: don't downgrade timestamping RX filters in SIOCSHWTSTAMP

BugLink: https://bugs.launchpad.net/bugs/1953370
[ Upstream commit 8a075464d1e9317ffae0973dfe538a7511291a06 ]

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: 4e3b0468e6d7 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
drivers/net/ethernet/mscc/ocelot.c