diff options
author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2012-03-27 08:28:18 -0400 |
---|---|---|
committer | Marek Szyprowski <m.szyprowski@samsung.com> | 2012-03-28 10:36:31 -0400 |
commit | baa676fcf8d555269bd0a5a2496782beee55824d (patch) | |
tree | b92ef75b5a1bf6ff38222fb5aaeb0c64b2c88dc9 /drivers/iommu | |
parent | 613c4578d4079a14dbee76ef7e0c80f635522fe3 (diff) |
X86 & IA64: adapt for dma_map_ops changes
Adapt core x86 and IA64 architecture code for dma_map_ops changes: replace
alloc/free_coherent with generic alloc/free methods.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
[removed swiotlb related changes and replaced it with wrappers,
merged with IA64 patch to avoid inter-patch dependences in intel-iommu code]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/amd_iommu.c | 10 | ||||
-rw-r--r-- | drivers/iommu/intel-iommu.c | 9 |
2 files changed, 11 insertions, 8 deletions
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index f75e0608be5b..daa333f97b78 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -2707,7 +2707,8 @@ static void unmap_sg(struct device *dev, struct scatterlist *sglist, | |||
2707 | * The exported alloc_coherent function for dma_ops. | 2707 | * The exported alloc_coherent function for dma_ops. |
2708 | */ | 2708 | */ |
2709 | static void *alloc_coherent(struct device *dev, size_t size, | 2709 | static void *alloc_coherent(struct device *dev, size_t size, |
2710 | dma_addr_t *dma_addr, gfp_t flag) | 2710 | dma_addr_t *dma_addr, gfp_t flag, |
2711 | struct dma_attrs *attrs) | ||
2711 | { | 2712 | { |
2712 | unsigned long flags; | 2713 | unsigned long flags; |
2713 | void *virt_addr; | 2714 | void *virt_addr; |
@@ -2765,7 +2766,8 @@ out_free: | |||
2765 | * The exported free_coherent function for dma_ops. | 2766 | * The exported free_coherent function for dma_ops. |
2766 | */ | 2767 | */ |
2767 | static void free_coherent(struct device *dev, size_t size, | 2768 | static void free_coherent(struct device *dev, size_t size, |
2768 | void *virt_addr, dma_addr_t dma_addr) | 2769 | void *virt_addr, dma_addr_t dma_addr, |
2770 | struct dma_attrs *attrs) | ||
2769 | { | 2771 | { |
2770 | unsigned long flags; | 2772 | unsigned long flags; |
2771 | struct protection_domain *domain; | 2773 | struct protection_domain *domain; |
@@ -2846,8 +2848,8 @@ static void prealloc_protection_domains(void) | |||
2846 | } | 2848 | } |
2847 | 2849 | ||
2848 | static struct dma_map_ops amd_iommu_dma_ops = { | 2850 | static struct dma_map_ops amd_iommu_dma_ops = { |
2849 | .alloc_coherent = alloc_coherent, | 2851 | .alloc = alloc_coherent, |
2850 | .free_coherent = free_coherent, | 2852 | .free = free_coherent, |
2851 | .map_page = map_page, | 2853 | .map_page = map_page, |
2852 | .unmap_page = unmap_page, | 2854 | .unmap_page = unmap_page, |
2853 | .map_sg = map_sg, | 2855 | .map_sg = map_sg, |
diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index c9c6053198d4..e39bfdc055c3 100644 --- a/drivers/iommu/intel-iommu.c +++ b/drivers/iommu/intel-iommu.c | |||
@@ -2938,7 +2938,8 @@ static void intel_unmap_page(struct device *dev, dma_addr_t dev_addr, | |||
2938 | } | 2938 | } |
2939 | 2939 | ||
2940 | static void *intel_alloc_coherent(struct device *hwdev, size_t size, | 2940 | static void *intel_alloc_coherent(struct device *hwdev, size_t size, |
2941 | dma_addr_t *dma_handle, gfp_t flags) | 2941 | dma_addr_t *dma_handle, gfp_t flags, |
2942 | struct dma_attrs *attrs) | ||
2942 | { | 2943 | { |
2943 | void *vaddr; | 2944 | void *vaddr; |
2944 | int order; | 2945 | int order; |
@@ -2970,7 +2971,7 @@ static void *intel_alloc_coherent(struct device *hwdev, size_t size, | |||
2970 | } | 2971 | } |
2971 | 2972 | ||
2972 | static void intel_free_coherent(struct device *hwdev, size_t size, void *vaddr, | 2973 | static void intel_free_coherent(struct device *hwdev, size_t size, void *vaddr, |
2973 | dma_addr_t dma_handle) | 2974 | dma_addr_t dma_handle, struct dma_attrs *attrs) |
2974 | { | 2975 | { |
2975 | int order; | 2976 | int order; |
2976 | 2977 | ||
@@ -3115,8 +3116,8 @@ static int intel_mapping_error(struct device *dev, dma_addr_t dma_addr) | |||
3115 | } | 3116 | } |
3116 | 3117 | ||
3117 | struct dma_map_ops intel_dma_ops = { | 3118 | struct dma_map_ops intel_dma_ops = { |
3118 | .alloc_coherent = intel_alloc_coherent, | 3119 | .alloc = intel_alloc_coherent, |
3119 | .free_coherent = intel_free_coherent, | 3120 | .free = intel_free_coherent, |
3120 | .map_sg = intel_map_sg, | 3121 | .map_sg = intel_map_sg, |
3121 | .unmap_sg = intel_unmap_sg, | 3122 | .unmap_sg = intel_unmap_sg, |
3122 | .map_page = intel_map_page, | 3123 | .map_page = intel_map_page, |