diff options
Diffstat (limited to 'drivers/iommu/amd_iommu.c')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 4ee277a8521a..a3b7072e86e2 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2702,9 +2702,8 @@ static int amd_iommu_attach_device(struct iommu_domain *dom, | |||
2702 | } | 2702 | } |
2703 | 2703 | ||
2704 | static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova, | 2704 | static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova, |
2705 | phys_addr_t paddr, int gfp_order, int iommu_prot) | 2705 | phys_addr_t paddr, size_t page_size, int iommu_prot) |
2706 | { | 2706 | { |
2707 | unsigned long page_size = 0x1000UL << gfp_order; | ||
2708 | struct protection_domain *domain = dom->priv; | 2707 | struct protection_domain *domain = dom->priv; |
2709 | int prot = 0; | 2708 | int prot = 0; |
2710 | int ret; | 2709 | int ret; |
@@ -2721,13 +2720,11 @@ static int amd_iommu_map(struct iommu_domain *dom, unsigned long iova, | |||
2721 | return ret; | 2720 | return ret; |
2722 | } | 2721 | } |
2723 | 2722 | ||
2724 | static int amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova, | 2723 | static size_t amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova, |
2725 | int gfp_order) | 2724 | size_t page_size) |
2726 | { | 2725 | { |
2727 | struct protection_domain *domain = dom->priv; | 2726 | struct protection_domain *domain = dom->priv; |
2728 | unsigned long page_size, unmap_size; | 2727 | size_t unmap_size; |
2729 | |||
2730 | page_size = 0x1000UL << gfp_order; | ||
2731 | 2728 | ||
2732 | mutex_lock(&domain->api_lock); | 2729 | mutex_lock(&domain->api_lock); |
2733 | unmap_size = iommu_unmap_page(domain, iova, page_size); | 2730 | unmap_size = iommu_unmap_page(domain, iova, page_size); |
@@ -2735,7 +2732,7 @@ static int amd_iommu_unmap(struct iommu_domain *dom, unsigned long iova, | |||
2735 | 2732 | ||
2736 | domain_flush_tlb_pde(domain); | 2733 | domain_flush_tlb_pde(domain); |
2737 | 2734 | ||
2738 | return get_order(unmap_size); | 2735 | return unmap_size; |
2739 | } | 2736 | } |
2740 | 2737 | ||
2741 | static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, | 2738 | static phys_addr_t amd_iommu_iova_to_phys(struct iommu_domain *dom, |