summaryrefslogtreecommitdiff
path: root/include/linux/iova.h
diff options
context:
space:
mode:
authorRobin Murphy <robin.murphy@arm.com>2021-12-17 15:30:57 +0000
committerJoerg Roedel <jroedel@suse.de>2021-12-20 09:03:05 +0100
commit649ad9835a3783bcb6c69368fa939e0010abb2c6 (patch)
treecd15efbd451a968cfabde7aad79c78d2e40df006 /include/linux/iova.h
parentd5c383f2c98ac58c210b266cdaf7b86bc32d1ad1 (diff)
iommu/iova: Squash flush_cb abstraction
Once again, with iommu-dma now being the only flush queue user, we no longer need the extra level of indirection through flush_cb. Squash that and let the flush queue code call the domain method directly. This does mean temporarily having to carry an additional copy of the IOMMU domain pointer around instead, but only until a later patch untangles it again. Reviewed-by: John Garry <john.garry@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/e3f9b4acdd6640012ef4fbc819ac868d727b64a9.1639753638.git.robin.murphy@arm.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/iova.h')
-rw-r--r--include/linux/iova.h11
1 files changed, 3 insertions, 8 deletions
diff --git a/include/linux/iova.h b/include/linux/iova.h
index e746d8e41449..99be4fcea4f3 100644
--- a/include/linux/iova.h
+++ b/include/linux/iova.h
@@ -14,6 +14,7 @@
#include <linux/rbtree.h>
#include <linux/atomic.h>
#include <linux/dma-mapping.h>
+#include <linux/iommu.h>
/* iova structure */
struct iova {
@@ -35,11 +36,6 @@ struct iova_rcache {
struct iova_cpu_rcache __percpu *cpu_rcaches;
};
-struct iova_domain;
-
-/* Call-Back from IOVA code into IOMMU drivers */
-typedef void (* iova_flush_cb)(struct iova_domain *domain);
-
/* Number of entries per Flush Queue */
#define IOVA_FQ_SIZE 256
@@ -82,8 +78,7 @@ struct iova_domain {
struct iova anchor; /* rbtree lookup anchor */
struct iova_rcache rcaches[IOVA_RANGE_CACHE_MAX_SIZE]; /* IOVA range caches */
- iova_flush_cb flush_cb; /* Call-Back function to flush IOMMU
- TLBs */
+ struct iommu_domain *fq_domain;
struct timer_list fq_timer; /* Timer to regularily empty the
flush-queues */
@@ -147,7 +142,7 @@ struct iova *reserve_iova(struct iova_domain *iovad, unsigned long pfn_lo,
unsigned long pfn_hi);
void init_iova_domain(struct iova_domain *iovad, unsigned long granule,
unsigned long start_pfn);
-int init_iova_flush_queue(struct iova_domain *iovad, iova_flush_cb flush_cb);
+int init_iova_flush_queue(struct iova_domain *iovad, struct iommu_domain *fq_domain);
struct iova *find_iova(struct iova_domain *iovad, unsigned long pfn);
void put_iova_domain(struct iova_domain *iovad);
#else