]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: dsa: sja1105: reject other RX filters than HWTSTAMP_FILTER_PTP_V2_L2_EVENT
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 18 Mar 2025 11:57:15 +0000 (13:57 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 24 Mar 2025 22:20:23 +0000 (15:20 -0700)
commitb6a177b559717b707087114e08537fd47a4d1aca
tree27c668d1d82aa984028632fa7a334a58b15dfda1
parent00eb88752f48615ae7b4c1df6f9271cdd62c1d95
net: dsa: sja1105: reject other RX filters than HWTSTAMP_FILTER_PTP_V2_L2_EVENT

This is all that we can support timestamping, so we shouldn't accept
anything else. Also see sja1105_hwtstamp_get().

To avoid erroring out in an inconsistent state, operate on copies of
priv->hwts_rx_en and priv->hwts_tx_en, and write them back when nothing
else can fail anymore.

Fixes: a602afd200f5 ("net: dsa: sja1105: Expose PTP timestamping ioctls to userspace")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250318115716.2124395-3-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/sja1105/sja1105_ptp.c