android_kernel_google_msm/drivers/net
Alexey Brodkin 176a2eacd6 stmmac: troubleshoot unexpected bits in des0 & des1
commit f1590670ce069eefeb93916391a67643e6ad1630 upstream.

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: David Miller <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
[lizf: Backported to 3.4:
 - adjust contest
 - adjust allocations in init_dma_desc_rings()]
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-10-22 09:20:06 +08:00
..
appletalk
arcnet arcnet: cleanup sizeof parameter 2013-08-11 15:38:44 -07:00
bonding bonding: Remove debug_fs files when module init fails 2014-06-07 16:01:59 -07:00
caif caif: fix NULL pointer check 2012-08-09 08:31:50 -07:00
can can: add missing initialisations in CAN related skbuffs 2015-06-19 11:40:23 +08:00
cris
dsa
ethernet stmmac: troubleshoot unexpected bits in des0 & des1 2015-10-22 09:20:06 +08:00
fddi
hamradio hamradio/yam: fix info leak in ioctl 2014-01-15 15:27:11 -08:00
hippi
hyperv netvsc: don't flush peers notifying work during setting mtu 2014-01-15 15:27:11 -08:00
irda irda: sir_dev: Fix copy/paste typo 2013-01-11 09:06:27 -08:00
phy icplus: fix interrupt for IC+ 101A/G and 1001LF 2012-04-19 15:34:18 -04:00
plip
ppp fix misuses of f_count() in ppp and netlink 2015-02-02 17:04:48 +08:00
slip
team team: fix possible null pointer dereference in team_handle_frame 2015-06-19 11:40:18 +08:00
tokenring
usb net: asix: add missing flag to struct driver_info 2014-03-11 16:10:11 -07:00
vmxnet3 vmxnet3: fix building without CONFIG_PCI_MSI 2014-03-23 21:37:07 -07:00
wan wanxl: fix info leak in ioctl 2013-11-04 04:23:41 -08:00
wimax skb: Add inline helper for getting the skb end offset from head 2014-06-07 16:02:00 -07:00
wireless ath9k: fix DMA stop sequence for AR9003+ 2015-10-22 09:20:03 +08:00
xen-netback xen: netback: read hotplug script once at start of day. 2015-06-19 11:40:35 +08:00
dummy.c dummy: fix oops when loading the dummy failed 2013-07-28 16:26:07 -07:00
eql.c
ifb.c ifb: fix oops when loading the ifb failed 2013-07-28 16:26:08 -07:00
Kconfig
LICENSE.SRC
loopback.c net: loopback: fix a dst refcounting issue 2013-02-14 10:49:04 -08:00
macvlan.c macvlan: Initialize vlan_features to turn on offload support. 2014-08-14 08:42:36 +08:00
macvtap.c drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets 2015-02-02 17:05:26 +08:00
Makefile
mdio.c
mii.c
netconsole.c netconsole: don't call __netpoll_cleanup() while atomic 2013-03-28 12:11:52 -07:00
rionet.c rapidio/rionet: fix multicast packet transmit logic 2012-10-13 05:38:39 +09:00
sb1000.c
Space.c
sungem_phy.c
tun.c drivers/net, ipv6: Select IPv6 fragment idents for virtio UFO packets 2015-02-02 17:05:26 +08:00
veth.c
virtio_net.c virtio-net: alloc big buffers also when guest can receive UFO 2014-03-23 21:37:03 -07:00
xen-netfront.c xen-netfront: reduce gso_max_size to account for max TCP header 2014-06-07 16:02:15 -07:00