forked from Minki/linux
f1590670ce
Current implementation of descriptor init procedure only takes care about setting/clearing ownership flag in "des0"/"des1" fields while it is perfectly possible to get unexpected bits set because of the following factors: [1] On driver probe underlying memory allocated with dma_alloc_coherent() might not be zeroed and so it will be filled with garbage. [2] During driver operation some bits could be set by SD/MMC controller (for example error flags etc). And unexpected and/or randomly set flags in "des0"/"des1" fields may lead to unpredictable behavior of GMAC DMA block. This change addresses both items above with: [1] Use of dma_zalloc_coherent() instead of simple dma_alloc_coherent() to make sure allocated memory is zeroed. That shouldn't affect performance because this allocation only happens once on driver probe. [2] Do explicit zeroing of both "des0" and "des1" fields of all buffer descriptors during initialization of DMA transfer. And while at it fixed identation of dma_free_coherent() counterpart as well. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com> Cc: arc-linux-dev@synopsys.com Cc: linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Cc: David Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net> |
||
---|---|---|
.. | ||
chain_mode.c | ||
common.h | ||
descs_com.h | ||
descs.h | ||
dwmac100_core.c | ||
dwmac100_dma.c | ||
dwmac100.h | ||
dwmac1000_core.c | ||
dwmac1000_dma.c | ||
dwmac1000.h | ||
dwmac_dma.h | ||
dwmac_lib.c | ||
dwmac-meson.c | ||
dwmac-rk.c | ||
dwmac-socfpga.c | ||
dwmac-sti.c | ||
dwmac-sunxi.c | ||
enh_desc.c | ||
Kconfig | ||
Makefile | ||
mmc_core.c | ||
mmc.h | ||
norm_desc.c | ||
ring_mode.c | ||
stmmac_ethtool.c | ||
stmmac_hwtstamp.c | ||
stmmac_main.c | ||
stmmac_mdio.c | ||
stmmac_pci.c | ||
stmmac_platform.c | ||
stmmac_platform.h | ||
stmmac_ptp.c | ||
stmmac_ptp.h | ||
stmmac.h |