aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-30 11:49:28 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-30 11:49:28 -0400
commit2f83766d4b18774c856329a8fca4c9338dfeda39 (patch)
treea19ea2165755f5700d7f37a61ece7edce231744f /include
parent4523e1458566a0e8ecfaff90f380dd23acc44d27 (diff)
parent28f8571e1e84782244cc7bf1b129baf6cdc0832e (diff)
Merge tag 'iommu-updates-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu
Pull IOMMU updates from Joerg Roedel: "Not much stuff this time. The only change to the IOMMU core code is the addition of a handle to the fault handling code. A few updates to the AMD IOMMU driver to work around new errata. The other patches are mostly fixes and enhancements to the existing ARM IOMMU drivers and documentation updates. A new IOMMU driver for the Exynos platform was also underway but got merged via the Samsung tree and is not part of this tree." * tag 'iommu-updates-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu: Documentation: kernel-parameters.txt Add amd_iommu_dump iommu/core: pass a user-provided token to fault handlers iommu/tegra: gart: Fix register offset correctly iommu: OMAP: device detach on domain destroy iommu: tegra/gart: Add device tree support iommu: tegra/gart: use correct gart_device iommu/tegra: smmu: Print device name correctly iommu/amd: Add workaround for event log erratum iommu/amd: Check for the right TLP prefix bit dma-debug: release free_entries_lock before saving stack trace
Diffstat (limited to 'include')
-rw-r--r--include/linux/iommu.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index d937580417ba..450293f6d68b 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -35,12 +35,13 @@ struct iommu_domain;
35#define IOMMU_FAULT_WRITE 0x1 35#define IOMMU_FAULT_WRITE 0x1
36 36
37typedef int (*iommu_fault_handler_t)(struct iommu_domain *, 37typedef int (*iommu_fault_handler_t)(struct iommu_domain *,
38 struct device *, unsigned long, int); 38 struct device *, unsigned long, int, void *);
39 39
40struct iommu_domain { 40struct iommu_domain {
41 struct iommu_ops *ops; 41 struct iommu_ops *ops;
42 void *priv; 42 void *priv;
43 iommu_fault_handler_t handler; 43 iommu_fault_handler_t handler;
44 void *handler_token;
44}; 45};
45 46
46#define IOMMU_CAP_CACHE_COHERENCY 0x1 47#define IOMMU_CAP_CACHE_COHERENCY 0x1
@@ -95,7 +96,7 @@ extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
95extern int iommu_domain_has_cap(struct iommu_domain *domain, 96extern int iommu_domain_has_cap(struct iommu_domain *domain,
96 unsigned long cap); 97 unsigned long cap);
97extern void iommu_set_fault_handler(struct iommu_domain *domain, 98extern void iommu_set_fault_handler(struct iommu_domain *domain,
98 iommu_fault_handler_t handler); 99 iommu_fault_handler_t handler, void *token);
99extern int iommu_device_group(struct device *dev, unsigned int *groupid); 100extern int iommu_device_group(struct device *dev, unsigned int *groupid);
100 101
101/** 102/**
@@ -132,7 +133,8 @@ static inline int report_iommu_fault(struct iommu_domain *domain,
132 * invoke it. 133 * invoke it.
133 */ 134 */
134 if (domain->handler) 135 if (domain->handler)
135 ret = domain->handler(domain, dev, iova, flags); 136 ret = domain->handler(domain, dev, iova, flags,
137 domain->handler_token);
136 138
137 return ret; 139 return ret;
138} 140}
@@ -191,7 +193,7 @@ static inline int domain_has_cap(struct iommu_domain *domain,
191} 193}
192 194
193static inline void iommu_set_fault_handler(struct iommu_domain *domain, 195static inline void iommu_set_fault_handler(struct iommu_domain *domain,
194 iommu_fault_handler_t handler) 196 iommu_fault_handler_t handler, void *token)
195{ 197{
196} 198}
197 199