diff options
author | Joerg Roedel <jroedel@suse.de> | 2014-09-05 04:49:34 -0400 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2014-09-25 09:47:06 -0400 |
commit | 1fd0c775a573646eec972a3f40563506e33d9f8a (patch) | |
tree | 76c5820bba284b7f3b5d88882ab037132f394a18 /drivers | |
parent | ab636481863a1039f5ca3643cfb04d4ae0c965cd (diff) |
iommu/arm-smmu: Convert to iommu_capable() API function
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iommu/arm-smmu.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index a83cc2a2a2ca..1e0485e0aa6a 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c | |||
@@ -1526,20 +1526,19 @@ static phys_addr_t arm_smmu_iova_to_phys(struct iommu_domain *domain, | |||
1526 | return __pfn_to_phys(pte_pfn(pte)) | (iova & ~PAGE_MASK); | 1526 | return __pfn_to_phys(pte_pfn(pte)) | (iova & ~PAGE_MASK); |
1527 | } | 1527 | } |
1528 | 1528 | ||
1529 | static int arm_smmu_domain_has_cap(struct iommu_domain *domain, | 1529 | static bool arm_smmu_capable(enum iommu_cap cap) |
1530 | unsigned long cap) | ||
1531 | { | 1530 | { |
1532 | struct arm_smmu_domain *smmu_domain = domain->priv; | ||
1533 | struct arm_smmu_device *smmu = smmu_domain->smmu; | ||
1534 | u32 features = smmu ? smmu->features : 0; | ||
1535 | |||
1536 | switch (cap) { | 1531 | switch (cap) { |
1537 | case IOMMU_CAP_CACHE_COHERENCY: | 1532 | case IOMMU_CAP_CACHE_COHERENCY: |
1538 | return features & ARM_SMMU_FEAT_COHERENT_WALK; | 1533 | /* |
1534 | * Return true here as the SMMU can always send out coherent | ||
1535 | * requests. | ||
1536 | */ | ||
1537 | return true; | ||
1539 | case IOMMU_CAP_INTR_REMAP: | 1538 | case IOMMU_CAP_INTR_REMAP: |
1540 | return 1; /* MSIs are just memory writes */ | 1539 | return true; /* MSIs are just memory writes */ |
1541 | default: | 1540 | default: |
1542 | return 0; | 1541 | return false; |
1543 | } | 1542 | } |
1544 | } | 1543 | } |
1545 | 1544 | ||
@@ -1609,6 +1608,7 @@ static void arm_smmu_remove_device(struct device *dev) | |||
1609 | } | 1608 | } |
1610 | 1609 | ||
1611 | static const struct iommu_ops arm_smmu_ops = { | 1610 | static const struct iommu_ops arm_smmu_ops = { |
1611 | .capable = arm_smmu_capable, | ||
1612 | .domain_init = arm_smmu_domain_init, | 1612 | .domain_init = arm_smmu_domain_init, |
1613 | .domain_destroy = arm_smmu_domain_destroy, | 1613 | .domain_destroy = arm_smmu_domain_destroy, |
1614 | .attach_dev = arm_smmu_attach_dev, | 1614 | .attach_dev = arm_smmu_attach_dev, |
@@ -1616,7 +1616,6 @@ static const struct iommu_ops arm_smmu_ops = { | |||
1616 | .map = arm_smmu_map, | 1616 | .map = arm_smmu_map, |
1617 | .unmap = arm_smmu_unmap, | 1617 | .unmap = arm_smmu_unmap, |
1618 | .iova_to_phys = arm_smmu_iova_to_phys, | 1618 | .iova_to_phys = arm_smmu_iova_to_phys, |
1619 | .domain_has_cap = arm_smmu_domain_has_cap, | ||
1620 | .add_device = arm_smmu_add_device, | 1619 | .add_device = arm_smmu_add_device, |
1621 | .remove_device = arm_smmu_remove_device, | 1620 | .remove_device = arm_smmu_remove_device, |
1622 | .pgsize_bitmap = (SECTION_SIZE | | 1621 | .pgsize_bitmap = (SECTION_SIZE | |