linux/drivers/net/ethernet/freescale
Christophe Leroy ee0df19305 net: ucc_geth - fix Oops when changing number of buffers in the ring
When changing the number of buffers in the RX ring while the interface
is running, the following Oops is encountered due to the new number
of buffers being taken into account immediately while their allocation
is done when opening the device only.

[   69.882706] Unable to handle kernel paging request for data at address 0xf0000100
[   69.890172] Faulting instruction address: 0xc033e164
[   69.895122] Oops: Kernel access of bad area, sig: 11 [#1]
[   69.900494] BE PREEMPT CMPCPRO
[   69.907120] CPU: 0 PID: 0 Comm: swapper Not tainted 4.14.115-00006-g179ade8ce3-dirty #269
[   69.915956] task: c0684310 task.stack: c06da000
[   69.920470] NIP:  c033e164 LR: c02e44d0 CTR: c02e41fc
[   69.925504] REGS: dfff1e20 TRAP: 0300   Not tainted  (4.14.115-00006-g179ade8ce3-dirty)
[   69.934161] MSR:  00009032 <EE,ME,IR,DR,RI>  CR: 22004428  XER: 20000000
[   69.940869] DAR: f0000100 DSISR: 20000000
[   69.940869] GPR00: c0352d70 dfff1ed0 c0684310 f00000a4 00000040 dfff1f68 00000000 0000001f
[   69.940869] GPR08: df53f410 1cc00040 00000021 c0781640 42004424 100c82b6 f00000a4 df53f5b0
[   69.940869] GPR16: df53f6c0 c05daf84 00000040 00000000 00000040 c0782be4 00000000 00000001
[   69.940869] GPR24: 00000000 df53f400 000001b0 df53f410 df53f000 0000003f df708220 1cc00044
[   69.978348] NIP [c033e164] skb_put+0x0/0x5c
[   69.982528] LR [c02e44d0] ucc_geth_poll+0x2d4/0x3f8
[   69.987384] Call Trace:
[   69.989830] [dfff1ed0] [c02e4554] ucc_geth_poll+0x358/0x3f8 (unreliable)
[   69.996522] [dfff1f20] [c0352d70] net_rx_action+0x248/0x30c
[   70.002099] [dfff1f80] [c04e93e4] __do_softirq+0xfc/0x310
[   70.007492] [dfff1fe0] [c0021124] irq_exit+0xd0/0xd4
[   70.012458] [dfff1ff0] [c000e7e0] call_do_irq+0x24/0x3c
[   70.017683] [c06dbe80] [c0006bac] do_IRQ+0x64/0xc4
[   70.022474] [c06dbea0] [c001097c] ret_from_except+0x0/0x14
[   70.027964] --- interrupt: 501 at rcu_idle_exit+0x84/0x90
[   70.027964]     LR = rcu_idle_exit+0x74/0x90
[   70.037585] [c06dbf60] [20000000] 0x20000000 (unreliable)
[   70.042984] [c06dbf80] [c004bb0c] do_idle+0xb4/0x11c
[   70.047945] [c06dbfa0] [c004bd14] cpu_startup_entry+0x18/0x1c
[   70.053682] [c06dbfb0] [c05fb034] start_kernel+0x370/0x384
[   70.059153] [c06dbff0] [00003438] 0x3438
[   70.063062] Instruction dump:
[   70.066023] 38a00000 38800000 90010014 4bfff015 80010014 7c0803a6 3123ffff 7c691910
[   70.073767] 38210010 4e800020 38600000 4e800020 <80e3005c> 80c30098 3107ffff 7d083910
[   70.081690] ---[ end trace be7ccd9c1e1a9f12 ]---

This patch forbids the modification of the number of buffers in the
ring while the interface is running.

Fixes: ac421852b3 ("ucc_geth: add ethtool support")
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-05-05 10:33:01 -07:00
..
dpaa dpaa_eth: fix SG frame cleanup 2019-05-05 10:31:33 -07:00
dpaa2 dpaa2-eth: fix race condition with bql frame accounting 2019-03-26 11:43:49 -07:00
enetc enetc: Add ENETC PF level external MDIO support 2019-03-01 11:21:32 -08:00
fman fsl/fman: Use vsprintf extension %pM 2019-03-03 21:10:06 -08:00
fs_enet
fec.h net: fec: remove workaround to restart phylib state machine on MDIO timeout 2018-12-18 15:01:55 -08:00
fec_main.c net: fec: manage ahb clock in runtime pm 2019-04-11 13:53:28 -07:00
fec_mpc52xx.c net: fec_mpc52xx: replace dev_kfree_skb_irq by dev_consume_skb_irq for drop profiles 2019-02-06 17:38:15 -08:00
fec_mpc52xx.h
fec_mpc52xx_phy.c
fec_ptp.c
fsl_pq_mdio.c net: fsl: Use device_type helpers to access the node type 2018-11-17 21:52:58 -08:00
gianfar.c gianfar: Add change_carrier() for Fixed PHYs 2018-12-17 11:24:32 -08:00
gianfar.h
gianfar_ethtool.c ptp_qoriq: make structure/function names more consistent 2019-02-12 12:58:47 -05:00
Kconfig enetc: Introduce basic PF and VF ENETC ethernet drivers 2019-01-24 21:55:53 -08:00
Makefile enetc: Introduce basic PF and VF ENETC ethernet drivers 2019-01-24 21:55:53 -08:00
ucc_geth.c ucc_geth: Reset BQL queue when stopping device 2019-01-30 10:36:23 -08:00
ucc_geth.h
ucc_geth_ethtool.c net: ucc_geth - fix Oops when changing number of buffers in the ring 2019-05-05 10:33:01 -07:00
xgmac_mdio.c