diff options
Diffstat (limited to 'drivers/iommu')
-rw-r--r-- | drivers/iommu/intel_intr_remapping.c | 7 | ||||
-rw-r--r-- | drivers/iommu/intr_remapping.c | 24 | ||||
-rw-r--r-- | drivers/iommu/intr_remapping.h | 9 |
3 files changed, 38 insertions, 2 deletions
diff --git a/drivers/iommu/intel_intr_remapping.c b/drivers/iommu/intel_intr_remapping.c index 9c742fb111b6..610b75b66c07 100644 --- a/drivers/iommu/intel_intr_remapping.c +++ b/drivers/iommu/intel_intr_remapping.c | |||
@@ -764,7 +764,7 @@ int __init ir_dev_scope_init(void) | |||
764 | } | 764 | } |
765 | rootfs_initcall(ir_dev_scope_init); | 765 | rootfs_initcall(ir_dev_scope_init); |
766 | 766 | ||
767 | void disable_intr_remapping(void) | 767 | static void disable_intr_remapping(void) |
768 | { | 768 | { |
769 | struct dmar_drhd_unit *drhd; | 769 | struct dmar_drhd_unit *drhd; |
770 | struct intel_iommu *iommu = NULL; | 770 | struct intel_iommu *iommu = NULL; |
@@ -780,7 +780,7 @@ void disable_intr_remapping(void) | |||
780 | } | 780 | } |
781 | } | 781 | } |
782 | 782 | ||
783 | int reenable_intr_remapping(int eim) | 783 | static int reenable_intr_remapping(int eim) |
784 | { | 784 | { |
785 | struct dmar_drhd_unit *drhd; | 785 | struct dmar_drhd_unit *drhd; |
786 | int setup = 0; | 786 | int setup = 0; |
@@ -818,4 +818,7 @@ struct irq_remap_ops intel_irq_remap_ops = { | |||
818 | .supported = intel_intr_remapping_supported, | 818 | .supported = intel_intr_remapping_supported, |
819 | .hardware_init = dmar_table_init, | 819 | .hardware_init = dmar_table_init, |
820 | .hardware_enable = intel_enable_intr_remapping, | 820 | .hardware_enable = intel_enable_intr_remapping, |
821 | .hardware_disable = disable_intr_remapping, | ||
822 | .hardware_reenable = reenable_intr_remapping, | ||
823 | .enable_faulting = enable_drhd_fault_handling, | ||
821 | }; | 824 | }; |
diff --git a/drivers/iommu/intr_remapping.c b/drivers/iommu/intr_remapping.c index 670c69a80afd..9aabed7c0320 100644 --- a/drivers/iommu/intr_remapping.c +++ b/drivers/iommu/intr_remapping.c | |||
@@ -74,3 +74,27 @@ int __init intr_hardware_enable(void) | |||
74 | 74 | ||
75 | return remap_ops->hardware_enable(); | 75 | return remap_ops->hardware_enable(); |
76 | } | 76 | } |
77 | |||
78 | void intr_hardware_disable(void) | ||
79 | { | ||
80 | if (!remap_ops || !remap_ops->hardware_disable) | ||
81 | return; | ||
82 | |||
83 | remap_ops->hardware_disable(); | ||
84 | } | ||
85 | |||
86 | int intr_hardware_reenable(int mode) | ||
87 | { | ||
88 | if (!remap_ops || !remap_ops->hardware_reenable) | ||
89 | return 0; | ||
90 | |||
91 | return remap_ops->hardware_reenable(mode); | ||
92 | } | ||
93 | |||
94 | int __init intr_enable_fault_handling(void) | ||
95 | { | ||
96 | if (!remap_ops || !remap_ops->enable_faulting) | ||
97 | return -ENODEV; | ||
98 | |||
99 | return remap_ops->enable_faulting(); | ||
100 | } | ||
diff --git a/drivers/iommu/intr_remapping.h b/drivers/iommu/intr_remapping.h index d6df732e001f..2744c9ae4aec 100644 --- a/drivers/iommu/intr_remapping.h +++ b/drivers/iommu/intr_remapping.h | |||
@@ -37,6 +37,15 @@ struct irq_remap_ops { | |||
37 | 37 | ||
38 | /* Enables the remapping hardware */ | 38 | /* Enables the remapping hardware */ |
39 | int (*hardware_enable)(void); | 39 | int (*hardware_enable)(void); |
40 | |||
41 | /* Disables the remapping hardware */ | ||
42 | void (*hardware_disable)(void); | ||
43 | |||
44 | /* Reenables the remapping hardware */ | ||
45 | int (*hardware_reenable)(int); | ||
46 | |||
47 | /* Enable fault handling */ | ||
48 | int (*enable_faulting)(void); | ||
40 | }; | 49 | }; |
41 | 50 | ||
42 | extern struct irq_remap_ops intel_irq_remap_ops; | 51 | extern struct irq_remap_ops intel_irq_remap_ops; |