diff options
author | Jiang Liu <jiang.liu@linux.intel.com> | 2015-01-07 02:31:40 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2015-01-15 05:24:23 -0500 |
commit | c392f56c946033bd136043079a62b9188888828d (patch) | |
tree | f2917dafcc643ce4d107f9bc355163ed64cfba41 | |
parent | 84d0779304b5c45134311dfc31b5a2325ce3ad84 (diff) |
iommu/irq_remapping: Kill function irq_remapping_supported() and related code
Simplify irq_remapping code by killing irq_remapping_supported() and
related interfaces.
Joerg posted a similar patch at https://lkml.org/lkml/2014/12/15/490,
so assume an signed-off from Joerg.
Signed-off-by: Jiang Liu <jiang.liu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Tested-by: Joerg Roedel <joro@8bytes.org>
Cc: Tony Luck <tony.luck@intel.com>
Cc: iommu@lists.linux-foundation.org
Cc: H. Peter Anvin <hpa@linux.intel.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Yinghai Lu <yinghai@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: David Rientjes <rientjes@google.com>
Cc: HATAYAMA Daisuke <d.hatayama@jp.fujitsu.com>
Cc: Jan Beulich <JBeulich@suse.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Oren Twaig <oren@scalemp.com>
Link: http://lkml.kernel.org/r/1420615903-28253-14-git-send-email-jiang.liu@linux.intel.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/include/asm/irq_remapping.h | 2 | ||||
-rw-r--r-- | arch/x86/kernel/apic/apic.c | 7 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu.c | 1 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_init.c | 5 | ||||
-rw-r--r-- | drivers/iommu/amd_iommu_proto.h | 1 | ||||
-rw-r--r-- | drivers/iommu/intel_irq_remapping.c | 6 | ||||
-rw-r--r-- | drivers/iommu/irq_remapping.c | 12 | ||||
-rw-r--r-- | drivers/iommu/irq_remapping.h | 3 |
8 files changed, 3 insertions, 34 deletions
diff --git a/arch/x86/include/asm/irq_remapping.h b/arch/x86/include/asm/irq_remapping.h index f1b619e5a50d..6224d316c405 100644 --- a/arch/x86/include/asm/irq_remapping.h +++ b/arch/x86/include/asm/irq_remapping.h | |||
@@ -33,7 +33,6 @@ struct irq_cfg; | |||
33 | 33 | ||
34 | #ifdef CONFIG_IRQ_REMAP | 34 | #ifdef CONFIG_IRQ_REMAP |
35 | 35 | ||
36 | extern int irq_remapping_supported(void); | ||
37 | extern void set_irq_remapping_broken(void); | 36 | extern void set_irq_remapping_broken(void); |
38 | extern int irq_remapping_prepare(void); | 37 | extern int irq_remapping_prepare(void); |
39 | extern int irq_remapping_enable(void); | 38 | extern int irq_remapping_enable(void); |
@@ -59,7 +58,6 @@ void irq_remap_modify_chip_defaults(struct irq_chip *chip); | |||
59 | 58 | ||
60 | #else /* CONFIG_IRQ_REMAP */ | 59 | #else /* CONFIG_IRQ_REMAP */ |
61 | 60 | ||
62 | static inline int irq_remapping_supported(void) { return 0; } | ||
63 | static inline void set_irq_remapping_broken(void) { } | 61 | static inline void set_irq_remapping_broken(void) { } |
64 | static inline int irq_remapping_prepare(void) { return -ENODEV; } | 62 | static inline int irq_remapping_prepare(void) { return -ENODEV; } |
65 | static inline int irq_remapping_enable(void) { return -ENODEV; } | 63 | static inline int irq_remapping_enable(void) { return -ENODEV; } |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 2f16116ced90..35e6d09294ed 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -1575,12 +1575,7 @@ void enable_x2apic(void) | |||
1575 | 1575 | ||
1576 | static int __init try_to_enable_IR(void) | 1576 | static int __init try_to_enable_IR(void) |
1577 | { | 1577 | { |
1578 | #ifdef CONFIG_IRQ_REMAP | 1578 | #ifdef CONFIG_X86_IO_APIC |
1579 | if (!irq_remapping_supported()) { | ||
1580 | pr_debug("intr-remapping not supported\n"); | ||
1581 | return -1; | ||
1582 | } | ||
1583 | |||
1584 | if (!x2apic_enabled() && skip_ioapic_setup) { | 1579 | if (!x2apic_enabled() && skip_ioapic_setup) { |
1585 | pr_info("Skipped enabling intr-remap because of skipping " | 1580 | pr_info("Skipped enabling intr-remap because of skipping " |
1586 | "io-apic setup\n"); | 1581 | "io-apic setup\n"); |
diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index 98024856df07..59de6364a910 100644 --- a/drivers/iommu/amd_iommu.c +++ b/drivers/iommu/amd_iommu.c | |||
@@ -4284,7 +4284,6 @@ static int alloc_hpet_msi(unsigned int irq, unsigned int id) | |||
4284 | } | 4284 | } |
4285 | 4285 | ||
4286 | struct irq_remap_ops amd_iommu_irq_ops = { | 4286 | struct irq_remap_ops amd_iommu_irq_ops = { |
4287 | .supported = amd_iommu_supported, | ||
4288 | .prepare = amd_iommu_prepare, | 4287 | .prepare = amd_iommu_prepare, |
4289 | .enable = amd_iommu_enable, | 4288 | .enable = amd_iommu_enable, |
4290 | .disable = amd_iommu_disable, | 4289 | .disable = amd_iommu_disable, |
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c index 0039f87f48b8..970979ecbebb 100644 --- a/drivers/iommu/amd_iommu_init.c +++ b/drivers/iommu/amd_iommu_init.c | |||
@@ -2129,11 +2129,6 @@ int __init amd_iommu_prepare(void) | |||
2129 | return iommu_go_to_state(IOMMU_ACPI_FINISHED); | 2129 | return iommu_go_to_state(IOMMU_ACPI_FINISHED); |
2130 | } | 2130 | } |
2131 | 2131 | ||
2132 | int __init amd_iommu_supported(void) | ||
2133 | { | ||
2134 | return amd_iommu_irq_remap ? 1 : 0; | ||
2135 | } | ||
2136 | |||
2137 | int __init amd_iommu_enable(void) | 2132 | int __init amd_iommu_enable(void) |
2138 | { | 2133 | { |
2139 | int ret; | 2134 | int ret; |
diff --git a/drivers/iommu/amd_iommu_proto.h b/drivers/iommu/amd_iommu_proto.h index 95ed6deae47f..861af9d8338a 100644 --- a/drivers/iommu/amd_iommu_proto.h +++ b/drivers/iommu/amd_iommu_proto.h | |||
@@ -33,7 +33,6 @@ extern void amd_iommu_init_notifier(void); | |||
33 | extern void amd_iommu_init_api(void); | 33 | extern void amd_iommu_init_api(void); |
34 | 34 | ||
35 | /* Needed for interrupt remapping */ | 35 | /* Needed for interrupt remapping */ |
36 | extern int amd_iommu_supported(void); | ||
37 | extern int amd_iommu_prepare(void); | 36 | extern int amd_iommu_prepare(void); |
38 | extern int amd_iommu_enable(void); | 37 | extern int amd_iommu_enable(void); |
39 | extern void amd_iommu_disable(void); | 38 | extern void amd_iommu_disable(void); |
diff --git a/drivers/iommu/intel_irq_remapping.c b/drivers/iommu/intel_irq_remapping.c index 9d67c12c2ffb..fb72bd5f438c 100644 --- a/drivers/iommu/intel_irq_remapping.c +++ b/drivers/iommu/intel_irq_remapping.c | |||
@@ -567,11 +567,6 @@ static int __init dmar_x2apic_optout(void) | |||
567 | return dmar->flags & DMAR_X2APIC_OPT_OUT; | 567 | return dmar->flags & DMAR_X2APIC_OPT_OUT; |
568 | } | 568 | } |
569 | 569 | ||
570 | static int __init intel_irq_remapping_supported(void) | ||
571 | { | ||
572 | return 1; | ||
573 | } | ||
574 | |||
575 | static void __init intel_cleanup_irq_remapping(void) | 570 | static void __init intel_cleanup_irq_remapping(void) |
576 | { | 571 | { |
577 | struct dmar_drhd_unit *drhd; | 572 | struct dmar_drhd_unit *drhd; |
@@ -1216,7 +1211,6 @@ static int intel_alloc_hpet_msi(unsigned int irq, unsigned int id) | |||
1216 | } | 1211 | } |
1217 | 1212 | ||
1218 | struct irq_remap_ops intel_irq_remap_ops = { | 1213 | struct irq_remap_ops intel_irq_remap_ops = { |
1219 | .supported = intel_irq_remapping_supported, | ||
1220 | .prepare = intel_prepare_irq_remapping, | 1214 | .prepare = intel_prepare_irq_remapping, |
1221 | .enable = intel_enable_irq_remapping, | 1215 | .enable = intel_enable_irq_remapping, |
1222 | .disable = disable_irq_remapping, | 1216 | .disable = disable_irq_remapping, |
diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 91d5884d3ed9..e7449b42504d 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c | |||
@@ -199,19 +199,11 @@ void set_irq_remapping_broken(void) | |||
199 | irq_remap_broken = 1; | 199 | irq_remap_broken = 1; |
200 | } | 200 | } |
201 | 201 | ||
202 | int irq_remapping_supported(void) | 202 | int __init irq_remapping_prepare(void) |
203 | { | 203 | { |
204 | if (disable_irq_remap) | 204 | if (disable_irq_remap) |
205 | return 0; | 205 | return -ENOSYS; |
206 | |||
207 | if (!remap_ops || !remap_ops->supported) | ||
208 | return 0; | ||
209 | 206 | ||
210 | return remap_ops->supported(); | ||
211 | } | ||
212 | |||
213 | int __init irq_remapping_prepare(void) | ||
214 | { | ||
215 | remap_ops = &intel_irq_remap_ops; | 207 | remap_ops = &intel_irq_remap_ops; |
216 | 208 | ||
217 | #ifdef CONFIG_AMD_IOMMU | 209 | #ifdef CONFIG_AMD_IOMMU |
diff --git a/drivers/iommu/irq_remapping.h b/drivers/iommu/irq_remapping.h index fde250f86e60..a8edfea0ab5d 100644 --- a/drivers/iommu/irq_remapping.h +++ b/drivers/iommu/irq_remapping.h | |||
@@ -38,9 +38,6 @@ extern int no_x2apic_optout; | |||
38 | extern int irq_remapping_enabled; | 38 | extern int irq_remapping_enabled; |
39 | 39 | ||
40 | struct irq_remap_ops { | 40 | struct irq_remap_ops { |
41 | /* Check whether Interrupt Remapping is supported */ | ||
42 | int (*supported)(void); | ||
43 | |||
44 | /* Initializes hardware and makes it ready for remapping interrupts */ | 41 | /* Initializes hardware and makes it ready for remapping interrupts */ |
45 | int (*prepare)(void); | 42 | int (*prepare)(void); |
46 | 43 | ||