File tree Expand file tree Collapse file tree 3 files changed +4
-27
lines changed Expand file tree Collapse file tree 3 files changed +4
-27
lines changed Original file line number Diff line number Diff line change @@ -1984,12 +1984,6 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
1984
1984
if (!smmu_domain )
1985
1985
return NULL ;
1986
1986
1987
- if (type == IOMMU_DOMAIN_DMA &&
1988
- iommu_get_dma_cookie (& smmu_domain -> domain )) {
1989
- kfree (smmu_domain );
1990
- return NULL ;
1991
- }
1992
-
1993
1987
mutex_init (& smmu_domain -> init_mutex );
1994
1988
INIT_LIST_HEAD (& smmu_domain -> devices );
1995
1989
spin_lock_init (& smmu_domain -> devices_lock );
@@ -2021,7 +2015,6 @@ static void arm_smmu_domain_free(struct iommu_domain *domain)
2021
2015
struct arm_smmu_domain * smmu_domain = to_smmu_domain (domain );
2022
2016
struct arm_smmu_device * smmu = smmu_domain -> smmu ;
2023
2017
2024
- iommu_put_dma_cookie (domain );
2025
2018
free_io_pgtable_ops (smmu_domain -> pgtbl_ops );
2026
2019
2027
2020
/* Free the CD and ASID, if we allocated them */
Original file line number Diff line number Diff line change @@ -868,10 +868,10 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
868
868
{
869
869
struct arm_smmu_domain * smmu_domain ;
870
870
871
- if (type != IOMMU_DOMAIN_UNMANAGED &&
872
- type != IOMMU_DOMAIN_DMA &&
873
- type != IOMMU_DOMAIN_IDENTITY )
874
- return NULL ;
871
+ if (type != IOMMU_DOMAIN_UNMANAGED && type != IOMMU_DOMAIN_IDENTITY ) {
872
+ if ( using_legacy_binding || type != IOMMU_DOMAIN_DMA )
873
+ return NULL ;
874
+ }
875
875
/*
876
876
* Allocate the domain and initialise some of its data structures.
877
877
* We can't really do anything meaningful until we've added a
@@ -881,12 +881,6 @@ static struct iommu_domain *arm_smmu_domain_alloc(unsigned type)
881
881
if (!smmu_domain )
882
882
return NULL ;
883
883
884
- if (type == IOMMU_DOMAIN_DMA && (using_legacy_binding ||
885
- iommu_get_dma_cookie (& smmu_domain -> domain ))) {
886
- kfree (smmu_domain );
887
- return NULL ;
888
- }
889
-
890
884
mutex_init (& smmu_domain -> init_mutex );
891
885
spin_lock_init (& smmu_domain -> cb_lock );
892
886
@@ -901,7 +895,6 @@ static void arm_smmu_domain_free(struct iommu_domain *domain)
901
895
* Free the domain resources. We assume that all devices have
902
896
* already been detached.
903
897
*/
904
- iommu_put_dma_cookie (domain );
905
898
arm_smmu_destroy_domain_context (domain );
906
899
kfree (smmu_domain );
907
900
}
Original file line number Diff line number Diff line change 10
10
#include <linux/bitfield.h>
11
11
#include <linux/clk.h>
12
12
#include <linux/delay.h>
13
- #include <linux/dma-iommu.h>
14
13
#include <linux/dma-mapping.h>
15
14
#include <linux/err.h>
16
15
#include <linux/interrupt.h>
@@ -335,12 +334,6 @@ static struct iommu_domain *qcom_iommu_domain_alloc(unsigned type)
335
334
if (!qcom_domain )
336
335
return NULL ;
337
336
338
- if (type == IOMMU_DOMAIN_DMA &&
339
- iommu_get_dma_cookie (& qcom_domain -> domain )) {
340
- kfree (qcom_domain );
341
- return NULL ;
342
- }
343
-
344
337
mutex_init (& qcom_domain -> init_mutex );
345
338
spin_lock_init (& qcom_domain -> pgtbl_lock );
346
339
@@ -351,8 +344,6 @@ static void qcom_iommu_domain_free(struct iommu_domain *domain)
351
344
{
352
345
struct qcom_iommu_domain * qcom_domain = to_qcom_iommu_domain (domain );
353
346
354
- iommu_put_dma_cookie (domain );
355
-
356
347
if (qcom_domain -> iommu ) {
357
348
/*
358
349
* NOTE: unmap can be called after client device is powered
You can’t perform that action at this time.
0 commit comments