OpenCloudOS-Kernel/drivers
Grygorii Strashko 62f94c2101 net: ethernet: ti: cpsw: fix net watchdog timeout
It was discovered that simple program which indefinitely sends 200b UDP
packets and runs on TI AM574x SoC (SMP) under RT Kernel triggers network
watchdog timeout in TI CPSW driver (<6 hours run). The network watchdog
timeout is triggered due to race between cpsw_ndo_start_xmit() and
cpsw_tx_handler() [NAPI]

cpsw_ndo_start_xmit()
	if (unlikely(!cpdma_check_free_tx_desc(txch))) {
		txq = netdev_get_tx_queue(ndev, q_idx);
		netif_tx_stop_queue(txq);

^^ as per [1] barier has to be used after set_bit() otherwise new value
might not be visible to other cpus
	}

cpsw_tx_handler()
	if (unlikely(netif_tx_queue_stopped(txq)))
		netif_tx_wake_queue(txq);

and when it happens ndev TX queue became disabled forever while driver's HW
TX queue is empty.

Fix this, by adding smp_mb__after_atomic() after netif_tx_stop_queue()
calls and double check for free TX descriptors after stopping ndev TX queue
- if there are free TX descriptors wake up ndev TX queue.

[1] https://www.kernel.org/doc/html/latest/core-api/atomic_ops.html
Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
Reviewed-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-02-07 21:57:10 -05:00
..
accessibility
acpi platform-drivers-x86 for v4.16-1 2018-02-06 15:30:52 -08:00
amba
android Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
ata pci-v4.16-changes 2018-02-06 09:59:40 -08:00
atm
auxdisplay
base drm/graphics pull request for v4.16-rc1 2018-02-01 17:48:47 -08:00
bcma Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-19 22:59:33 -05:00
block pci-v4.16-changes 2018-02-06 09:59:40 -08:00
bluetooth Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-01-31 14:31:10 -08:00
bus ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
cdrom
char pci-v4.16-changes 2018-02-06 09:59:40 -08:00
clk The core framework has a handful of patches this time around, mostly due 2018-02-01 16:56:07 -08:00
clocksource
connector
cpufreq Merge branch 'pm-cpufreq-thermal' into pm-cpufreq 2018-01-18 02:52:42 +01:00
cpuidle powerpc updates for 4.16 2018-02-02 10:01:04 -08:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2018-01-31 14:22:45 -08:00
dax Merge branch 'for-4.16/dax' into libnvdimm-for-next 2018-02-03 00:26:10 -07:00
dca
devfreq
dio
dma Merge branch 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm 2018-02-02 09:50:51 -08:00
dma-buf drm/graphics pull request for v4.16-rc1 2018-02-01 17:48:47 -08:00
edac
eisa EISA: Delete error message for a failed memory allocation in eisa_probe() 2018-01-23 09:04:10 +01:00
extcon
firewire IEEE 1394 subsystem patches: 2018-02-02 14:57:44 -08:00
firmware pci-v4.16-changes 2018-02-06 09:59:40 -08:00
fmc
fpga
fsi
gpio This is the bulk of pin control changes for the v4.16 kernel cycle: 2018-02-02 14:22:53 -08:00
gpu pci-v4.16-changes 2018-02-06 09:59:40 -08:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2018-01-31 13:00:01 -08:00
hsi HSI changes for the v4.16 series 2018-01-31 12:54:05 -08:00
hv Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
hwmon hwmon: (dell-smm) Disable fan support for Dell Vostro 3360 2018-01-27 09:34:22 -08:00
hwspinlock
hwtracing Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
i2c Merge branch 'i2c/for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-02-04 10:57:43 -08:00
ide pci-v4.16-changes 2018-02-06 09:59:40 -08:00
idle
iio Staging/IIO patches for 4.16-rc1 2018-02-01 09:51:57 -08:00
infiniband Second pull request for 4.16 merge window 2018-02-06 11:09:45 -08:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2018-02-01 10:49:58 -08:00
iommu pci-v4.16-changes 2018-02-06 09:59:40 -08:00
ipack
irqchip pci-v4.16-changes 2018-02-06 09:59:40 -08:00
isdn Merge branch 'work.sock_recvmsg' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2018-01-30 18:59:03 -08:00
leds LED updates for 4.16-rc1 2018-01-31 12:22:41 -08:00
lightnvm
macintosh pci-v4.16-changes 2018-02-06 09:59:40 -08:00
mailbox Misc driver changes only : 2018-02-04 11:11:23 -08:00
mcb
md for-linus-20180204 2018-02-04 11:16:35 -08:00
media media: videobuf2: fix up for "media: annotate ->poll() instances" 2018-02-06 14:24:51 -08:00
memory ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
memstick
message
mfd regmap: Updates for v4.16 2018-01-29 11:35:24 -08:00
misc Merge branch 'i2c/for-4.16' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2018-02-04 10:57:43 -08:00
mmc MMC host: 2018-02-05 09:51:15 -08:00
mtd dma mapping changes for Linux 4.16: 2018-01-31 11:32:27 -08:00
mux Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
net net: ethernet: ti: cpsw: fix net watchdog timeout 2018-02-07 21:57:10 -05:00
nfc
ntb NTB: ntb_perf: fix cast to restricted __le32 2018-01-28 22:17:24 -05:00
nubus
nvdimm Merge branch 'for-4.16/nfit' into libnvdimm-for-next 2018-02-03 00:26:26 -07:00
nvme for-linus-20180204 2018-02-04 11:16:35 -08:00
nvmem
of pci-v4.16-changes 2018-02-06 09:59:40 -08:00
opp
oprofile
parisc
parport
pci pci-v4.16-changes 2018-02-06 09:59:40 -08:00
pcmcia
perf bitmap: replace bitmap_{from,to}_u32array 2018-02-06 18:32:44 -08:00
phy USB/PHY updates for 4.16-rc1 2018-02-01 09:40:49 -08:00
pinctrl This is the bulk of pin control changes for the v4.16 kernel cycle: 2018-02-02 14:22:53 -08:00
platform platform-drivers-x86 for v4.16-1 2018-02-06 15:30:52 -08:00
pnp
power power supply and reset changes for the v4.16 series 2018-01-31 12:55:31 -08:00
powercap
pps pps: parport: use timespec64 instead of timespec 2018-02-06 18:32:46 -08:00
ps3
ptp
pwm
rapidio drivers/rapidio/devices/tsi721_dma.c: adjust six checks for null pointers 2018-02-06 18:32:46 -08:00
ras mm/memory_failure: Remove unused trapno from memory_failure 2018-01-23 12:17:42 -06:00
regulator Merge remote-tracking branch 'regulator/topic/tps65218' into regulator-next 2018-01-26 17:57:05 +00:00
remoteproc remoteproc updates for v4.16 2018-02-05 10:07:40 -08:00
reset
rpmsg rpmsg updates for v4.16 2018-02-05 10:05:40 -08:00
rtc RTC for 4.16 2018-02-02 14:19:19 -08:00
s390 libnvdimm for 4.16 2018-02-06 10:41:33 -08:00
sbus pci-v4.16-changes 2018-02-06 09:59:40 -08:00
scsi for-linus-20180204 2018-02-04 11:16:35 -08:00
sfi
sh
siox
slimbus
sn
soc ARM: SoC driver updates for 4.16 2018-02-01 16:35:31 -08:00
soundwire soundwire: Fix a signedness bug 2018-01-22 16:45:26 +01:00
spi Merge remote-tracking branch 'spi/topic/xilinx' into spi-next 2018-01-26 17:57:34 +00:00
spmi
ssb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-01-19 22:59:33 -05:00
staging media updates for v4.16-rc1 2018-02-06 11:27:48 -08:00
target Merge branch 'for-4.16/block' of git://git.kernel.dk/linux-block 2018-01-29 11:51:49 -08:00
tc
tee
thermal Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux 2018-02-06 15:04:58 -08:00
thunderbolt
tty Driver Core updates for 4.16-rc1 2018-02-01 10:00:28 -08:00
uio Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
usb pinctrl: files should directly include apis they use 2018-02-05 09:41:54 -08:00
uwb
vfio VFIO updates for v4.16-rc1 2018-02-01 13:18:25 -08:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-01-31 14:31:10 -08:00
video pci-v4.16-changes 2018-02-06 09:59:40 -08:00
virt Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
virtio
visorbus
vlynq
vme
w1 Documentation updates for 4.16. New stuff includes refcount_t 2018-01-31 19:25:25 -08:00
watchdog
xen dma mapping changes for Linux 4.16: 2018-01-31 11:32:27 -08:00
zorro
Kconfig Char/Misc driver patches for 4.16-rc1 2018-02-01 10:31:17 -08:00
Makefile pci-v4.16-changes 2018-02-06 09:59:40 -08:00