tsn: replace GFP_KERNEL with GFP_ATOMIC to avoid sleeping in atomic context
When running qbv test of TSN feature in RT kernel, there is below call trace BUG: sleeping function called from invalid context at include/linux/sched/mm.h:229 in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 502, name: tsntool preempt_count: 0, expected: 0 RCU nest depth: 1, expected: 0 CPU: 0 PID: 502 Comm: tsntool Not tainted 5.15.65-rt48-yocto-preempt-rt #1 Hardware name: LS1028A RDB Board (DT) Call trace: dump_backtrace+0x0/0x1a0 ...... __might_resched+0x160/0x1c0 __might_sleep+0x58/0xb0 kmem_cache_alloc+0x260/0x310 __alloc_skb+0x1a8/0x1d0 tsn_event+0x58/0x230 atomic_notifier_call_chain+0x6c/0x9c call_tsn_notifiers+0x30/0x40 enetc_qbv_set+0x2e8/0x5fc cmd_qbv_set.isra.0+0x1d4/0x300 tsn_qbv_set+0x2c/0x44 ...... el0t_64_sync+0x1a0/0x1a4 So, replace GFP_KERNEL with GFP_ATOMIC to avoid sleeping in atomic context. Signed-off-by:Meng Li <Meng.Li@windriver.com> Signed-off-by:
Bruce Ashfield <bruce.ashfield@gmail.com>
Loading
Please register or sign in to comment