]> git.baikalelectronics.ru Git - kernel.git/commit
net: netsec: Sync dma for device on buffer allocation
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 4 Jul 2019 14:11:09 +0000 (17:11 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jul 2019 22:41:24 +0000 (15:41 -0700)
commit02f134002707fb2e4da3fe38fb162d9e836e90b7
treefa010990f15424038d68e60b34b065364fc7065a
parent7ef918ee051594e49709ed88dd216ed914e80a05
net: netsec: Sync dma for device on buffer allocation

Quoting Arnd,

We have to do a sync_single_for_device /somewhere/ before the
buffer is given to the device. On a non-cache-coherent machine with
a write-back cache, there may be dirty cache lines that get written back
after the device DMA's data into it (e.g. from a previous memset
from before the buffer got freed), so you absolutely need to flush any
dirty cache lines on it first.

Since the coherency is configurable in this device make sure we cover
all configurations by explicitly syncing the allocated buffer for the
device before refilling it's descriptors

Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/socionext/netsec.c