aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/device.h
diff options
context:
space:
mode:
authorJacob Pan <jacob.jun.pan@linux.intel.com>2019-06-03 10:57:46 -0400
committerJoerg Roedel <jroedel@suse.de>2019-06-12 04:19:06 -0400
commitec6bc2e9e81b8805390851d7c7c907b0ed08b646 (patch)
treea3893dabed79cc07a3ff69c99a482fcb7cf2cfbe /include/linux/device.h
parent57274ea25736496ee019a5c40479855b21888839 (diff)
driver core: Add per device iommu param
DMA faults can be detected by IOMMU at device level. Adding a pointer to struct device allows IOMMU subsystem to report relevant faults back to the device driver for further handling. For direct assigned device (or user space drivers), guest OS holds responsibility to handle and respond per device IOMMU fault. Therefore we need fault reporting mechanism to propagate faults beyond IOMMU subsystem. There are two other IOMMU data pointers under struct device today, here we introduce iommu_param as a parent pointer such that all device IOMMU data can be consolidated here. The idea was suggested here by Greg KH and Joerg. The name iommu_param is chosen here since iommu_data has been used. Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Jacob Pan <jacob.jun.pan@linux.intel.com> Link: https://lkml.org/lkml/2017/10/6/81 Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'include/linux/device.h')
-rw-r--r--include/linux/device.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/device.h b/include/linux/device.h
index e85264fb6616..f0a975abd6e9 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -42,6 +42,7 @@ struct iommu_ops;
42struct iommu_group; 42struct iommu_group;
43struct iommu_fwspec; 43struct iommu_fwspec;
44struct dev_pin_info; 44struct dev_pin_info;
45struct iommu_param;
45 46
46struct bus_attribute { 47struct bus_attribute {
47 struct attribute attr; 48 struct attribute attr;
@@ -959,6 +960,7 @@ struct dev_links_info {
959 * device (i.e. the bus driver that discovered the device). 960 * device (i.e. the bus driver that discovered the device).
960 * @iommu_group: IOMMU group the device belongs to. 961 * @iommu_group: IOMMU group the device belongs to.
961 * @iommu_fwspec: IOMMU-specific properties supplied by firmware. 962 * @iommu_fwspec: IOMMU-specific properties supplied by firmware.
963 * @iommu_param: Per device generic IOMMU runtime data
962 * 964 *
963 * @offline_disabled: If set, the device is permanently online. 965 * @offline_disabled: If set, the device is permanently online.
964 * @offline: Set after successful invocation of bus type's .offline(). 966 * @offline: Set after successful invocation of bus type's .offline().
@@ -1052,6 +1054,7 @@ struct device {
1052 void (*release)(struct device *dev); 1054 void (*release)(struct device *dev);
1053 struct iommu_group *iommu_group; 1055 struct iommu_group *iommu_group;
1054 struct iommu_fwspec *iommu_fwspec; 1056 struct iommu_fwspec *iommu_fwspec;
1057 struct iommu_param *iommu_param;
1055 1058
1056 bool offline_disabled:1; 1059 bool offline_disabled:1;
1057 bool offline:1; 1060 bool offline:1;