* [linux-next:master 478/5236] drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2024-12-31 4:56 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2024-12-31 4:56 UTC (permalink / raw)
To: Lizhi Hou; +Cc: oe-kbuild-all, Jeffrey Hugo, Min Ma
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
commit: be462c97b7dfd24999babe39cce3de224ebe1f80 [478/5236] accel/amdxdna: Add hardware context
config: x86_64-randconfig-122-20241231 (https://download.01.org/0day-ci/archive/20241231/202412311210.LfeHTzLw-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241231/202412311210.LfeHTzLw-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/202412311210.LfeHTzLw-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct pid *pid @@ got struct pid [noderef] __rcu *pid @@
drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: expected struct pid *pid
drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: got struct pid [noderef] __rcu *pid
vim +49 drivers/accel/amdxdna/amdxdna_pci_drv.c
38
39 static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp)
40 {
41 struct amdxdna_dev *xdna = to_xdna_dev(ddev);
42 struct amdxdna_client *client;
43 int ret;
44
45 client = kzalloc(sizeof(*client), GFP_KERNEL);
46 if (!client)
47 return -ENOMEM;
48
> 49 client->pid = pid_nr(filp->pid);
50 client->xdna = xdna;
51
52 client->sva = iommu_sva_bind_device(xdna->ddev.dev, current->mm);
53 if (IS_ERR(client->sva)) {
54 ret = PTR_ERR(client->sva);
55 XDNA_ERR(xdna, "SVA bind device failed, ret %d", ret);
56 goto failed;
57 }
58 client->pasid = iommu_sva_get_pasid(client->sva);
59 if (client->pasid == IOMMU_PASID_INVALID) {
60 XDNA_ERR(xdna, "SVA get pasid failed");
61 ret = -ENODEV;
62 goto unbind_sva;
63 }
64 mutex_init(&client->hwctx_lock);
65 idr_init_base(&client->hwctx_idr, AMDXDNA_INVALID_CTX_HANDLE + 1);
66
67 mutex_lock(&xdna->dev_lock);
68 list_add_tail(&client->node, &xdna->client_list);
69 mutex_unlock(&xdna->dev_lock);
70
71 filp->driver_priv = client;
72 client->filp = filp;
73
74 XDNA_DBG(xdna, "pid %d opened", client->pid);
75 return 0;
76
77 unbind_sva:
78 iommu_sva_unbind_device(client->sva);
79 failed:
80 kfree(client);
81
82 return ret;
83 }
84
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* [linux-next:master 478/5236] drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: sparse: incorrect type in argument 1 (different address spaces)
@ 2025-01-03 12:46 kernel test robot
0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-01-03 12:46 UTC (permalink / raw)
To: Lizhi Hou; +Cc: oe-kbuild-all, Jeffrey Hugo, Min Ma
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
commit: be462c97b7dfd24999babe39cce3de224ebe1f80 [478/5236] accel/amdxdna: Add hardware context
config: x86_64-randconfig-122-20241231 (https://download.01.org/0day-ci/archive/20250103/202501032039.mkcV1HGd-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250103/202501032039.mkcV1HGd-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/202501032039.mkcV1HGd-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected struct pid *pid @@ got struct pid [noderef] __rcu *pid @@
drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: expected struct pid *pid
drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: got struct pid [noderef] __rcu *pid
vim +49 drivers/accel/amdxdna/amdxdna_pci_drv.c
38
39 static int amdxdna_drm_open(struct drm_device *ddev, struct drm_file *filp)
40 {
41 struct amdxdna_dev *xdna = to_xdna_dev(ddev);
42 struct amdxdna_client *client;
43 int ret;
44
45 client = kzalloc(sizeof(*client), GFP_KERNEL);
46 if (!client)
47 return -ENOMEM;
48
> 49 client->pid = pid_nr(filp->pid);
50 client->xdna = xdna;
51
52 client->sva = iommu_sva_bind_device(xdna->ddev.dev, current->mm);
53 if (IS_ERR(client->sva)) {
54 ret = PTR_ERR(client->sva);
55 XDNA_ERR(xdna, "SVA bind device failed, ret %d", ret);
56 goto failed;
57 }
58 client->pasid = iommu_sva_get_pasid(client->sva);
59 if (client->pasid == IOMMU_PASID_INVALID) {
60 XDNA_ERR(xdna, "SVA get pasid failed");
61 ret = -ENODEV;
62 goto unbind_sva;
63 }
64 mutex_init(&client->hwctx_lock);
65 idr_init_base(&client->hwctx_idr, AMDXDNA_INVALID_CTX_HANDLE + 1);
66
67 mutex_lock(&xdna->dev_lock);
68 list_add_tail(&client->node, &xdna->client_list);
69 mutex_unlock(&xdna->dev_lock);
70
71 filp->driver_priv = client;
72 client->filp = filp;
73
74 XDNA_DBG(xdna, "pid %d opened", client->pid);
75 return 0;
76
77 unbind_sva:
78 iommu_sva_unbind_device(client->sva);
79 failed:
80 kfree(client);
81
82 return ret;
83 }
84
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-03 12:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-31 4:56 [linux-next:master 478/5236] drivers/accel/amdxdna/amdxdna_pci_drv.c:49:34: sparse: sparse: incorrect type in argument 1 (different address spaces) kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-01-03 12:46 kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.