linux_dsm_epyc7002/drivers/net/ethernet
Nimrod Andy 2b995f6398 net: fec: fix the warning found by dma debug
Enable kernel config "CONFIG_HAVE_DMA_API_DEBUG", FEC have kernel warning:
[    6.650444] fec 2188000.ethernet: DMA-API: device driver tries to free DMA memory it has not allocated
[    6.664289] Modules linked in:
[    6.667378] CPU: 0 PID: 3 Comm: ksoftirqd/0 Not tainted 3.19.0-rc4-00688-g8834016-dirty #150
[    6.675841] Hardware name: Freescale i.MX6 SoloX (Device Tree)
[    6.681698] Backtrace:
[    6.684189] [<80011e3c>] (dump_backtrace) from [<80011fdc>] (show_stack+0x18/0x1c)
[    6.691789]  r6:80890154 r5:00000000 r4:00000000 r3:00000000
[    6.697533] [<80011fc4>] (show_stack) from [<806d2d88>] (dump_stack+0x80/0x9c)
[    6.704799] [<806d2d08>] (dump_stack) from [<8002a4e4>] (warn_slowpath_common+0x7c/0xb4)
[    6.712917]  r5:00000445 r4:00000000
[    6.716544] [<8002a468>] (warn_slowpath_common) from [<8002a5c0>] (warn_slowpath_fmt+0x38/0x40)
[    6.725265]  r8:809a2ee8 r7:00000000 r6:00000000 r5:00000000 r4:00000042
[    6.732087] [<8002a58c>] (warn_slowpath_fmt) from [<802d6268>] (check_unmap+0x86c/0x98c)
[    6.740202]  r3:808c79bc r2:8089060c
[    6.743826] [<802d59fc>] (check_unmap) from [<802d65e4>] (debug_dma_unmap_page+0x80/0x88)
[    6.752029]  r10:00000000 r9:00000000 r8:00000000 r7:00000001 r6:be12a410 r5:00000000
[    6.759967]  r4:00000042
[    6.762538] [<802d6564>] (debug_dma_unmap_page) from [<80440248>] (fec_enet_rx_napi+0x7ec/0xb9c)
[    6.771345]  r7:00000400 r6:be3e4000 r5:bf08fa20 r4:be036000
[    6.777094] [<8043fa5c>] (fec_enet_rx_napi) from [<8056ae24>] (net_rx_action+0x134/0x324)
[    6.785297]  r10:be089e60 r9:80998180 r8:ffff8d68 r7:0000012c r6:00000040 r5:00000001
[    6.793239]  r4:be036718
[    6.795801] [<8056acf0>] (net_rx_action) from [<8002db24>] (__do_softirq+0x138/0x2d0)
[    6.803655]  r10:00000003 r9:00000003 r8:80996378 r7:8099c080 r6:00000100 r5:8099c08c
[    6.811593]  r4:00000000
[    6.814157] [<8002d9ec>] (__do_softirq) from [<8002dd00>] (run_ksoftirqd+0x44/0x5c)
[    6.821836]  r10:00000000 r9:00000000 r8:809b133c r7:00000000 r6:00000001 r5:00000000
[    6.829775]  r4:be027e80
[    6.832346] [<8002dcbc>] (run_ksoftirqd) from [<80048290>] (smpboot_thread_fn+0x154/0x1c4)
[    6.840649] [<8004813c>] (smpboot_thread_fn) from [<80044780>] (kthread+0xdc/0xf8)
[    6.848224]  r10:00000000 r8:00000000 r7:8004813c r6:be027e80 r5:be027ec0 r4:00000000
[    6.856179] [<800446a4>] (kthread) from [<8000ebc8>] (ret_from_fork+0x14/0x2c)
[    6.863425]  r7:00000000 r6:00000000 r5:800446a4 r4:be027ec0
[    6.869156] ---[ end trace 861cf914d2461a8b ]---

There have one bug in .fec_enet_tx_queue() function to unmap the DMA memory:
For SG or TSO, get one buffer descriptor and then unmap the related DMA memory, and then
get the next buffer descriptor, loop to while() to check "TX_READY". If "TX_READY" bit
still __IS__ existed in the BD (The next fraglist or next TSO packet is not transmited
complitely), exit the current clean work. When the next work is triggered, it still repeat
above step with the same BD. The potential issue is that unmap the same DMA memory for
multiple times.

