]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
NET: stmmac: align DMA stuff to largest cache line length
authorEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Thu, 26 Jul 2018 12:05:37 +0000 (15:05 +0300)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 1 Mar 2019 13:20:56 +0000 (14:20 +0100)
commit7c102f225ce39f6d7b542aa2ee4035f40f7d89fe
tree9e78a0cdec466a6c7695d211137989760cdc9ae3
parent85016882dc29e626da4545a2fa86bfe9f941cac0
NET: stmmac: align DMA stuff to largest cache line length

BugLink: http://bugs.launchpad.net/bugs/1815234
[ Upstream commit 9939a46d90c6c76f4533d534dbadfa7b39dc6acc ]

As for today STMMAC_ALIGN macro (which is used to align DMA stuff)
relies on L1 line length (L1_CACHE_BYTES).
This isn't correct in case of system with several cache levels
which might have L1 cache line length smaller than L2 line. This
can lead to sharing one cache line between DMA buffer and other
data, so we can lose this data while invalidate DMA buffer before
DMA transaction.

Fix that by using SMP_CACHE_BYTES instead of L1_CACHE_BYTES for
aligning.

Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c