]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: stmmac: ensure that the device has released ownership before reading data
authorNiklas Cassel <niklas.cassel@axis.com>
Mon, 26 Feb 2018 21:47:08 +0000 (22:47 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 May 2018 05:50:48 +0000 (07:50 +0200)
commit82aad32b4aad92244bc7b8e4cd1210253785fe03
tree204fd86b5f09d990fbee8b6dc3100fec71ddabe9
parentcecf8a69042b3a54cb843223756c10ee8a8665e3
net: stmmac: ensure that the device has released ownership before reading data

[ Upstream commit a6b25da5e7ba212af5826a662e6a035a79bffabd ]

According to Documentation/memory-barriers.txt, we need to use a
dma_rmb() after reading the status/own bit, to ensure that all
descriptor fields are read after reading the own bit.

This way, we ensure that the DMA engine is done with the DMA
descriptor before we read the other descriptor fields, e.g. reading
the tx hardware timestamp (if PTP is enabled).

Signed-off-by: Niklas Cassel <niklas.cassel@axis.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c