The patch fix the clean work for SG and TSO packet.

Reported-by: Anand Moon <moon.linux@yahoo.com>
Reported-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2015-01-24 21:53:41 -08:00
..
3com net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
8390 ne2k-pci: Add pci_disable_device in error handling 2014-12-27 02:20:55 -05:00
adaptec
adi
aeroflex
agere
allwinner net: sun4i-emac: fix error return code 2014-12-31 19:19:00 -05:00
alteon net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
altera Altera TSE: Add missing phydev 2015-01-02 15:45:10 -05:00
amd mii: Handle link state changes for forced modes in mii_check_media() 2015-01-19 15:43:42 -05:00
apm net: eth: xgene: devm_ioremap() returns NULL on error 2015-01-12 15:40:18 -05:00
apple
arc
atheros Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
brocade net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
cadence net/macb: Create gem_ethtool_ops for new statistics functions 2015-01-16 00:31:37 -05:00
calxeda
chelsio cxgb4: Add debugfs options to dump the rss key, config for PF, VF, etc 2015-01-24 17:13:25 -08:00
cirrus cirrus: cs89x0: fix time comparison 2014-12-15 11:44:21 -05:00
cisco net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
davicom dm9000: Add regulator and reset support to dm9000 2015-01-15 14:08:07 -05:00
dec uli526x: fix misspelling of current function in string 2014-12-09 16:18:46 -05:00
dlink
emulex be2net: Fix TX rate limiting on Lancer/Skyhawk-R VFs 2015-01-24 17:22:42 -08:00
faraday
freescale net: fec: fix the warning found by dma debug 2015-01-24 21:53:41 -08:00
fujitsu
hisilicon net: hisilicon: new hip04 ethernet driver 2015-01-14 01:52:45 -05:00
hp hp100: fix misspelling of current function in string 2014-12-09 16:18:47 -05:00
i825xx
ibm net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
icplus
intel i40e/i40evf: Bump i40e and i40evf versions 2015-01-16 05:21:10 -08:00
marvell net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
mellanox net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
micrel ksz884x: Use setup_timer 2014-12-30 18:34:23 -05:00
microchip
moxa
myricom myri10ge: fix error return code 2014-12-31 19:19:00 -05:00
natsemi net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
neterion net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
nuvoton
nvidia net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
nxp
octeon
oki-semi
packetengines
pasemi net-PA Semi: Deletion of unnecessary checks before the function call "pci_dev_put" 2014-12-05 21:14:20 -08:00
qlogic net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
qualcomm net: qualcomm: Fix dependency 2014-11-11 18:12:32 -05:00
rdc
realtek net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
renesas net: sh_eth: Use u32 for 32-bit register data 2015-01-15 14:10:27 -05:00
rocker net: rocker: Add basic netdev counters - v2 2015-01-18 01:55:43 -05:00
samsung net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
seeq
sfc ethtool: Support for configurable RSS hash function 2014-12-08 21:07:10 -05:00
sgi
silan
sis
smsc net: smc91x: Add Atari EtherNAT support 2015-01-15 19:32:58 -05:00
stmicro net: stmmac: dwmac-rk: Use standard devicetree property for phy regulator 2015-01-24 17:17:07 -08:00
sun niu: remove one compound_head() call 2015-01-17 23:58:37 -05:00
tehuti net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
ti net: netcp: Enhance GBE driver to support 10G Ethernet 2015-01-19 15:07:39 -05:00
tile
toshiba
tundra
via mii: Handle link state changes for forced modes in mii_check_media() 2015-01-19 15:43:42 -05:00
wiznet Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
xilinx net: axienet: fix error return code 2014-12-31 19:19:00 -05:00
xircom
xscale
dnet.c net: dnet: fix dnet_poll() 2015-01-11 21:44:55 -05:00
dnet.h
ec_bhf.c
ethoc.c
fealnx.c
jme.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
jme.h
Kconfig net: s6gmac: remove driver 2014-12-22 16:29:03 -05:00
korina.c
lantiq_etop.c
Makefile net: s6gmac: remove driver 2014-12-22 16:29:03 -05:00
netx-eth.c