merged. Bruce
In message: [PATCH v2] drivers: fsl_qbman: replace GFP_KERNEL with GFP_ATOMIC during allocating memory on 21/09/2023 Meng Li wrote: > When running crypto test case, there is below calltrace because of > allocating memory with GFP_KERNEL parameter in atomic context. > Call trace: > ...... > __might_resched+0x154/0x1c0 > __might_sleep+0x54/0xa4 > __kmem_cache_alloc_node+0x434/0x594 > kmalloc_trace+0x54/0x140 > dpa_alloc_new+0x58/0x280 > qman_alloc_fqid_range+0x3c/0x4c > qman_create_fq+0x6c/0x440 > create_caam_req_fq+0x88/0x170 > caam_drv_ctx_init+0x134/0x2d4 > get_drv_ctx.part.0+0xbc/0xdc > aead_edesc_alloc+0x630/0x980 > aead_encrypt+0x38/0xc0 > crypto_aead_encrypt+0x2c/0x40 > test_aead_vec_cfg+0x234/0x84c > test_aead+0xc4/0x160 > alg_test_aead+0x9c/0x1a0 > alg_test+0x380/0x540 > cryptomgr_test+0x34/0x54 > ...... > To avoid this calltrace, replace GFP_KERNEL with GFP_ATOMIC. > > Signed-off-by: Meng Li <meng...@windriver.com> > --- > drivers/staging/fsl_qbman/dpa_alloc.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/fsl_qbman/dpa_alloc.c > b/drivers/staging/fsl_qbman/dpa_alloc.c > index e420ef73325a..f23bc11e30d2 100644 > --- a/drivers/staging/fsl_qbman/dpa_alloc.c > +++ b/drivers/staging/fsl_qbman/dpa_alloc.c > @@ -447,16 +447,16 @@ int dpa_alloc_new(struct dpa_alloc *alloc, u32 *result, > u32 count, u32 align, > /* If 'align' is 0, it should behave as though it was 1 */ > if (!align) > align = 1; > - margin_left = kmalloc(sizeof(*margin_left), GFP_KERNEL); > + margin_left = kmalloc(sizeof(*margin_left), GFP_ATOMIC); > if (!margin_left) > goto err; > - margin_right = kmalloc(sizeof(*margin_right), GFP_KERNEL); > + margin_right = kmalloc(sizeof(*margin_right), GFP_ATOMIC); > if (!margin_right) { > kfree(margin_left); > goto err; > } > /* Add the allocation to the used list */ > - used_node = kmalloc(sizeof(*used_node), GFP_KERNEL); > + used_node = kmalloc(sizeof(*used_node), GFP_ATOMIC); > if (!used_node) { > kfree(margin_right); > kfree(margin_left); > -- > 2.34.1 >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#13098): https://lists.yoctoproject.org/g/linux-yocto/message/13098 Mute This Topic: https://lists.yoctoproject.org/mt/101491802/21656 Group Owner: linux-yocto+ow...@lists.yoctoproject.org Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/leave/6687884/21656/624485779/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-