android_kernel_google_msm/drivers
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
..
accessibility
acpi ACPI / video: Load the module even if ACPI is disabled 2015-06-19 11:40:21 +08:00
amba
ata ahci: avoton port-disable reset-quirk 2015-09-18 09:20:39 +08:00
atm
auxdisplay
base regmap: Fix regmap_bulk_read in BE mode 2015-10-22 09:20:04 +08:00
bcma
block nbd: fix possible memory leak 2015-06-19 11:40:28 +08:00
bluetooth ath3k: add support of 13d3:3474 AR3012 device 2015-10-22 09:20:03 +08:00
cdrom
char ipmi: fix timeout calculation when bmc is disconnected 2015-09-18 09:20:46 +08:00
clk
clocksource
connector
cpufreq cpufreq: speedstep-smi: enable interrupts when waiting 2015-06-19 11:40:15 +08:00
cpuidle
crypto crypto: talitos - avoid memleak in talitos_alg_alloc() 2015-10-22 09:20:01 +08:00
dca
devfreq
dio
dma dmaengine: mv_xor: bug fix for racing condition in descriptors cleanup 2015-10-22 09:20:04 +08:00
edac sb_edac: Fix erroneous bytes->gigabytes conversion 2015-06-19 11:40:32 +08:00
eisa
firewire firewire: cdev: prevent kernel stack leaking into ioctl arguments 2015-02-02 17:05:24 +08:00
firmware x86, efivars: firmware bug workarounds should be in platform code 2014-06-07 16:02:10 -07:00
gpio gpio: tps65912: fix wrong container_of arguments 2015-06-19 11:40:18 +08:00
gpu drm/radeon: take the mode_config mutex when dealing with hpds (v2) 2015-10-22 09:20:02 +08:00
hid HID: roccat: potential out of bounds in pyra_sysfs_write_settings() 2015-04-14 17:33:52 +08:00
hsi
hv Drivers: hv: vmbus: Don't wait after requesting offers 2015-09-18 09:20:26 +08:00
hwmon hwmon: (adm1029) Ensure the fan_div cache is updated in set_fan_div 2014-07-17 15:39:50 -07:00
hwspinlock
i2c i2c: davinci: generate STP always when NACK is received 2015-04-14 17:33:40 +08:00
ide
idle intel_idle: Don't register CPU notifier if we are not running. 2014-06-07 16:02:07 -07:00
ieee802154
infiniband RDMA/CMA: Canonize IPv4 on IPV6 sockets properly 2015-09-18 09:20:36 +08:00
input Input: elantech - fix detection of touchpads where the revision matches a known rate 2015-09-18 09:20:44 +08:00
iommu iommu/vt-d: Fix an off-by-one bug in __domain_mapping() 2015-04-14 17:33:44 +08:00
isdn
leds
lguest lguest: fix out-by-one error in address checking. 2015-09-18 09:20:43 +08:00
macintosh
mca
md md: use kzalloc() when bitmap is disabled 2015-09-18 09:20:46 +08:00
media
memstick memstick: mspro_block: add missing curly braces 2015-09-18 09:20:31 +08:00
message
mfd mfd: tc6393xb: Fail ohci suspend if full state restore is required 2015-04-14 17:33:43 +08:00
misc MISC: hpilo, remove pci_disable_device 2014-06-07 16:02:06 -07:00
mmc mmc: card: Fixup request missing in mmc_blk_issue_rw_rq 2015-10-22 09:20:05 +08:00
mtd mtd: dc21285: use raw spinlock functions for nw_gpio_lock 2015-10-22 09:20:02 +08:00
net stmmac: troubleshoot unexpected bits in des0 & des1 2015-10-22 09:20:06 +08:00
nfc
nubus
of of/base: Fix PowerPC address parsing hack 2015-02-02 17:05:22 +08:00
oprofile
parisc
parport
pci PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2015-06-19 11:40:34 +08:00
pcmcia Disable write buffering on Toshiba ToPIC95 2015-10-22 09:20:04 +08:00
pinctrl
platform ideapad: fix software rfkill setting 2015-10-22 09:20:05 +08:00
pnp
power power: charger-manager: Fix NULL pointer exception with missing cm-fuel-gauge 2015-02-02 17:04:43 +08:00
pps
ps3
ptp
rapidio rapidio/tsi721: Fix interrupt mask when handling MSI 2014-06-07 16:02:14 -07:00
regulator regulator: core: fix constraints output buffer 2015-10-22 09:20:03 +08:00
remoteproc
rpmsg
rtc drivers/rtc/rtc-pl031.c: restore ST variant functionality 2014-06-07 16:02:14 -07:00
s390 s390/3215: fix tty output containing tabs 2015-04-14 17:34:03 +08:00
sbus bbc-i2c: Fix BBC I2C envctrl on SunBlade 2000 2014-08-14 08:42:37 +08:00
scsi ipr: Increase default adapter init stage change timeout 2015-10-22 09:20:03 +08:00
sfi
sh
sn
spi spi: spidev: fix possible arithmetic overflow for multi-transfer message 2015-06-19 11:40:32 +08:00
ssb
staging staging: rtl8712: prevent buffer overrun in recvbuf2recvframe 2015-10-22 09:20:02 +08:00
target target/pscsi: Don't leak scsi_host if hba is VIRTUAL_HOST 2015-09-18 09:20:43 +08:00
tc
thermal
tty tty/serial: at91: RS485 mode: 0 is valid for delay_rts_after_send 2015-10-22 09:20:02 +08:00
uio
usb usb: core: Fix USB 3.0 devices lost in NOTATTACHED state after a hub port reset 2015-10-22 09:20:03 +08:00
uwb uwb: init beacon cache entry before registering uwb device 2014-12-01 18:02:28 +08:00
vhost
video PCI: Convert pcibios_resource_to_bus() to take a pci_bus, not a pci_dev 2015-06-19 11:40:34 +08:00
virt
virtio virtio_pci: document why we defer kfree 2015-04-14 17:33:50 +08:00
vlynq
w1
watchdog watchdog: omap: assert the counter being stopped before reprogramming 2015-10-22 09:20:06 +08:00
xen xen/events: don't bind non-percpu VIRQs with percpu chip 2015-09-18 09:20:42 +08:00
zorro
Kconfig
Makefile