Skip to content

Commit 853b01b

Browse files
LuBaolujoergroedel
authored andcommitted
dmaengine: idxd: Remove unnecessary IOMMU_DEV_FEAT_IOPF
The IOMMU_DEV_FEAT_IOPF implementation in the iommu driver is just a no-op. It will also be removed from the iommu driver in the subsequent patch. Remove it to avoid dead code. Signed-off-by: Lu Baolu <[email protected]> Acked-by: Vinod Koul <[email protected]> Reviewed-by: Dave Jiang <[email protected]> Reviewed-by: Fenghua Yu <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Reviewed-by: Yi Liu <[email protected]> Tested-by: Zhangfei Gao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent c2fa4d4 commit 853b01b

File tree

1 file changed

+6
-31
lines changed

1 file changed

+6
-31
lines changed

drivers/dma/idxd/init.c

Lines changed: 6 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -626,21 +626,6 @@ static void idxd_disable_system_pasid(struct idxd_device *idxd)
626626
idxd->pasid = IOMMU_PASID_INVALID;
627627
}
628628

629-
static int idxd_enable_sva(struct pci_dev *pdev)
630-
{
631-
int ret;
632-
633-
ret = iommu_dev_enable_feature(&pdev->dev, IOMMU_DEV_FEAT_IOPF);
634-
if (ret)
635-
return ret;
636-
return 0;
637-
}
638-
639-
static void idxd_disable_sva(struct pci_dev *pdev)
640-
{
641-
iommu_dev_disable_feature(&pdev->dev, IOMMU_DEV_FEAT_IOPF);
642-
}
643-
644629
static int idxd_probe(struct idxd_device *idxd)
645630
{
646631
struct pci_dev *pdev = idxd->pdev;
@@ -655,17 +640,13 @@ static int idxd_probe(struct idxd_device *idxd)
655640
dev_dbg(dev, "IDXD reset complete\n");
656641

657642
if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM) && sva) {
658-
if (idxd_enable_sva(pdev)) {
659-
dev_warn(dev, "Unable to turn on user SVA feature.\n");
660-
} else {
661-
set_bit(IDXD_FLAG_USER_PASID_ENABLED, &idxd->flags);
643+
set_bit(IDXD_FLAG_USER_PASID_ENABLED, &idxd->flags);
662644

663-
rc = idxd_enable_system_pasid(idxd);
664-
if (rc)
665-
dev_warn(dev, "No in-kernel DMA with PASID. %d\n", rc);
666-
else
667-
set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
668-
}
645+
rc = idxd_enable_system_pasid(idxd);
646+
if (rc)
647+
dev_warn(dev, "No in-kernel DMA with PASID. %d\n", rc);
648+
else
649+
set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
669650
} else if (!sva) {
670651
dev_warn(dev, "User forced SVA off via module param.\n");
671652
}
@@ -703,8 +684,6 @@ static int idxd_probe(struct idxd_device *idxd)
703684
err:
704685
if (device_pasid_enabled(idxd))
705686
idxd_disable_system_pasid(idxd);
706-
if (device_user_pasid_enabled(idxd))
707-
idxd_disable_sva(pdev);
708687
return rc;
709688
}
710689

@@ -715,8 +694,6 @@ static void idxd_cleanup(struct idxd_device *idxd)
715694
idxd_cleanup_internals(idxd);
716695
if (device_pasid_enabled(idxd))
717696
idxd_disable_system_pasid(idxd);
718-
if (device_user_pasid_enabled(idxd))
719-
idxd_disable_sva(idxd->pdev);
720697
}
721698

722699
/*
@@ -1247,8 +1224,6 @@ static void idxd_remove(struct pci_dev *pdev)
12471224
free_irq(irq_entry->vector, irq_entry);
12481225
pci_free_irq_vectors(pdev);
12491226
pci_iounmap(pdev, idxd->reg_base);
1250-
if (device_user_pasid_enabled(idxd))
1251-
idxd_disable_sva(pdev);
12521227
pci_disable_device(pdev);
12531228
destroy_workqueue(idxd->wq);
12541229
perfmon_pmu_remove(idxd);

0 commit comments

Comments
 (0)