1
0
Fork 0
alistair23-linux/drivers/net
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
..
appletalk net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
arcnet
bonding bonding: cleanup bond_opts array 2015-01-12 16:39:31 -05:00
caif caif: Fix napi poll list corruption 2014-12-22 16:34:39 -05:00
can Driver core patches for 3.19-rc1 2014-12-14 16:10:09 -08:00
cris
dsa net: dsa: bcm_sf2: always select FIXED_PHY 2014-12-16 00:57:07 -05:00
ethernet net: fec: fix the warning found by dma debug 2015-01-24 21:53:41 -08:00
fddi net: fddi: skfp: smt.c: Remove unused function 2015-01-02 16:36:07 -05:00
hamradio hamradio: 6pack: remove unnecessary check 2014-11-03 15:34:31 -05:00
hippi
hyperv hyperv: Fix some variable name typos in send-buffer init/revoke 2014-12-22 16:11:11 -05:00
ieee802154 at86rf230: Constify struct regmap_config 2015-01-05 16:30:50 -05:00
ipvlan ipvlan: move the device check function into netdevice.h 2014-12-09 16:10:06 -05:00
irda irda: vlsi_ir: Replace timeval with ktime_t 2015-01-11 21:39:40 -05:00
phy amd-xgbe-phy: Allow certain PHY settings to be set by UEFI 2015-01-16 22:24:21 -05:00
plip
ppp ppp_read(): switch to skb_copy_datagram_iter() 2014-12-09 16:29:10 -05:00
slip
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00
vmxnet3 Driver: Vmxnet3: Fix ethtool -S to return correct rx queue stats 2015-01-16 00:30:05 -05:00
wan net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
wimax kbuild: remove unnecessary "obj- := dummy.o" trick 2014-10-02 13:55:02 +02:00
wireless Some further updates for net-next: 2015-01-19 16:22:19 -05:00
xen-netback xen-netback: always fully coalesce guest Rx packets 2015-01-23 18:01:58 -08:00
Kconfig ipvlan: ipvlan depends on INET and IPV6 2014-11-29 20:53:05 -08:00
LICENSE.SRC
Makefile ipvlan: Initial check-in of the IPVLAN driver. 2014-11-24 15:29:18 -05:00
Space.c
dummy.c dummy: use MODULE_VERSION 2014-12-09 21:51:06 -05:00
eql.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
ifb.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
loopback.c net: better IFF_XMIT_DST_RELEASE support 2014-10-07 13:22:11 -04:00
macvlan.c macvlan: advertise link netns via netlink 2015-01-23 17:51:15 -08:00
macvtap.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
mdio.c
mii.c mii: Handle link state changes for forced modes in mii_check_media() 2015-01-19 15:43:42 -05:00
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tun.c net: rename vlan_tx_* helpers since "tx" is misleading there 2015-01-13 17:51:08 -05:00
veth.c veth: advertise link netns via netlink 2015-01-23 17:51:15 -08:00
virtio_net.c virtio-net: don't do header check for dodgy gso packets 2014-12-30 18:53:20 -05:00
vxlan.c vxlan: advertise netns of vxlan dev in fdb msg 2015-01-23 17:51:15 -08:00
xen-netfront.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-01-15 00:53:17 -05:00