From: kernel test robot <lkp@intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Leon Romanovsky <leon@kernel.org>
Subject: [linux-next:master 5820/7584] drivers/infiniband/hw/mlx5/mr.c:928:8: error: passing 'const struct dma_buf_attach_ops *' to parameter of type 'struct dma_buf_attach_ops *' discards qualifiers
Date: Sat, 18 Jul 2026 20:28:32 +0800 [thread overview]
Message-ID: <202607181922.3eQD54gC-lkp@intel.com> (raw)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 0718283ab28bc3907e10b61a6b4be6fefa1cbb2f
commit: dcae56cfecc6e17c9aa4e6bb6057d18efadf2132 [5820/7584] RDMA/mlx5: Constify struct ib_frmr_pool_ops and dma_buf_attach_ops
config: i386-randconfig-007-20260718 (https://download.01.org/0day-ci/archive/20260718/202607181922.3eQD54gC-lkp@intel.com/config)
compiler: clang version 22.1.3 (https://github.com/llvm/llvm-project e9846648fd6183ee6d8cbdb4502213fcf902a211)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260718/202607181922.3eQD54gC-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607181922.3eQD54gC-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/infiniband/hw/mlx5/mr.c:928:8: error: passing 'const struct dma_buf_attach_ops *' to parameter of type 'struct dma_buf_attach_ops *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
928 | &mlx5_ib_dmabuf_attach_ops);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
include/rdma/ib_umem.h:253:35: note: passing argument to parameter 'ops' here
253 | struct dma_buf_attach_ops *ops)
| ^
1 error generated.
vim +928 drivers/infiniband/hw/mlx5/mr.c
90da7dc8206a599 Jianxin Xiong 2020-12-15 905
de8f847a5114ff7 Yishai Hadas 2024-08-01 906 static struct ib_mr *
de8f847a5114ff7 Yishai Hadas 2024-08-01 907 reg_user_mr_dmabuf(struct ib_pd *pd, struct device *dma_device,
de8f847a5114ff7 Yishai Hadas 2024-08-01 908 u64 offset, u64 length, u64 virt_addr,
e1bed9a94da86a7 Yishai Hadas 2025-07-17 909 int fd, int access_flags, int access_mode,
e1bed9a94da86a7 Yishai Hadas 2025-07-17 910 struct ib_dmah *dmah)
90da7dc8206a599 Jianxin Xiong 2020-12-15 911 {
de8f847a5114ff7 Yishai Hadas 2024-08-01 912 bool pinned_mode = (access_mode == MLX5_MKC_ACCESS_MODE_KSM);
90da7dc8206a599 Jianxin Xiong 2020-12-15 913 struct mlx5_ib_dev *dev = to_mdev(pd->device);
90da7dc8206a599 Jianxin Xiong 2020-12-15 914 struct mlx5_ib_mr *mr = NULL;
90da7dc8206a599 Jianxin Xiong 2020-12-15 915 struct ib_umem_dmabuf *umem_dmabuf;
e1bed9a94da86a7 Yishai Hadas 2025-07-17 916 u16 st_index = MLX5_MKC_PCIE_TPH_NO_STEERING_TAG_INDEX;
e1bed9a94da86a7 Yishai Hadas 2025-07-17 917 u8 ph = MLX5_IB_NO_PH;
90da7dc8206a599 Jianxin Xiong 2020-12-15 918 int err;
90da7dc8206a599 Jianxin Xiong 2020-12-15 919
638420115cc4ad6 Jianbo Liu 2024-06-03 920 err = mlx5r_umr_resource_init(dev);
638420115cc4ad6 Jianbo Liu 2024-06-03 921 if (err)
638420115cc4ad6 Jianbo Liu 2024-06-03 922 return ERR_PTR(err);
638420115cc4ad6 Jianbo Liu 2024-06-03 923
de8f847a5114ff7 Yishai Hadas 2024-08-01 924 if (!pinned_mode)
de8f847a5114ff7 Yishai Hadas 2024-08-01 925 umem_dmabuf = ib_umem_dmabuf_get(&dev->ib_dev,
de8f847a5114ff7 Yishai Hadas 2024-08-01 926 offset, length, fd,
90da7dc8206a599 Jianxin Xiong 2020-12-15 927 access_flags,
90da7dc8206a599 Jianxin Xiong 2020-12-15 @928 &mlx5_ib_dmabuf_attach_ops);
522a5c1c56fbf71 Leon Romanovsky 2026-01-04 929 else if (dma_device)
de8f847a5114ff7 Yishai Hadas 2024-08-01 930 umem_dmabuf = ib_umem_dmabuf_get_pinned_with_dma_device(&dev->ib_dev,
de8f847a5114ff7 Yishai Hadas 2024-08-01 931 dma_device, offset, length,
de8f847a5114ff7 Yishai Hadas 2024-08-01 932 fd, access_flags);
522a5c1c56fbf71 Leon Romanovsky 2026-01-04 933 else
522a5c1c56fbf71 Leon Romanovsky 2026-01-04 934 umem_dmabuf = ib_umem_dmabuf_get_pinned(
522a5c1c56fbf71 Leon Romanovsky 2026-01-04 935 &dev->ib_dev, offset, length, fd, access_flags);
de8f847a5114ff7 Yishai Hadas 2024-08-01 936
90da7dc8206a599 Jianxin Xiong 2020-12-15 937 if (IS_ERR(umem_dmabuf)) {
4b6b6233f50f723 Leon Romanovsky 2025-09-18 938 mlx5_ib_dbg(dev, "umem_dmabuf get failed (%pe)\n", umem_dmabuf);
90da7dc8206a599 Jianxin Xiong 2020-12-15 939 return ERR_CAST(umem_dmabuf);
90da7dc8206a599 Jianxin Xiong 2020-12-15 940 }
90da7dc8206a599 Jianxin Xiong 2020-12-15 941
e1bed9a94da86a7 Yishai Hadas 2025-07-17 942 if (dmah) {
e1bed9a94da86a7 Yishai Hadas 2025-07-17 943 struct mlx5_ib_dmah *mdmah = to_mdmah(dmah);
e1bed9a94da86a7 Yishai Hadas 2025-07-17 944
e1bed9a94da86a7 Yishai Hadas 2025-07-17 945 ph = dmah->ph;
e1bed9a94da86a7 Yishai Hadas 2025-07-17 946 if (dmah->valid_fields & BIT(IB_DMAH_CPU_ID_EXISTS))
e1bed9a94da86a7 Yishai Hadas 2025-07-17 947 st_index = mdmah->st_index;
e1bed9a94da86a7 Yishai Hadas 2025-07-17 948 }
e1bed9a94da86a7 Yishai Hadas 2025-07-17 949
90da7dc8206a599 Jianxin Xiong 2020-12-15 950 mr = alloc_cacheable_mr(pd, &umem_dmabuf->umem, virt_addr,
e1bed9a94da86a7 Yishai Hadas 2025-07-17 951 access_flags, access_mode,
e1bed9a94da86a7 Yishai Hadas 2025-07-17 952 st_index, ph);
90da7dc8206a599 Jianxin Xiong 2020-12-15 953 if (IS_ERR(mr)) {
90da7dc8206a599 Jianxin Xiong 2020-12-15 954 ib_umem_release(&umem_dmabuf->umem);
90da7dc8206a599 Jianxin Xiong 2020-12-15 955 return ERR_CAST(mr);
90da7dc8206a599 Jianxin Xiong 2020-12-15 956 }
90da7dc8206a599 Jianxin Xiong 2020-12-15 957
90da7dc8206a599 Jianxin Xiong 2020-12-15 958 mlx5_ib_dbg(dev, "mkey 0x%x\n", mr->mmkey.key);
90da7dc8206a599 Jianxin Xiong 2020-12-15 959
90da7dc8206a599 Jianxin Xiong 2020-12-15 960 atomic_add(ib_umem_num_pages(mr->umem), &dev->mdev->priv.reg_pages);
90da7dc8206a599 Jianxin Xiong 2020-12-15 961 umem_dmabuf->private = mr;
de8f847a5114ff7 Yishai Hadas 2024-08-01 962 if (!pinned_mode) {
93e64c7a33ff667 Jason Gunthorpe 2026-06-03 963 err = mlx5r_odp_create_eq(dev, &dev->odp_pf_eq);
93e64c7a33ff667 Jason Gunthorpe 2026-06-03 964 if (err)
93e64c7a33ff667 Jason Gunthorpe 2026-06-03 965 goto err_dereg_mr;
93e64c7a33ff667 Jason Gunthorpe 2026-06-03 966
db72438c9319cfd Yishai Hadas 2021-02-02 967 err = mlx5r_store_odp_mkey(dev, &mr->mmkey);
90da7dc8206a599 Jianxin Xiong 2020-12-15 968 if (err)
90da7dc8206a599 Jianxin Xiong 2020-12-15 969 goto err_dereg_mr;
de8f847a5114ff7 Yishai Hadas 2024-08-01 970 } else {
de8f847a5114ff7 Yishai Hadas 2024-08-01 971 mr->data_direct = true;
de8f847a5114ff7 Yishai Hadas 2024-08-01 972 }
90da7dc8206a599 Jianxin Xiong 2020-12-15 973
c9bf47d2051ad7e Jason Gunthorpe 2026-06-03 974 err = mlx5_ib_init_dmabuf_mr(mr, pd);
90da7dc8206a599 Jianxin Xiong 2020-12-15 975 if (err)
90da7dc8206a599 Jianxin Xiong 2020-12-15 976 goto err_dereg_mr;
90da7dc8206a599 Jianxin Xiong 2020-12-15 977 return &mr->ibmr;
90da7dc8206a599 Jianxin Xiong 2020-12-15 978
90da7dc8206a599 Jianxin Xiong 2020-12-15 979 err_dereg_mr:
de8f847a5114ff7 Yishai Hadas 2024-08-01 980 __mlx5_ib_dereg_mr(&mr->ibmr);
de8f847a5114ff7 Yishai Hadas 2024-08-01 981 return ERR_PTR(err);
de8f847a5114ff7 Yishai Hadas 2024-08-01 982 }
de8f847a5114ff7 Yishai Hadas 2024-08-01 983
:::::: The code at line 928 was first introduced by commit
:::::: 90da7dc8206a5999a23af719733f1cda26b5f815 RDMA/mlx5: Support dma-buf based userspace memory region
:::::: TO: Jianxin Xiong <jianxin.xiong@intel.com>
:::::: CC: Jason Gunthorpe <jgg@nvidia.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
reply other threads:[~2026-07-18 12:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202607181922.3eQD54gC-lkp@intel.com \
--to=lkp@intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=leon@kernel.org \
--cc=llvm@lists.linux.dev \
--cc=oe-kbuild-all@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox