linux/drivers/net/ethernet/stmicro/stmmac
Alexey Brodkin f1590670ce stmmac: troubleshoot unexpected bits in des0 & des1
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>
2015-06-24 02:38:53 -07:00
..
chain_mode.c stmmac: fix dma api misuse 2014-08-29 19:54:36 -07:00
common.h stmmac: Configure Flow Control to work correctly based on rxfifo size 2015-04-16 13:58:42 -04:00
descs_com.h stmmac: code tidy-up 2013-04-08 16:55:27 -04:00
descs.h stmmac: troubleshoot unexpected bits in des0 & des1 2015-06-24 02:38:53 -07:00
dwmac100_core.c net: stmmac: Support devicetree configs for mcast and ucast filter entries 2014-07-31 14:13:29 -07:00
dwmac100_dma.c stmmac: Configure Flow Control to work correctly based on rxfifo size 2015-04-16 13:58:42 -04:00
dwmac100.h
dwmac1000_core.c stmmac: Enable unicast pause frame detect in GMAC Register 6 2015-04-16 13:58:42 -04:00
dwmac1000_dma.c stmmac: Configure Flow Control to work correctly based on rxfifo size 2015-04-16 13:58:42 -04:00
dwmac1000.h stmmac: Add defines and documentation for enabling flow control 2015-04-16 13:58:42 -04:00
dwmac_dma.h stmicro: Remove extern from function prototypes 2013-09-24 12:54:08 -07:00
dwmac_lib.c stmmac: dity-up and rework the driver debug levels 2013-07-02 16:04:53 -07:00
dwmac-meson.c stmmac: platform: fix sparse warnings 2014-11-07 12:25:23 -05:00
dwmac-rk.c net: stmmac: dwmac-rk: Use standard devicetree property for phy regulator 2015-01-24 17:17:07 -08:00
dwmac-socfpga.c net: stmmac: make reset control an optional requirement 2015-03-08 22:52:45 -04:00
dwmac-sti.c stmmac: dwmac-sti: Pass sysconfig register offset via syscon dt property. 2015-01-11 18:53:34 -05:00
dwmac-sunxi.c stmmac: review driver when run kernel-doc 2014-11-19 15:04:58 -05:00
enh_desc.c stmmac: troubleshoot unexpected bits in des0 & des1 2015-06-24 02:38:53 -07:00
Kconfig stmmac: split to core library and probe drivers 2014-11-11 14:34:39 -05:00
Makefile GMAC: add driver for Rockchip RK3288 SoCs integrated GMAC 2014-12-31 19:14:05 -05:00
mmc_core.c stmmac: fix tipo on mmc crc error 2014-08-29 19:54:36 -07:00
mmc.h stmmac: fix tipo on mmc crc error 2014-08-29 19:54:36 -07:00
norm_desc.c stmmac: troubleshoot unexpected bits in des0 & des1 2015-06-24 02:38:53 -07:00
ring_mode.c stmmac: fix dma api misuse 2014-08-29 19:54:36 -07:00
stmmac_ethtool.c stmmac: fix max coal timer parameter 2014-12-09 13:25:18 -05:00
stmmac_hwtstamp.c driver:stmmac: Adjust time stamp increase for 0.465 ns accurate only when Time stamp binary rollover is set. 2013-09-04 14:37:02 -04:00
stmmac_main.c stmmac: troubleshoot unexpected bits in des0 & des1 2015-06-24 02:38:53 -07:00
stmmac_mdio.c drivers/net: Convert remaining uses of pr_warning to pr_warn 2014-09-09 20:37:08 -07:00
stmmac_pci.c stmmac: pci: add MSI support for Intel Quark X1000 2015-01-27 21:08:08 -08:00
stmmac_platform.c drivers/net: include <module.h> for modular stmmac_platform code 2015-05-03 23:40:09 -04:00
stmmac_platform.h GMAC: add driver for Rockchip RK3288 SoCs integrated GMAC 2014-12-31 19:14:05 -05:00
stmmac_ptp.c ptp: stmmac: use helpers for converting ns to timespec. 2015-03-31 17:19:19 -04:00
stmmac_ptp.h stmmac: ptp: fix the reference clock 2014-08-29 19:54:36 -07:00
stmmac.h net: stmmac: create one debugfs dir per net-device 2015-05-25 17:38:23 -04:00