All of lore.kernel.org
 help / color / mirror / Atom feed
* [leon-rdma:dmabuf-revoke-v7 9/10] drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait'
@ 2026-01-30 20:15 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-01-30 20:15 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: oe-kbuild-all, Kevin Tian, Alex Williamson, Christian König 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git dmabuf-revoke-v7
head:   ec05a8f8037a95ae4080863e79f68dea0e6fbe0b
commit: 29f7617562d4dfd10f0487facde8c8d16a71f8f3 [9/10] vfio: Permit VFIO to work with pinned importers
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260131/202601310416.b7okgiIP-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260131/202601310416.b7okgiIP-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/202601310416.b7okgiIP-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/vfio/pci/vfio_pci_dmabuf.c: In function 'vfio_pci_dma_buf_move':
>> drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait' [-Wunused-variable]
     344 |                 unsigned long wait;
         |                               ^~~~
   drivers/vfio/pci/vfio_pci_dmabuf.c: In function 'vfio_pci_dma_buf_cleanup':
   drivers/vfio/pci/vfio_pci_dmabuf.c:390:31: warning: unused variable 'wait' [-Wunused-variable]
     390 |                 unsigned long wait;
         |                               ^~~~


vim +/wait +344 drivers/vfio/pci/vfio_pci_dmabuf.c

5d74781ebc86c5 Leon Romanovsky 2025-11-20  335  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  336  void vfio_pci_dma_buf_move(struct vfio_pci_core_device *vdev, bool revoked)
5d74781ebc86c5 Leon Romanovsky 2025-11-20  337  {
5d74781ebc86c5 Leon Romanovsky 2025-11-20  338  	struct vfio_pci_dma_buf *priv;
5d74781ebc86c5 Leon Romanovsky 2025-11-20  339  	struct vfio_pci_dma_buf *tmp;
5d74781ebc86c5 Leon Romanovsky 2025-11-20  340  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  341  	lockdep_assert_held_write(&vdev->memory_lock);
5d74781ebc86c5 Leon Romanovsky 2025-11-20  342  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  343  	list_for_each_entry_safe(priv, tmp, &vdev->dmabufs, dmabufs_elm) {
4592582c95df50 Leon Romanovsky 2026-01-19 @344  		unsigned long wait;
4592582c95df50 Leon Romanovsky 2026-01-19  345  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  346  		if (!get_file_active(&priv->dmabuf->file))
5d74781ebc86c5 Leon Romanovsky 2025-11-20  347  			continue;
5d74781ebc86c5 Leon Romanovsky 2025-11-20  348  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  349  		if (priv->revoked != revoked) {
5d74781ebc86c5 Leon Romanovsky 2025-11-20  350  			dma_resv_lock(priv->dmabuf->resv, NULL);
29f7617562d4df Leon Romanovsky 2026-01-14  351  			if (revoked)
29f7617562d4df Leon Romanovsky 2026-01-14  352  				priv->revoked = true;
fc81bff4b62ad8 Leon Romanovsky 2026-01-21  353  			dma_buf_invalidate_mappings(priv->dmabuf);
4592582c95df50 Leon Romanovsky 2026-01-19  354  			dma_resv_wait_timeout(priv->dmabuf->resv,
4592582c95df50 Leon Romanovsky 2026-01-19  355  					      DMA_RESV_USAGE_BOOKKEEP, false,
4592582c95df50 Leon Romanovsky 2026-01-19  356  					      MAX_SCHEDULE_TIMEOUT);
5d74781ebc86c5 Leon Romanovsky 2025-11-20  357  			dma_resv_unlock(priv->dmabuf->resv);
4592582c95df50 Leon Romanovsky 2026-01-19  358  			if (revoked) {
4592582c95df50 Leon Romanovsky 2026-01-19  359  				kref_put(&priv->kref, vfio_pci_dma_buf_done);
29f7617562d4df Leon Romanovsky 2026-01-14  360  				wait_for_completion(&priv->comp);
4592582c95df50 Leon Romanovsky 2026-01-19  361  			} else {
4592582c95df50 Leon Romanovsky 2026-01-19  362  				/*
4592582c95df50 Leon Romanovsky 2026-01-19  363  				 * Kref is initialize again, because when revoke
4592582c95df50 Leon Romanovsky 2026-01-19  364  				 * was performed the reference counter was decreased
4592582c95df50 Leon Romanovsky 2026-01-19  365  				 * to zero to trigger completion.
4592582c95df50 Leon Romanovsky 2026-01-19  366  				 */
4592582c95df50 Leon Romanovsky 2026-01-19  367  				kref_init(&priv->kref);
4592582c95df50 Leon Romanovsky 2026-01-19  368  				/*
4592582c95df50 Leon Romanovsky 2026-01-19  369  				 * There is no need to wait as no mapping was
4592582c95df50 Leon Romanovsky 2026-01-19  370  				 * performed when the previous status was
4592582c95df50 Leon Romanovsky 2026-01-19  371  				 * priv->revoked == true.
4592582c95df50 Leon Romanovsky 2026-01-19  372  				 */
4592582c95df50 Leon Romanovsky 2026-01-19  373  				reinit_completion(&priv->comp);
29f7617562d4df Leon Romanovsky 2026-01-14  374  				dma_resv_lock(priv->dmabuf->resv, NULL);
29f7617562d4df Leon Romanovsky 2026-01-14  375  				priv->revoked = false;
29f7617562d4df Leon Romanovsky 2026-01-14  376  				dma_resv_unlock(priv->dmabuf->resv);
4592582c95df50 Leon Romanovsky 2026-01-19  377  			}
5d74781ebc86c5 Leon Romanovsky 2025-11-20  378  		}
5d74781ebc86c5 Leon Romanovsky 2025-11-20  379  		fput(priv->dmabuf->file);
5d74781ebc86c5 Leon Romanovsky 2025-11-20  380  	}
5d74781ebc86c5 Leon Romanovsky 2025-11-20  381  }
5d74781ebc86c5 Leon Romanovsky 2025-11-20  382  

