]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit378f64128313cc67231b0bf0f2bf6ae0a4bb8f5a
tree322ee6047f34ea67788d265697215403cc397156
parent691567912a9abb8569284f6f9d7a4d2ca0ab7d82
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: 0d840c4d74fd ("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