Re: [PATCH v6 5/5] PCI: Suspend iommu function prior to resetting a device

kernel test robot
2025-11-19T03:03:54Z

Hi Nicolin,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20251118]
[cannot apply to pci/next pci/for-linus awilliam-vfio/next awilliam-vfio/for-linus rafael-pm/linux-next rafael-pm/bleeding-edge linus/master v6.18-rc6 v6.18-rc5 v6.18-rc4 v6.18-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Nicolin-Chen/iommu-Lock-group-mutex-in-iommu_deferred_attach/20251119-085721
base: next-20251118
patch link: https://lore.kernel.org/r/9f6caaedc278fe057aacb813d94f44a93d8cab3c.1763512374.git.nicolinc%40nvidia.com
patch subject: [PATCH v6 5/5] PCI: Suspend iommu function prior to resetting a device
config: alpha-allnoconfig (https://download.01.org/0day-ci/archive/20251119/202511191219.qIkZ1n2P-lkp@intel.com/config)
compiler: alpha-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251119/202511191219.qIkZ1n2P-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/202511191219.qIkZ1n2P-lkp@intel.com/

All errors (new ones prefixed by >>):

drivers/pci/pci.c: In function 'pcie_flr':
>> drivers/pci/pci.c:4341:43: error: passing argument 1 of 'pci_dev_reset_iommu_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
4341 | ret = pci_dev_reset_iommu_prepare(dev);
| ^~~
| |
| struct pci_dev *
In file included from drivers/pci/pci.c:16:
include/linux/iommu.h:1519:62: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1519 | static inline int pci_dev_reset_iommu_prepare(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
>> drivers/pci/pci.c:4361:34: error: passing argument 1 of 'pci_dev_reset_iommu_done' from incompatible pointer type [-Wincompatible-pointer-types]
4361 | pci_dev_reset_iommu_done(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1524:60: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1524 | static inline void pci_dev_reset_iommu_done(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c: In function 'pci_af_flr':
drivers/pci/pci.c:4418:43: error: passing argument 1 of 'pci_dev_reset_iommu_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
4418 | ret = pci_dev_reset_iommu_prepare(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1519:62: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1519 | static inline int pci_dev_reset_iommu_prepare(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c:4439:34: error: passing argument 1 of 'pci_dev_reset_iommu_done' from incompatible pointer type [-Wincompatible-pointer-types]
4439 | pci_dev_reset_iommu_done(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1524:60: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1524 | static inline void pci_dev_reset_iommu_done(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c: In function 'pci_pm_reset':
drivers/pci/pci.c:4476:43: error: passing argument 1 of 'pci_dev_reset_iommu_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
4476 | ret = pci_dev_reset_iommu_prepare(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1519:62: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1519 | static inline int pci_dev_reset_iommu_prepare(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c:4493:34: error: passing argument 1 of 'pci_dev_reset_iommu_done' from incompatible pointer type [-Wincompatible-pointer-types]
4493 | pci_dev_reset_iommu_done(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1524:60: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1524 | static inline void pci_dev_reset_iommu_done(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c: In function 'pci_reset_bus_function':
drivers/pci/pci.c:4922:42: error: passing argument 1 of 'pci_dev_reset_iommu_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
4922 | rc = pci_dev_reset_iommu_prepare(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1519:62: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1519 | static inline int pci_dev_reset_iommu_prepare(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c:4934:34: error: passing argument 1 of 'pci_dev_reset_iommu_done' from incompatible pointer type [-Wincompatible-pointer-types]
4934 | pci_dev_reset_iommu_done(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1524:60: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1524 | static inline void pci_dev_reset_iommu_done(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c: In function 'cxl_reset_bus_function':
drivers/pci/pci.c:4959:42: error: passing argument 1 of 'pci_dev_reset_iommu_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
4959 | rc = pci_dev_reset_iommu_prepare(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1519:62: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1519 | static inline int pci_dev_reset_iommu_prepare(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
drivers/pci/pci.c:4979:34: error: passing argument 1 of 'pci_dev_reset_iommu_done' from incompatible pointer type [-Wincompatible-pointer-types]
4979 | pci_dev_reset_iommu_done(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1524:60: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1524 | static inline void pci_dev_reset_iommu_done(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
--
drivers/pci/quirks.c: In function '__pci_dev_specific_reset':
>> drivers/pci/quirks.c:4237:43: error: passing argument 1 of 'pci_dev_reset_iommu_prepare' from incompatible pointer type [-Wincompatible-pointer-types]
4237 | ret = pci_dev_reset_iommu_prepare(dev);
| ^~~
| |
| struct pci_dev *
In file included from drivers/pci/quirks.c:24:
include/linux/iommu.h:1519:62: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1519 | static inline int pci_dev_reset_iommu_prepare(struct device *dev)
| ~~~~~~~~~~~~~~~^~~
>> drivers/pci/quirks.c:4244:34: error: passing argument 1 of 'pci_dev_reset_iommu_done' from incompatible pointer type [-Wincompatible-pointer-types]
4244 | pci_dev_reset_iommu_done(dev);
| ^~~
| |
| struct pci_dev *
include/linux/iommu.h:1524:60: note: expected 'struct device *' but argument is of type 'struct pci_dev *'
1524 | static inline void pci_dev_reset_iommu_done(struct device *dev)
| ~~~~~~~~~~~~~~~^~~

vim +/pci_dev_reset_iommu_prepare +4341 drivers/pci/pci.c

4325
4326 /**
4327 * pcie_flr - initiate a PCIe function level reset
4328 * @dev: device to reset
4329 *
4330 * Initiate a function level reset unconditionally on @dev without
4331 * checking any flags and DEVCAP
4332 */
4333 int pcie_flr(struct pci_dev *dev)
4334 {
4335 int ret;
4336
4337 if (!pci_wait_for_pending_transaction(dev))
4338 pci_err(dev, "timed out waiting for pending transaction; performing function level reset anyway\n");
4339
4340 /* Have to call it after waiting for pending DMA transaction */
> 4341 ret = pci_dev_reset_iommu_prepare(dev);
4342 if (ret) {
4343 pci_err(dev, "failed to stop IOMMU for a PCI reset: %d\n", ret);
4344 return ret;
4345 }
4346
4347 pcie_capability_set_word(dev, PCI_EXP_DEVCTL, PCI_EXP_DEVCTL_BCR_FLR);
4348
4349 if (dev->imm_ready)
4350 goto done;
4351
4352 /*
4353 * Per PCIe r4.0, sec 6.6.2, a device must complete an FLR within
4354 * 100ms, but may silently discard requests while the FLR is in
4355 * progress. Wait 100ms before trying to access the device.
4356 */
4357 msleep(100);
4358
4359 ret = pci_dev_wait(dev, "FLR", PCIE_RESET_READY_POLL_MS);
4360 done:
> 4361 pci_dev_reset_iommu_done(dev);
4362 return ret;
4363 }
4364 EXPORT_SYMBOL_GPL(pcie_flr);
4365

--
0-DAY CI Kernel Test Service