aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-18 18:01:29 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-18 18:01:29 -0400
commit64fb1d0e975e92e012802d371e417266d6531676 (patch)
treeeb3fba9d0fddc47e29699e689bb45e79a22d1116 /include/linux
parentdba94f2155f581395ef9608418778e3491b3d470 (diff)
parentccb301862aa51ea7c10c10b440f3e8bbeac5b720 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller "Unfortunately, I brown paper bagged the generic iommu pool allocator by applying the wrong revision of the patch series. This reverts the bad one, and puts the right one in" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: iommu-common: Fix PARISC compile-time warnings sparc: Make LDC use common iommu poll management functions sparc: Make sparc64 use scalable lib/iommu-common.c functions Break up monolithic iommu table/lock into finer graularity pools and lock sparc: Revert generic IOMMU allocator.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/iommu-common.h38
1 files changed, 17 insertions, 21 deletions
diff --git a/include/linux/iommu-common.h b/include/linux/iommu-common.h
index 6be5c863f329..bbced83b32ee 100644
--- a/include/linux/iommu-common.h
+++ b/include/linux/iommu-common.h
@@ -15,41 +15,37 @@ struct iommu_pool {
15 spinlock_t lock; 15 spinlock_t lock;
16}; 16};
17 17
18struct iommu_table; 18struct iommu_map_table {
19 19 unsigned long table_map_base;
20struct iommu_tbl_ops { 20 unsigned long table_shift;
21 unsigned long (*cookie_to_index)(u64, void *);
22 void (*demap)(void *, unsigned long, unsigned long);
23 void (*reset)(struct iommu_table *);
24};
25
26struct iommu_table {
27 unsigned long page_table_map_base;
28 unsigned long page_table_shift;
29 unsigned long nr_pools; 21 unsigned long nr_pools;
30 const struct iommu_tbl_ops *iommu_tbl_ops; 22 void (*lazy_flush)(struct iommu_map_table *);
31 unsigned long poolsize; 23 unsigned long poolsize;
32 struct iommu_pool arena_pool[IOMMU_NR_POOLS]; 24 struct iommu_pool pools[IOMMU_NR_POOLS];
33 u32 flags; 25 u32 flags;
34#define IOMMU_HAS_LARGE_POOL 0x00000001 26#define IOMMU_HAS_LARGE_POOL 0x00000001
27#define IOMMU_NO_SPAN_BOUND 0x00000002
28#define IOMMU_NEED_FLUSH 0x00000004
35 struct iommu_pool large_pool; 29 struct iommu_pool large_pool;
36 unsigned long *map; 30 unsigned long *map;
37}; 31};
38 32
39extern void iommu_tbl_pool_init(struct iommu_table *iommu, 33extern void iommu_tbl_pool_init(struct iommu_map_table *iommu,
40 unsigned long num_entries, 34 unsigned long num_entries,
41 u32 page_table_shift, 35 u32 table_shift,
42 const struct iommu_tbl_ops *iommu_tbl_ops, 36 void (*lazy_flush)(struct iommu_map_table *),
43 bool large_pool, u32 npools); 37 bool large_pool, u32 npools,
38 bool skip_span_boundary_check);
44 39
45extern unsigned long iommu_tbl_range_alloc(struct device *dev, 40extern unsigned long iommu_tbl_range_alloc(struct device *dev,
46 struct iommu_table *iommu, 41 struct iommu_map_table *iommu,
47 unsigned long npages, 42 unsigned long npages,
48 unsigned long *handle, 43 unsigned long *handle,
49 unsigned int pool_hash); 44 unsigned long mask,
45 unsigned int align_order);
50 46
51extern void iommu_tbl_range_free(struct iommu_table *iommu, 47extern void iommu_tbl_range_free(struct iommu_map_table *iommu,
52 u64 dma_addr, unsigned long npages, 48 u64 dma_addr, unsigned long npages,
53 bool do_demap, void *demap_arg); 49 unsigned long entry);
54 50
55#endif 51#endif