net: mscc: ocelot: fix race condition with TX timestamping
authorVladimir Oltean <vladimir.oltean@nxp.com>
Fri, 18 Sep 2020 01:07:23 +0000 (04:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2020 20:52:33 +0000 (13:52 -0700)
commit9dda66acddcbcd5c9e94a1292c679738ba999345
tree322ee6047f34ea67788d265697215403cc397156
parent5f6857e808a8bd078296575b417c4b9d160b9779
net: mscc: ocelot: fix race condition with TX timestamping

The TX-timestampable skb is added late to the ocelot_port->tx_skbs. It
is in a race with the TX timestamp IRQ, which checks that queue trying
to match the timestamp with the skb by the ts_id. The skb should be
added to the queue before the IRQ can fire.

Fixes: 4e3b0468e6d7 ("net: mscc: PTP Hardware Clock (PHC) support")
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mscc/ocelot_net.c