vfio/pci: Add driver_managed_dma to the new vfio_pci drivers
authorJason Gunthorpe <jgg@nvidia.com>
Thu, 19 May 2022 23:14:01 +0000 (20:14 -0300)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 23 May 2022 16:46:34 +0000 (10:46 -0600)
When the iommu series adding driver_managed_dma was rebased it missed that
new VFIO drivers were added and did not update them too.

Without this vfio will claim the groups are not viable.

Add driver_managed_dma to mlx5 and hisi.

Fixes: 70693f470848 ("vfio: Set DMA ownership for VFIO devices")
Reported-by: Yishai Hadas <yishaih@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/0-v1-f9dfa642fab0+2b3-vfio_managed_dma_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
drivers/vfio/pci/mlx5/main.c

index e92376837b29e606edf6bfe43b21c70f576f94ae..4def43f5f7b619d9b5dbd8d0a3495b95782ca10c 100644 (file)
@@ -1323,6 +1323,7 @@ static struct pci_driver hisi_acc_vfio_pci_driver = {
        .probe = hisi_acc_vfio_pci_probe,
        .remove = hisi_acc_vfio_pci_remove,
        .err_handler = &hisi_acc_vf_err_handlers,
+       .driver_managed_dma = true,
 };
 
 module_pci_driver(hisi_acc_vfio_pci_driver);
index dd1009b5ff9c825ff74a4849abfe218123c13f7f..0558d0649ddb8c36d7039d73d04282e9fa7f52ca 100644 (file)
@@ -641,6 +641,7 @@ static struct pci_driver mlx5vf_pci_driver = {
        .probe = mlx5vf_pci_probe,
        .remove = mlx5vf_pci_remove,
        .err_handler = &mlx5vf_err_handlers,
+       .driver_managed_dma = true,
 };
 
 static void __exit mlx5vf_pci_cleanup(void)