]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sparc: Revert generic IOMMU allocator.
authorDavid S. Miller <davem@davemloft.net>
Sat, 18 Apr 2015 19:31:25 +0000 (12:31 -0700)
committerAllen Pais <allen.pais@oracle.com>
Wed, 9 Sep 2015 18:43:35 +0000 (00:13 +0530)
I applied the wrong version of this patch series, V4 instead
of V10, due to a patchwork bundling snafu.

Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit c12f048ffdf3a5802239426dc290290929268dc9)

Conflicts:
lib/iommu-common.c
Signed-off-by: Allen Pais <allen.pais@oracle.com>
(cherry picked from commit 065168b6a8d64cc9deacc6fb62e2d2a6181e1019)

arch/sparc/kernel/iommu_common.h
arch/sparc/kernel/ldc.c
lib/Makefile

index f4be0d724fc6e65991b08e174d0d4ca6175f0d7f..1ec0de4156e769d58fde44d355d15bda15199c73 100644 (file)
@@ -48,4 +48,12 @@ static inline int is_span_boundary(unsigned long entry,
        return iommu_is_span_boundary(entry, nr, shift, boundary_size);
 }
 
+unsigned long iommu_range_alloc(struct device *dev,
+                               struct iommu *iommu,
+                               unsigned long npages,
+                               unsigned long *handle);
+void iommu_range_free(struct iommu *iommu,
+                     dma_addr_t dma_addr,
+                     unsigned long npages);
+
 #endif /* _IOMMU_COMMON_H */
index 7d3ca30fcd1506d81dfca9859ffb4cc290fae109..1ae5eb1bb045130f05c8edc4573dbcd75e00475f 100644 (file)
@@ -2086,6 +2086,7 @@ int ldc_map_sg(struct ldc_channel *lp,
        struct cookie_state state;
        struct ldc_iommu *iommu;
        int err;
+       struct scatterlist *s;
 
        if (map_perm & ~LDC_MAP_ALL)
                return -EINVAL;
@@ -2112,9 +2113,10 @@ int ldc_map_sg(struct ldc_channel *lp,
        state.pte_idx = (base - iommu->page_table);
        state.nc = 0;
 
-       for (i = 0; i < num_sg; i++)
-               fill_cookies(&state, page_to_pfn(sg_page(&sg[i])) << PAGE_SHIFT,
-                            sg[i].offset, sg[i].length);
+       for_each_sg(sg, s, num_sg, i) {
+               fill_cookies(&state, page_to_pfn(sg_page(s)) << PAGE_SHIFT,
+                            s->offset, s->length);
+       }
 
        return state.nc;
 }
index 6c37933336a0261007f73e8511936e95ff1f514c..da6116b21555583864e2eadd7ae5615d46878d84 100644 (file)
@@ -106,7 +106,7 @@ obj-$(CONFIG_AUDIT_GENERIC) += audit.o
 obj-$(CONFIG_AUDIT_COMPAT_GENERIC) += compat_audit.o
 
 obj-$(CONFIG_SWIOTLB) += swiotlb.o
-obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o iommu-common.o
+obj-$(CONFIG_IOMMU_HELPER) += iommu-helper.o
 obj-$(CONFIG_FAULT_INJECTION) += fault-inject.o
 obj-$(CONFIG_NOTIFIER_ERROR_INJECTION) += notifier-error-inject.o
 obj-$(CONFIG_CPU_NOTIFIER_ERROR_INJECT) += cpu-notifier-error-inject.o