[OpenWrt-Devel] atomic sleep bugs - 19.07 (and probably Master too)

Hauke Mehrtens hauke at hauke-m.de
Fri Aug 2 10:16:57 EDT 2019


On 8/2/19 10:40 AM, Koen Vandeputte wrote:
> 
> On 01.08.19 17:27, Koen Vandeputte wrote:
>> Hi All,
>>
>> I've been playing around the last few days stresstesting latest 19.07
>> on different targets (ar71xx, cns3xxx, imx6, ...) with extra kernel
>> debug features enabled.
>>
>> I'll post some results here as maybe somebody has a clue. :)
>>
>>
>> Some interesting splats already showed up, actually also *breaking*
>> some functionality while the board is running:
>>
>> on Mikrotik RB2011 (ar71xx)
>>
>>

......

> 
> [   13.152502] eth0: link down
> [   13.155063] BUG: sleeping function called from invalid context at
> net/core/dev.c:5563
> [   13.161685] in_atomic(): 1, irqs_disabled(): 1, pid: 456, name: ip
> [   13.167848] 2 locks held by ip/456:
> [   13.171315]  #0:  (rtnl_mutex){....}, at: [<8032aba4>]
> rtnetlink_rcv_msg+0x2d8/0x380
> [   13.179039]  #1:  (&(&ag->lock)->rlock){....}, at: [<802e3c40>]
> ag71xx_hw_disable+0x24/0x94
> [   13.187385] CPU: 0 PID: 456 Comm: ip Not tainted 4.14.134 #0
> [   13.193019] Stack : 805a0000 80547894 8051de14 831c98ec 805f0000
> 805f0000 83918efc 805733a7
> [   13.201348]         80517e44 000001c8 805f38bc 831c9ccc 8390d0c0
> 00000001 831c98a0 b0502ae3
> [   13.209681]         00000000 00000000 80ae0000 831c979c 6138f004
> 00000000 00000007 00000000
> [   13.218016]         00000091 b3400000 00000090 00000000 80000000
> 839c9d8c 839c9db0 00000001
> [   13.226347]         80428b7c 831c9ccc 8390d0c0 83b51210 00000003
> 00000000 00000000 805f0000
> [   13.234680]         ...
> [   13.237114] Call Trace:
> [   13.239556] [<8006c88c>] show_stack+0x58/0x100
> [   13.244006] [<800aab74>] ___might_sleep+0x100/0x120
> [   13.248853] [<8030fb84>] napi_disable+0x30/0xd8
> [   13.253354] [<802e3c80>] ag71xx_hw_disable+0x64/0x94
> [   13.258304] [<802e3cd4>] ag71xx_stop+0x24/0x38
> [   13.262731] [<8030d580>] __dev_close_many+0xcc/0x104
> [   13.267697] [<803165fc>] __dev_change_flags+0xc8/0x1ac
> [   13.272801] [<80316708>] dev_change_flags+0x28/0x70
> [   13.277662] [<80329fc0>] do_setlink+0x31c/0x91c
> [   13.282178] [<8032ca90>] rtnl_newlink+0x3ec/0x7f8
> [   13.286865] [<8032abc8>] rtnetlink_rcv_msg+0x2fc/0x380
> [   13.292019] [<8034de64>] netlink_rcv_skb+0xd4/0x178
> [   13.296849] [<8034d440>] netlink_unicast+0x168/0x250
> [   13.301797] [<8034da04>] netlink_sendmsg+0x3d8/0x434
> [   13.306753] [<802f2774>] ___sys_sendmsg+0x1dc/0x290
> [   13.311607] [<802f37d0>] __sys_sendmsg+0x54/0x84
> [   13.316225] [<80071eac>] syscall_common+0x34/0x58

There is a bug in ag71xx_hw_disable(), it calls napi_disable() while
holding a spinlock in the same function which is not allowed. I never
looked into ag71xx before, someone should fix this code and make it call
napi_disable() outside of the spinlock.

Hauke

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20190802/b91eb41c/attachment.sig>
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list