:::::: The code at line 344 was first introduced by commit
:::::: 4592582c95df50f1252f96a40d1fd8b16fb99d21 vfio: Wait for dma-buf invalidation to complete

:::::: TO: Leon Romanovsky <leonro@nvidia.com>
:::::: CC: Leon Romanovsky <leonro@nvidia.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [leon-rdma:dmabuf-revoke-v7 9/10] drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait'
@ 2026-01-30 20:40 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2026-01-30 20:40 UTC (permalink / raw)
  To: Leon Romanovsky
  Cc: oe-kbuild-all, Kevin Tian, Alex Williamson, Christian König 

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/leon/linux-rdma.git dmabuf-revoke-v7
head:   ec05a8f8037a95ae4080863e79f68dea0e6fbe0b
commit: 29f7617562d4dfd10f0487facde8c8d16a71f8f3 [9/10] vfio: Permit VFIO to work with pinned importers
config: x86_64-rhel-9.4 (https://download.01.org/0day-ci/archive/20260130/202601302136.uoBN7dfZ-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260130/202601302136.uoBN7dfZ-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/202601302136.uoBN7dfZ-lkp@intel.com/

All warnings (new ones prefixed by >>):

   drivers/vfio/pci/vfio_pci_dmabuf.c: In function 'vfio_pci_dma_buf_move':
>> drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait' [-Wunused-variable]
     344 |                 unsigned long wait;
         |                               ^~~~
   drivers/vfio/pci/vfio_pci_dmabuf.c: In function 'vfio_pci_dma_buf_cleanup':
   drivers/vfio/pci/vfio_pci_dmabuf.c:390:31: warning: unused variable 'wait' [-Wunused-variable]
     390 |                 unsigned long wait;
         |                               ^~~~


vim +/wait +344 drivers/vfio/pci/vfio_pci_dmabuf.c

5d74781ebc86c5 Leon Romanovsky 2025-11-20  335  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  336  void vfio_pci_dma_buf_move(struct vfio_pci_core_device *vdev, bool revoked)
5d74781ebc86c5 Leon Romanovsky 2025-11-20  337  {
5d74781ebc86c5 Leon Romanovsky 2025-11-20  338  	struct vfio_pci_dma_buf *priv;
5d74781ebc86c5 Leon Romanovsky 2025-11-20  339  	struct vfio_pci_dma_buf *tmp;
5d74781ebc86c5 Leon Romanovsky 2025-11-20  340  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  341  	lockdep_assert_held_write(&vdev->memory_lock);
5d74781ebc86c5 Leon Romanovsky 2025-11-20  342  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  343  	list_for_each_entry_safe(priv, tmp, &vdev->dmabufs, dmabufs_elm) {
4592582c95df50 Leon Romanovsky 2026-01-19 @344  		unsigned long wait;
4592582c95df50 Leon Romanovsky 2026-01-19  345  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  346  		if (!get_file_active(&priv->dmabuf->file))
5d74781ebc86c5 Leon Romanovsky 2025-11-20  347  			continue;
5d74781ebc86c5 Leon Romanovsky 2025-11-20  348  
5d74781ebc86c5 Leon Romanovsky 2025-11-20  349  		if (priv->revoked != revoked) {
5d74781ebc86c5 Leon Romanovsky 2025-11-20  350  			dma_resv_lock(priv->dmabuf->resv, NULL);
29f7617562d4df Leon Romanovsky 2026-01-14  351  			if (revoked)
29f7617562d4df Leon Romanovsky 2026-01-14  352  				priv->revoked = true;
fc81bff4b62ad8 Leon Romanovsky 2026-01-21  353  			dma_buf_invalidate_mappings(priv->dmabuf);
4592582c95df50 Leon Romanovsky 2026-01-19  354  			dma_resv_wait_timeout(priv->dmabuf->resv,
4592582c95df50 Leon Romanovsky 2026-01-19  355  					      DMA_RESV_USAGE_BOOKKEEP, false,
4592582c95df50 Leon Romanovsky 2026-01-19  356  					      MAX_SCHEDULE_TIMEOUT);
5d74781ebc86c5 Leon Romanovsky 2025-11-20  357  			dma_resv_unlock(priv->dmabuf->resv);
4592582c95df50 Leon Romanovsky 2026-01-19  358  			if (revoked) {
4592582c95df50 Leon Romanovsky 2026-01-19  359  				kref_put(&priv->kref, vfio_pci_dma_buf_done);
29f7617562d4df Leon Romanovsky 2026-01-14  360  				wait_for_completion(&priv->comp);
4592582c95df50 Leon Romanovsky 2026-01-19  361  			} else {
4592582c95df50 Leon Romanovsky 2026-01-19  362  				/*
4592582c95df50 Leon Romanovsky 2026-01-19  363  				 * Kref is initialize again, because when revoke
4592582c95df50 Leon Romanovsky 2026-01-19  364  				 * was performed the reference counter was decreased
4592582c95df50 Leon Romanovsky 2026-01-19  365  				 * to zero to trigger completion.
4592582c95df50 Leon Romanovsky 2026-01-19  366  				 */
4592582c95df50 Leon Romanovsky 2026-01-19  367  				kref_init(&priv->kref);
4592582c95df50 Leon Romanovsky 2026-01-19  368  				/*
4592582c95df50 Leon Romanovsky 2026-01-19  369  				 * There is no need to wait as no mapping was
4592582c95df50 Leon Romanovsky 2026-01-19  370  				 * performed when the previous status was
4592582c95df50 Leon Romanovsky 2026-01-19  371  				 * priv->revoked == true.
4592582c95df50 Leon Romanovsky 2026-01-19  372  				 */
4592582c95df50 Leon Romanovsky 2026-01-19  373  				reinit_completion(&priv->comp);
29f7617562d4df Leon Romanovsky 2026-01-14  374  				dma_resv_lock(priv->dmabuf->resv, NULL);
29f7617562d4df Leon Romanovsky 2026-01-14  375  				priv->revoked = false;
29f7617562d4df Leon Romanovsky 2026-01-14  376  				dma_resv_unlock(priv->dmabuf->resv);
4592582c95df50 Leon Romanovsky 2026-01-19  377  			}
5d74781ebc86c5 Leon Romanovsky 2025-11-20  378  		}
5d74781ebc86c5 Leon Romanovsky 2025-11-20  379  		fput(priv->dmabuf->file);
5d74781ebc86c5 Leon Romanovsky 2025-11-20  380  	}
5d74781ebc86c5 Leon Romanovsky 2025-11-20  381  }
5d74781ebc86c5 Leon Romanovsky 2025-11-20  382  

:::::: The code at line 344 was first introduced by commit
:::::: 4592582c95df50f1252f96a40d1fd8b16fb99d21 vfio: Wait for dma-buf invalidation to complete

:::::: TO: Leon Romanovsky <leonro@nvidia.com>
:::::: CC: Leon Romanovsky <leonro@nvidia.com>

-- 
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:[~2026-01-30 20:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-30 20:15 [leon-rdma:dmabuf-revoke-v7 9/10] drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-01-30 20:40 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.