Skip to content
Commit 20ae11f1 authored by Meng Li's avatar Meng Li Committed by Meng Li
Browse files

drvier: staging: fsl_qbman: move used_node variable allocation out the lock/unlock section



When kernel boots up, there is call trace as below:
BUG: sleeping function called from invalid context at mm/slab.h:513
in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 1, name: swapper/0
......
CPU: 3 PID: 1 Comm: swapper/0 Not tainted 5.10.69-yocto-standard #1
Hardware name: LS1043A RDB Board (DT)
Call trace:
 dump_backtrace+0x0/0x1b0
 show_stack+0x24/0x30
 dump_stack+0xf0/0x13c
 ___might_sleep+0x1a0/0x24c
 __might_sleep+0x60/0xa0
 kmem_cache_alloc_trace+0x2cc/0x3b0
 dpa_alloc_new+0x1b0/0x290
 ......
 fm_port_load+0x1c/0x50
 do_one_initcall+0xbc/0x470
 kernel_init_freeable+0x30c/0x378
 kernel_init+0x20/0x128
 ret_from_fork+0x10/0x38

The call trace is caused by allocating used_node with GFP_KERNEL
parameter in atomic environment. It is not necessary to do the allocation
in atomic environment, so move it out the lock/unlock section.

Signed-off-by: default avatarMeng Li <Meng.Li@windriver.com>
parent 98034917
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment