1
0
Fork 0
alistair23-linux/drivers/net
Fugang Duan dd7c2b79a9 MLK-24217 net: ethernet: stmmac: free tx skb buffer in stmmac_resume()
When do suspend/resume test, there have WARN_ON() log dump from
stmmac_xmit() funciton, the code logic:
	entry = tx_q->cur_tx;
	first_entry = entry;
	WARN_ON(tx_q->tx_skbuff[first_entry]);

In normal case, tx_q->tx_skbuff[txq->cur_tx] should be NULL because
the skb should be handled and freed in stmmac_tx_clean().

But stmmac_resume() reset queue parameters like below, skb buffers
may not be freed.
	tx_q->cur_tx = 0;
	tx_q->dirty_tx = 0;

So free tx skb buffer in stmmac_resume() to avoid warning and
memory leak.

log:
[   46.139824] ------------[ cut here ]------------
[   46.144453] WARNING: CPU: 0 PID: 0 at drivers/net/ethernet/stmicro/stmmac/stmmac_main.c:3235 stmmac_xmit+0x7a0/0x9d0
[   46.154969] Modules linked in: crct10dif_ce vvcam(O) flexcan can_dev
[   46.161328] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O      5.4.24-2.1.0+g2ad925d15481 #1
[   46.170369] Hardware name: NXP i.MX8MPlus EVK board (DT)
[   46.175677] pstate: 80000005 (Nzcv daif -PAN -UAO)
[   46.180465] pc : stmmac_xmit+0x7a0/0x9d0
[   46.184387] lr : dev_hard_start_xmit+0x94/0x158
[   46.188913] sp : ffff800010003cc0
[   46.192224] x29: ffff800010003cc0 x28: ffff000177e2a100
[   46.197533] x27: ffff000176ef0840 x26: ffff000176ef0090
[   46.202842] x25: 0000000000000000 x24: 0000000000000000
[   46.208151] x23: 0000000000000003 x22: ffff8000119ddd30
[   46.213460] x21: ffff00017636f000 x20: ffff000176ef0cc0
[   46.218769] x19: 0000000000000003 x18: 0000000000000000
[   46.224078] x17: 0000000000000000 x16: 0000000000000000
[   46.229386] x15: 0000000000000079 x14: 0000000000000000
[   46.234695] x13: 0000000000000003 x12: 0000000000000003
[   46.240003] x11: 0000000000000010 x10: 0000000000000010
[   46.245312] x9 : ffff00017002b140 x8 : 0000000000000000
[   46.250621] x7 : ffff00017636f000 x6 : 0000000000000010
[   46.255930] x5 : 0000000000000001 x4 : ffff000176ef0000
[   46.261238] x3 : 0000000000000003 x2 : 00000000ffffffff
[   46.266547] x1 : ffff000177e2a000 x0 : 0000000000000000
[   46.271856] Call trace:
[   46.274302]  stmmac_xmit+0x7a0/0x9d0
[   46.277874]  dev_hard_start_xmit+0x94/0x158
[   46.282056]  sch_direct_xmit+0x11c/0x338
[   46.285976]  __qdisc_run+0x118/0x5f0
[   46.289549]  net_tx_action+0x110/0x198
[   46.293297]  __do_softirq+0x120/0x23c
[   46.296958]  irq_exit+0xb8/0xd8
[   46.300098]  __handle_domain_irq+0x64/0xb8
[   46.304191]  gic_handle_irq+0x5c/0x148
[   46.307936]  el1_irq+0xb8/0x180
[   46.311076]  cpuidle_enter_state+0x84/0x360
[   46.315256]  cpuidle_enter+0x34/0x48
[   46.318829]  call_cpuidle+0x18/0x38
[   46.322314]  do_idle+0x1e0/0x280
[   46.325539]  cpu_startup_entry+0x24/0x40
[   46.329460]  rest_init+0xd4/0xe0
[   46.332687]  arch_call_rest_init+0xc/0x14
[   46.336695]  start_kernel+0x420/0x44c
[   46.340353] ---[ end trace bc1ee695123cbacd ]---

Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
2020-06-02 16:04:02 +08:00
..
appletalk
arcnet
bonding bonding: fix lockdep warning in bond_get_stats() 2020-03-05 16:43:35 +01:00
caif
can MLK-23582 can: flexcan: fix TDC feature 2020-04-01 09:54:24 +08:00
dsa This is the 5.4.24 stable release 2020-03-08 18:57:18 +08:00
ethernet MLK-24217 net: ethernet: stmmac: free tx skb buffer in stmmac_resume() 2020-06-02 16:04:02 +08:00
fddi
fjes fjes: fix missed check in fjes_acpi_add 2019-12-31 16:41:14 +01:00
hamradio 6pack,mkiss: fix possible deadlock 2020-01-04 19:18:36 +01:00
hippi
hyperv hv_netvsc: Fix unwanted wakeup in netvsc_attach() 2020-03-05 16:43:46 +01:00
ieee802154 Merge tag 'ieee802154-for-davem-2019-09-28' of git://git.kernel.org/pub/scm/linux/kernel/git/sschmidt/wpan 2019-09-30 17:14:45 -07:00
ipvlan net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
netdevsim netdevsim: fix stack-out-of-bounds in nsim_dev_debugfs_init() 2020-02-11 04:35:06 -08:00
phy MLK-24174-03 net: phy: tja11xx: add refclk source selection support 2020-05-27 08:36:58 +00:00
plip
ppp ppp: Adjust indentation into ppp_async_input 2020-02-11 04:35:46 -08:00
slip can, slip: Protect tty->disc_data in write_wakeup and close with RCU 2020-01-29 16:45:19 +01:00
team team: call RCU read lock when walking the port_list 2019-12-31 16:43:54 +01:00
usb qmi_wwan: unconditionally reject 2 ep interfaces 2020-03-05 16:43:37 +01:00
vmxnet3
wan wan: ixp4xx_hss: fix compile-testing on 64-bit 2020-02-24 08:36:46 +01:00
wimax wimax: i2400: Fix memory leak in i2400m_op_rfkill_sw_toggle 2019-10-29 16:20:25 -07:00
wireless MLK-24191 net: wireless: nxp: mxm_wifiex: upgrade to mxm4x17175 release 2020-06-02 11:00:03 +08:00
xen-netback xen/netback: fix error path of xenvif_connect_data() 2019-10-19 11:43:29 -07:00
Kconfig ivshmem-net: virtual network device for Jailhouse 2019-11-25 15:43:24 +08:00
LICENSE.SRC
Makefile ivshmem-net: virtual network device for Jailhouse 2019-11-25 15:43:24 +08:00
Space.c
dummy.c
eql.c
geneve.c net: ipv6_stub: use ip6_dst_lookup_flow instead of ip6_dst_lookup 2019-12-18 16:08:42 +01:00
gtp.c gtp: use __GFP_NOWARN to avoid memalloc warning 2020-02-11 04:35:04 -08:00
ifb.c
ivshmem-net.c ivshmem-net: Fix TX queue locking and plug notification races 2020-04-29 15:03:04 +08:00
loopback.c
macsec.c net: remove unnecessary variables and callback 2019-10-24 14:53:49 -07:00
macvlan.c macvlan: use skb_reset_mac_header() in macvlan_queue_xmit() 2020-01-23 08:22:49 +01:00
macvtap.c
mdio.c
mii.c
net_failover.c
netconsole.c
nlmon.c
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c net: tap: clean up an indentation issue 2019-09-27 20:58:35 +02:00
thunderbolt.c
tun.c tun: add mutex_unlock() call and napi.skb clearing in tun_get_user() 2020-01-29 16:45:22 +01:00
veth.c
virtio_net.c netfilter: drop bridge nf reset from nf_reset 2019-10-01 18:42:15 +02:00
vrf.c net: core: add generic lockdep keys 2019-10-24 14:53:48 -07:00
vsockmon.c
vxlan.c vxlan: fix tos value before xmit 2020-01-12 12:21:49 +01:00
xen-netfront.c xen-netfront: do not use ~0U as error return value for xennet_fill_frags() 2019-10-01 21:49:51 -04:00