Re: [EXT] [bug report] octeontx2-pf: Fix lmtst ID used in aura free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



________________________________________
>From: Dan Carpenter <error27@xxxxxxxxx>
>Sent: Friday, January 6, 2023 8:10 PM
>To: Geethasowjanya Akula
>Cc: kernel-janitors@xxxxxxxxxxxxxxx
>Subject: [EXT] [bug report] octeontx2-pf: Fix lmtst ID used in >aura free

>External Email

----------------------------------------------------------------------
>Hello Geetha sowjanya,

>The patch 4af1b64f80fb: "octeontx2-pf: Fix lmtst ID used in aura
>free" from Jan 3, 2023, leads to the following Smatch static >checker
>warning:

Thanks, Dan for reporting. Will submit the patch.
        >drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c:138>1 otx2_sq_aura_pool_init()
        warn: sleeping in atomic context

>drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
>   1368         /* Flush accumulated messages */
>  1369         err = otx2_sync_mbox_msg(&pfvf->mbox);
>    1370         if (err)
>    1371                 goto fail;
>    1372
>   1373         get_cpu();
                 ^^^^^^^^^
>This new get_cpu() disables preemption.


>    1374         /* Allocate pointers and free them to aura/pool */
>   1375         for (qidx = 0; qidx < hw->tot_tx_queues; qidx++) {
>   1376                 pool_id = otx2_get_pool_idx(pfvf, AURA_NIX_SQ, qidx);
>    1377                 pool = &pfvf->qset.pool[pool_id];
>    1378
>    1379                 sq = &qset->sq[qidx];
>    1380                 sq->sqb_count = 0;
>--> 1381                 sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(*sq->sqb_ptrs), GFP_KERNEL);
                                                                                 >^^^^^^^^^^
>Change this to GFP_ATOMIC?
>
>    1382                 if (!sq->sqb_ptrs) {
>    1383                         err = -ENOMEM;
>    1384                         goto err_mem;
>    1385                 }
>    1386
>    1387                 for (ptr = 0; ptr < num_sqbs; ptr++) {
>    1388                         err = otx2_alloc_rbuf(pfvf, pool, &bufptr);
>    1389                         if (err)
>    1390                                 goto err_mem;
>    1391                         pfvf->hw_ops->aura_freeptr(pfvf, pool_id, bufptr);
>    1392                         sq->sqb_ptrs[sq->sqb_count++] = (u64)bufptr;
 >   1393                 }
 >   1394         }
 >  1395
 >   1396 err_mem:
 >   1397         put_cpu();
 >   1398         return err ? -ENOMEM : 0;
 >   1399
 >   1400 fail:
 >   1401         otx2_mbox_reset(&pfvf->mbox.mbox, 0);
 >   1402         otx2_aura_pool_free(pfvf);
  >  1403         return err;
  >  1404 }

>regards,
>dan carpenter

Thanks,
Geetha.



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux