All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Leon Romanovsky <leonro@nvidia.com>
Cc: oe-kbuild-all@lists.linux.dev,
	"Kevin Tian" <kevin.tian@intel.com>,
	"Alex Williamson" <alex@shazbot.org>,
	"Christian König " <christian.koenig@amd.com>
Subject: [leon-rdma:dmabuf-revoke-v7 9/10] drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait'
Date: Sat, 31 Jan 2026 04:15:08 +0800	[thread overview]
Message-ID: <202601310416.b7okgiIP-lkp@intel.com> (raw)

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

             reply	other threads:[~2026-01-30 20:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 20:15 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-01-30 20:40 [leon-rdma:dmabuf-revoke-v7 9/10] drivers/vfio/pci/vfio_pci_dmabuf.c:344:31: warning: unused variable 'wait' kernel test robot

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=202601310416.b7okgiIP-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=alex@shazbot.org \
    --cc=christian.koenig@amd.com \
    --cc=kevin.tian@intel.com \
    --cc=leonro@nvidia.com \
    --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 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.