]> 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)
commitbebf99f2df85a48d2faa4c7298b7859012305fda
tree322ee6047f34ea67788d265697215403cc397156
parent83fdfaeb96f33c91ab10bfcd2faba3fd76cc0bf2
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: c9a4992060bc ("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