diff options
author | Ohad Ben-Cohen <ohad@wizery.com> | 2011-09-27 07:36:40 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2011-09-30 10:40:32 -0400 |
commit | 0ed6d2d27bcc2ace454a8c55446e1bc3efd2d529 (patch) | |
tree | 0ed0c8f9878ee5a921ab69131e38a45864e2498f /include/linux/iommu.h | |
parent | 30bd918c7132adddd370c79fd5619bf108efd702 (diff) |
iommu/core: let drivers know if an iommu fault handler isn't installed
Make report_iommu_fault() return -ENOSYS whenever an iommu fault
handler isn't installed, so IOMMU drivers can then do their own
platform-specific default behavior if they wanted.
Fault handlers can still return -ENOSYS in case they want to elicit the
default behavior of the IOMMU drivers.
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'include/linux/iommu.h')
-rw-r--r-- | include/linux/iommu.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/linux/iommu.h b/include/linux/iommu.h index d084e8777e0e..ddad0ae0a433 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h | |||
@@ -98,11 +98,15 @@ extern void iommu_set_fault_handler(struct iommu_domain *domain, | |||
98 | * Returns 0 on success and an appropriate error code otherwise (if dynamic | 98 | * Returns 0 on success and an appropriate error code otherwise (if dynamic |
99 | * PTE/TLB loading will one day be supported, implementations will be able | 99 | * PTE/TLB loading will one day be supported, implementations will be able |
100 | * to tell whether it succeeded or not according to this return value). | 100 | * to tell whether it succeeded or not according to this return value). |
101 | * | ||
102 | * Specifically, -ENOSYS is returned if a fault handler isn't installed | ||
103 | * (though fault handlers can also return -ENOSYS, in case they want to | ||
104 | * elicit the default behavior of the IOMMU drivers). | ||
101 | */ | 105 | */ |
102 | static inline int report_iommu_fault(struct iommu_domain *domain, | 106 | static inline int report_iommu_fault(struct iommu_domain *domain, |
103 | struct device *dev, unsigned long iova, int flags) | 107 | struct device *dev, unsigned long iova, int flags) |
104 | { | 108 | { |
105 | int ret = 0; | 109 | int ret = -ENOSYS; |
106 | 110 | ||
107 | /* | 111 | /* |
108 | * if upper layers showed interest and installed a fault handler, | 112 | * if upper layers showed interest and installed a fault handler, |