]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.1.3/net-ucc_geth-fix-oops-when-changing-number-of-buffers-in-the-ring.patch
drop queue-4.4/mm-vmstat-make-quiet_vmstat-lighter.patch
[thirdparty/kernel/stable-queue.git] / releases / 5.1.3 / net-ucc_geth-fix-oops-when-changing-number-of-buffers-in-the-ring.patch
1 From foo@baz Wed 15 May 2019 07:51:30 AM CEST
2 From: Christophe Leroy <christophe.leroy@c-s.fr>
3 Date: Fri, 3 May 2019 13:33:23 +0000
4 Subject: net: ucc_geth - fix Oops when changing number of buffers in the ring
5
6 From: Christophe Leroy <christophe.leroy@c-s.fr>
7
8 [ Upstream commit ee0df19305d9fabd9479b785918966f6e25b733b ]
9
10 When changing the number of buffers in the RX ring while the interface
11 is running, the following Oops is encountered due to the new number
12 of buffers being taken into account immediately while their allocation
13 is done when opening the device only.
14
15 [ 69.882706] Unable to handle kernel paging request for data at address 0xf0000100
16 [ 69.890172] Faulting instruction address: 0xc033e164
17 [ 69.895122] Oops: Kernel access of bad area, sig: 11 [#1]
18 [ 69.900494] BE PREEMPT CMPCPRO
19 [ 69.907120] CPU: 0 PID: 0 Comm: swapper Not tainted 4.14.115-00006-g179ade8ce3-dirty #269
20 [ 69.915956] task: c0684310 task.stack: c06da000
21 [ 69.920470] NIP: c033e164 LR: c02e44d0 CTR: c02e41fc
22 [ 69.925504] REGS: dfff1e20 TRAP: 0300 Not tainted (4.14.115-00006-g179ade8ce3-dirty)
23 [ 69.934161] MSR: 00009032 <EE,ME,IR,DR,RI> CR: 22004428 XER: 20000000
24 [ 69.940869] DAR: f0000100 DSISR: 20000000
25 [ 69.940869] GPR00: c0352d70 dfff1ed0 c0684310 f00000a4 00000040 dfff1f68 00000000 0000001f
26 [ 69.940869] GPR08: df53f410 1cc00040 00000021 c0781640 42004424 100c82b6 f00000a4 df53f5b0
27 [ 69.940869] GPR16: df53f6c0 c05daf84 00000040 00000000 00000040 c0782be4 00000000 00000001
28 [ 69.940869] GPR24: 00000000 df53f400 000001b0 df53f410 df53f000 0000003f df708220 1cc00044
29 [ 69.978348] NIP [c033e164] skb_put+0x0/0x5c
30 [ 69.982528] LR [c02e44d0] ucc_geth_poll+0x2d4/0x3f8
31 [ 69.987384] Call Trace:
32 [ 69.989830] [dfff1ed0] [c02e4554] ucc_geth_poll+0x358/0x3f8 (unreliable)
33 [ 69.996522] [dfff1f20] [c0352d70] net_rx_action+0x248/0x30c
34 [ 70.002099] [dfff1f80] [c04e93e4] __do_softirq+0xfc/0x310
35 [ 70.007492] [dfff1fe0] [c0021124] irq_exit+0xd0/0xd4
36 [ 70.012458] [dfff1ff0] [c000e7e0] call_do_irq+0x24/0x3c
37 [ 70.017683] [c06dbe80] [c0006bac] do_IRQ+0x64/0xc4
38 [ 70.022474] [c06dbea0] [c001097c] ret_from_except+0x0/0x14
39 [ 70.027964] --- interrupt: 501 at rcu_idle_exit+0x84/0x90
40 [ 70.027964] LR = rcu_idle_exit+0x74/0x90
41 [ 70.037585] [c06dbf60] [20000000] 0x20000000 (unreliable)
42 [ 70.042984] [c06dbf80] [c004bb0c] do_idle+0xb4/0x11c
43 [ 70.047945] [c06dbfa0] [c004bd14] cpu_startup_entry+0x18/0x1c
44 [ 70.053682] [c06dbfb0] [c05fb034] start_kernel+0x370/0x384
45 [ 70.059153] [c06dbff0] [00003438] 0x3438
46 [ 70.063062] Instruction dump:
47 [ 70.066023] 38a00000 38800000 90010014 4bfff015 80010014 7c0803a6 3123ffff 7c691910
48 [ 70.073767] 38210010 4e800020 38600000 4e800020 <80e3005c> 80c30098 3107ffff 7d083910
49 [ 70.081690] ---[ end trace be7ccd9c1e1a9f12 ]---
50
51 This patch forbids the modification of the number of buffers in the
52 ring while the interface is running.
53
54 Fixes: ac421852b3a0 ("ucc_geth: add ethtool support")
55 Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
56 Signed-off-by: David S. Miller <davem@davemloft.net>
57 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
58 ---
59 drivers/net/ethernet/freescale/ucc_geth_ethtool.c | 8 +++-----
60 1 file changed, 3 insertions(+), 5 deletions(-)
61
62 --- a/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
63 +++ b/drivers/net/ethernet/freescale/ucc_geth_ethtool.c
64 @@ -252,14 +252,12 @@ uec_set_ringparam(struct net_device *net
65 return -EINVAL;
66 }
67
68 + if (netif_running(netdev))
69 + return -EBUSY;
70 +
71 ug_info->bdRingLenRx[queue] = ring->rx_pending;
72 ug_info->bdRingLenTx[queue] = ring->tx_pending;
73
74 - if (netif_running(netdev)) {
75 - /* FIXME: restart automatically */
76 - netdev_info(netdev, "Please re-open the interface\n");
77 - }
78 -
79 return ret;
80 }
81