Fugang Duan
4ec236c7c5
net: 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 ]---
Fixes: 47dd7a540b8a0 ("net: add support for STMicroelectronics Ethernet controllers.")
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-12-08 14:52:29 -08:00
..
2020-11-22 11:52:10 -08:00
2020-11-27 10:44:59 -08:00
2020-10-17 15:05:30 -06:00
2020-10-30 14:51:01 -07:00
2020-11-18 16:42:07 -08:00
2020-11-02 18:14:07 +01:00
2020-10-01 16:23:50 +03:00
2020-11-12 13:59:04 -07:00
2020-10-30 16:57:41 -05:00
2020-11-19 11:05:48 +02:00
2020-11-15 10:15:17 -08:00
2020-11-04 17:13:12 -08:00
2020-10-25 14:51:49 -07:00
2020-11-01 17:17:31 +00:00
2020-11-23 12:55:01 +01:00
2020-11-16 13:24:32 +01:00
2020-10-28 11:41:15 -06:00
2020-11-22 10:48:22 -08:00
2020-09-29 17:50:10 +09:00
2020-11-20 10:23:49 -08:00
2020-10-15 14:43:29 -07:00
2020-10-12 13:26:49 -07:00
2020-09-30 00:40:06 +09:00
2020-09-25 06:20:48 +02:00
2020-11-29 10:18:53 -08:00
2020-11-11 09:53:09 +01:00
2020-11-27 09:39:51 +10:00
2020-11-22 14:36:06 -08:00
2020-11-16 15:02:33 -08:00
2020-11-13 06:46:20 -08:00
2020-10-29 20:10:25 +01:00
2020-11-06 16:02:00 +01:00
2020-10-17 11:01:01 -07:00
2020-10-13 12:12:44 -07:00
2020-11-24 16:47:36 +01:00
2020-11-14 17:33:47 +00:00
2020-11-26 10:57:32 -04:00
2020-11-17 12:00:40 -08:00
2020-11-20 16:01:35 +02:00
2020-11-27 10:41:19 -08:00
2020-11-25 00:56:28 +01:00
2020-10-07 12:02:58 +02:00
2020-10-16 09:28:45 -06:00
2020-10-16 12:21:15 -07:00
2020-10-24 10:39:22 -07:00
2020-10-14 15:05:38 -07:00
2020-11-26 08:05:24 +01:00
2020-10-24 10:39:22 -07:00
2020-09-28 12:17:36 +02:00
2020-10-26 16:57:18 -04:00
2020-10-14 15:56:58 -07:00
2020-11-23 20:08:43 +02:00
2020-11-17 12:44:44 +01:00
2020-11-20 12:31:26 +01:00
2020-12-08 14:52:29 -08:00
2020-11-24 15:00:53 -08:00
2020-10-25 11:12:31 -07:00
2020-10-13 18:38:28 -07:00
2020-11-14 09:57:55 +01:00
2020-09-27 14:25:48 +02:00
2020-11-11 17:10:16 -06:00
2020-10-27 13:21:03 +05:30
2020-10-06 07:07:03 +02:00
2020-11-04 13:55:30 -06:00
2020-09-25 06:12:15 +02:00
2020-10-01 22:30:07 +01:00
2020-11-16 13:21:28 +05:30
2020-11-10 15:35:41 +01:00
2020-11-26 15:49:16 +01:00
2020-10-27 19:23:04 +01:00
2020-10-24 10:33:08 -07:00
2020-11-10 10:02:31 -08:00
2020-11-25 17:24:49 -08:00
2020-12-03 09:57:37 -08:00
2020-10-16 11:11:22 -07:00
2020-09-25 19:05:31 +02:00
2020-11-18 17:59:24 +00:00
2020-10-22 12:56:33 -07:00
2020-10-24 10:39:22 -07:00
2020-10-22 12:58:21 -07:00
2020-10-21 11:22:08 -07:00
2020-11-27 14:38:02 -08:00
2020-11-27 14:06:23 -08:00
2020-09-25 14:41:51 +02:00
2020-11-26 22:07:22 +01:00
2020-10-01 22:59:55 +02:00
2020-11-25 12:54:05 +00:00
2020-11-25 10:35:44 -08:00
2020-11-20 16:24:28 -08:00
2020-11-27 14:48:03 -08:00
2020-11-12 12:30:29 +01:00
2020-11-06 16:39:11 +03:00
2020-11-12 09:41:07 +01:00
2020-11-09 18:54:30 +01:00
2020-11-27 14:44:26 +01:00
2020-12-02 04:09:56 -05:00
2020-11-03 11:07:40 -07:00
2020-12-02 04:36:40 -05:00
2020-11-23 15:29:03 -08:00
2020-11-09 18:20:36 +01:00
2020-10-23 11:00:57 -07:00
2020-10-05 14:49:24 +02:00
2020-10-24 10:33:08 -07:00
2020-11-02 10:10:39 -05:00
2020-12-02 04:09:56 -05:00