tree:
https://github.com/jgunthorpe/linux for-yishai
head: f2e248975954bcc9b76fc51c917a950d2757f930
commit: 5ba994930f2ac492c86cfd9ef9da78c0fcb34809 [17/22] RDMA/mlx5: Move
mlx5_ib_cont_pages() to the creation of the mlx5_ib_mr
config: x86_64-randconfig-a006-20200818 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
4deda57106f7c9b982a49cb907c33e3966c8de7f)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git checkout 5ba994930f2ac492c86cfd9ef9da78c0fcb34809
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
> drivers/infiniband/hw/mlx5/mr.c:1521:7: warning: variable
'err' is used uninitialized whenever 'if' condition is true
[-Wsometimes-uninitialized]
if (IS_ERR(mr->umem)) {
^~~~~~~~~~~~~~~~
drivers/infiniband/hw/mlx5/mr.c:1581:9: note: uninitialized use occurs here
return err;
^~~
drivers/infiniband/hw/mlx5/mr.c:1521:3: note: remove the 'if' if its condition
is always false
if (IS_ERR(mr->umem)) {
^~~~~~~~~~~~~~~~~~~~~~~
drivers/infiniband/hw/mlx5/mr.c:1492:9: note: initialize the variable 'err' to
silence this warning
int err;
^
= 0
1 warning generated.
#
https://github.com/jgunthorpe/linux/commit/5ba994930f2ac492c86cfd9ef9da78...
git remote add jgunthorpe
https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe for-yishai
git checkout 5ba994930f2ac492c86cfd9ef9da78c0fcb34809
vim +1521 drivers/infiniband/hw/mlx5/mr.c
1479
1480 int mlx5_ib_rereg_user_mr(struct ib_mr *ib_mr, int flags, u64 start,
1481 u64 length, u64 virt_addr, int new_access_flags,
1482 struct ib_pd *new_pd, struct ib_udata *udata)
1483 {
1484 struct mlx5_ib_dev *dev = to_mdev(ib_mr->device);
1485 struct mlx5_ib_mr *mr = to_mmr(ib_mr);
1486 struct ib_pd *pd = (flags & IB_MR_REREG_PD) ? new_pd : ib_mr->pd;
1487 int access_flags = flags & IB_MR_REREG_ACCESS ?
1488 new_access_flags :
1489 mr->access_flags;
1490 int upd_flags = 0;
1491 u64 addr, len;
1492 int err;
1493
1494 mlx5_ib_dbg(dev, "start 0x%llx, virt_addr 0x%llx, length 0x%llx, access_flags
0x%x\n",
1495 start, virt_addr, length, access_flags);
1496
1497 if (!mr->umem)
1498 return -EINVAL;
1499
1500 if (is_odp_mr(mr))
1501 return -EOPNOTSUPP;
1502
1503 if (flags & IB_MR_REREG_TRANS) {
1504 addr = virt_addr;
1505 len = length;
1506 } else {
1507 addr = mr->umem->address;
1508 len = mr->umem->length;
1509 }
1510
1511 if (flags != IB_MR_REREG_PD) {
1512 /*
1513 * Replace umem. This needs to be done whether or not UMR is
1514 * used.
1515 */
1516 flags |= IB_MR_REREG_TRANS;
1517 atomic_sub(ib_umem_num_pages(mr->umem),
1518 &dev->mdev->priv.reg_pages);
1519 ib_umem_release(mr->umem);
1520 mr->umem = mr_umem_get(dev, addr, len, access_flags);
1521 if (IS_ERR(mr->umem)) {
1522 mr->umem =
NULL;
1523 goto err;
1524 }
1525 atomic_add(ib_umem_num_pages(mr->umem),
1526 &dev->mdev->priv.reg_pages);
1527 }
1528
1529 if (!mlx5_ib_can_use_umr(dev, mr->umem->length, true, access_flags) ||
1530 (flags & IB_MR_REREG_TRANS && !use_umr_mtt_update(mr, addr, len)))
{
1531 /*
1532 * UMR can't be used - MKey needs to be replaced.
1533 */
1534 if (mr->cache_ent)
1535 detach_mr_from_cache(mr);
1536 err = destroy_mkey(dev, mr);
1537 if (err)
1538 goto err;
1539
1540 mr = reg_create(ib_mr, pd, mr->umem, addr, access_flags, true);
1541 if (IS_ERR(mr)) {
1542 err = PTR_ERR(mr);
1543 mr = to_mmr(ib_mr);
1544 goto err;
1545 }
1546 } else {
1547 /*
1548 * Send a UMR WQE
1549 */
1550 mr->ibmr.pd = pd;
1551 mr->access_flags = access_flags;
1552 mr->mmkey.iova = addr;
1553 mr->mmkey.size = len;
1554 mr->mmkey.pd = to_mpd(pd)->pdn;
1555
1556 if (flags & IB_MR_REREG_TRANS) {
1557 upd_flags = MLX5_IB_UPD_XLT_ADDR;
1558 if (flags & IB_MR_REREG_PD)
1559 upd_flags |= MLX5_IB_UPD_XLT_PD;
1560 if (flags & IB_MR_REREG_ACCESS)
1561 upd_flags |= MLX5_IB_UPD_XLT_ACCESS;
1562 err = mlx5_ib_update_xlt(mr, 0, mlx5_mr_num_pages(mr),
1563 mr->page_shift, upd_flags);
1564 } else {
1565 err = rereg_umr(pd, mr, access_flags, flags);
1566 }
1567
1568 if (err)
1569 goto err;
1570 }
1571
1572 set_mr_fields(dev, mr, len, access_flags);
1573
1574 return 0;
1575
1576 err:
1577 ib_umem_release(mr->umem);
1578 mr->umem = NULL;
1579
1580 clean_mr(dev, mr);
1581 return err;
1582 }
1583
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org