net: mscc: ocelot: fix hardware timestamp dequeue logic
authorlaurent brando <laurent.brando@nxp.com>
Mon, 27 Jul 2020 10:26:14 +0000 (18:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Aug 2020 13:35:36 +0000 (15:35 +0200)
commit06dd122843cd4cf8956b7200159bff316b830bdf
tree4d20170c2b86ae1862b031cbab158e49d3652a7e
parentcea0a7943a30a6d0320c8558a844dd27e8f0aa8b
net: mscc: ocelot: fix hardware timestamp dequeue logic

[ Upstream commit 5fd82200d870a5dd3e509c98ef2041f580b2c0e1 ]

The next hw timestamp should be snapshoot to the read registers
only once the current timestamp has been read.
If none of the pending skbs matches the current HW timestamp
just gracefully flush the available timestamp by reading it.

Signed-off-by: laurent brando <laurent.brando@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mscc/ocelot.c