diff --git a/drivers/crypto/hisilicon/hpre/hpre_main.c b/drivers/crypto/hisilicon/hpre/hpre_main.c index 269e02d7d035074cd123588bef9c990c3aec7bb9..0fefdae80f1f9f139c907540dc4593d87f22e9a7 100644 --- a/drivers/crypto/hisilicon/hpre/hpre_main.c +++ b/drivers/crypto/hisilicon/hpre/hpre_main.c @@ -714,7 +714,7 @@ static int hpre_qm_pre_init(struct hisi_qm *qm, struct pci_dev *pdev) qm->use_uacce = false; break; case UACCE_MODE_UACCE: -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 qm->use_dma_api = true; qm->use_sva = true; #else @@ -1258,7 +1258,7 @@ static int __init hpre_init(void) pr_err("hpre: can't register hisi hpre driver.\n"); goto fail_to_register_pci; } -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode == UACCE_MODE_UACCE) return 0; #endif @@ -1279,7 +1279,7 @@ static int __init hpre_init(void) static void __exit hpre_exit(void) { -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode != UACCE_MODE_UACCE) hpre_algs_unregister(); #else diff --git a/drivers/crypto/hisilicon/rde/rde_main.c b/drivers/crypto/hisilicon/rde/rde_main.c index a8b6ee5be1c1caa25d8575e323da9d1033fc2db6..99811f654a80247291fdd96cde280916e6760f8f 100644 --- a/drivers/crypto/hisilicon/rde/rde_main.c +++ b/drivers/crypto/hisilicon/rde/rde_main.c @@ -578,7 +578,7 @@ static int hisi_rde_qm_pre_init(struct hisi_qm *qm, struct pci_dev *pdev) qm->use_uacce = false; break; case UACCE_MODE_UACCE: -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 qm->use_dma_api = true; qm->use_sva = true; #else @@ -1015,7 +1015,7 @@ static int __init hisi_rde_init(void) pr_err("Failed to register pci driver.\n"); goto err_pci; } -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode == UACCE_MODE_UACCE) return 0; #endif diff --git a/drivers/crypto/hisilicon/sec2/sec_main.c b/drivers/crypto/hisilicon/sec2/sec_main.c index f561b2fadba0200255d45cef068a2a6d90f89b76..87f840c5de5fc36bec39938bf3de6903f59cba62 100644 --- a/drivers/crypto/hisilicon/sec2/sec_main.c +++ b/drivers/crypto/hisilicon/sec2/sec_main.c @@ -857,7 +857,7 @@ static int hisi_sec_probe(struct pci_dev *pdev, const struct pci_device_id *id) qm->use_uacce = false; break; case UACCE_MODE_UACCE: -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 qm->use_dma_api = true; qm->use_sva = true; #else @@ -1391,7 +1391,7 @@ static int __init hisi_sec_init(void) pr_err("Failed to register pci driver.\n"); goto err_pci; } -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode == UACCE_MODE_UACCE) return 0; #endif @@ -1414,7 +1414,7 @@ static int __init hisi_sec_init(void) static void __exit hisi_sec_exit(void) { -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode != UACCE_MODE_UACCE) hisi_sec_unregister_from_crypto(); #else diff --git a/drivers/crypto/hisilicon/zip/zip_main.c b/drivers/crypto/hisilicon/zip/zip_main.c index b077798e5f578c01e0cc4b6d8e062e6058d8c660..d03cd61ec8b5d4067a4f1330a52eabfdc2fad506 100644 --- a/drivers/crypto/hisilicon/zip/zip_main.c +++ b/drivers/crypto/hisilicon/zip/zip_main.c @@ -695,7 +695,7 @@ static int hisi_zip_probe(struct pci_dev *pdev, const struct pci_device_id *id) qm->use_uacce = false; break; case UACCE_MODE_UACCE: -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 qm->use_dma_api = true; qm->use_sva = true; #else @@ -1236,7 +1236,7 @@ static int __init hisi_zip_init(void) goto err_pci; } -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode == UACCE_MODE_UACCE) return 0; #endif @@ -1259,7 +1259,7 @@ static int __init hisi_zip_init(void) static void __exit hisi_zip_exit(void) { -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 if (uacce_mode != UACCE_MODE_UACCE) hisi_zip_unregister_from_crypto(); #else diff --git a/drivers/uacce/uacce.c b/drivers/uacce/uacce.c index df2d95d1603feadd7d716bf9a2cebf882e994fe9..e4d1a4c2545546503986d30e123a2ac658d9d3df 100644 --- a/drivers/uacce/uacce.c +++ b/drivers/uacce/uacce.c @@ -611,7 +611,7 @@ static int uacce_queue_drain(struct uacce_queue *q) if (is_to_free_region) uacce_destroy_region(q, qfr); } -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 if (uacce->flags & UACCE_DEV_SVA) iommu_sva_unbind_device(uacce->pdev, q->pasid); #endif @@ -674,7 +674,7 @@ static int uacce_fops_open(struct inode *inode, struct file *filep) ret = uacce_dev_open_check(uacce); if (ret) goto open_err; -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 if (uacce->flags & UACCE_DEV_PASID) { ret = iommu_sva_bind_device(uacce->pdev, current->mm, &pasid, IOMMU_SVA_FEAT_IOPF, NULL); @@ -1084,7 +1084,7 @@ static int uacce_default_start_queue(struct uacce_queue *q) return 0; } -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 static int uacce_dev_match(struct device *dev, void *data) { if (dev->parent == data) @@ -1254,7 +1254,7 @@ int uacce_register(struct uacce *uacce) uacce->ops->get_available_instances = uacce_default_get_available_instances; -#ifndef CONFIG_IOMMU_SVA +#ifndef CONFIG_IOMMU_SVA2 ret = uacce_set_iommu_domain(uacce); if (ret) return ret; @@ -1269,7 +1269,7 @@ int uacce_register(struct uacce *uacce) } if (uacce->flags & UACCE_DEV_PASID) { -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 ret = iommu_sva_init_device(uacce->pdev, IOMMU_SVA_FEAT_IOPF, 0, 0, NULL); if (ret) { @@ -1307,7 +1307,7 @@ void uacce_unregister(struct uacce *uacce) { mutex_lock(&uacce_mutex); -#ifdef CONFIG_IOMMU_SVA +#ifdef CONFIG_IOMMU_SVA2 iommu_sva_shutdown_device(uacce->pdev); #else uacce_unset_iommu_domain(uacce);