]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
iommu/irq_remapping: Kill function irq_remapping_supported() and related code
authorJiang Liu <jiang.liu@linux.intel.com>
Wed, 7 Jan 2015 07:31:40 +0000 (15:31 +0800)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 15 Jan 2015 10:24:23 +0000 (11:24 +0100)
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>
arch/x86/include/asm/irq_remapping.h
arch/x86/kernel/apic/apic.c
drivers/iommu/amd_iommu.c
drivers/iommu/amd_iommu_init.c
drivers/iommu/amd_iommu_proto.h
drivers/iommu/intel_irq_remapping.c
drivers/iommu/irq_remapping.c
drivers/iommu/irq_remapping.h

index f1b619e5a50d321e80364feac867069abcb42d3b..6224d316c405c444553877845385e2d7b151c161 100644 (file)
@@ -33,7 +33,6 @@ struct irq_cfg;
 
 #ifdef CONFIG_IRQ_REMAP
 
-extern int irq_remapping_supported(void);
 extern void set_irq_remapping_broken(void);
 extern int irq_remapping_prepare(void);
 extern int irq_remapping_enable(void);
@@ -59,7 +58,6 @@ void irq_remap_modify_chip_defaults(struct irq_chip *chip);
 
 #else  /* CONFIG_IRQ_REMAP */
 
-static inline int irq_remapping_supported(void) { return 0; }
 static inline void set_irq_remapping_broken(void) { }
 static inline int irq_remapping_prepare(void) { return -ENODEV; }
 static inline int irq_remapping_enable(void) { return -ENODEV; }
index 2f16116ced90e72161bad3965e51a96f4009074f..35e6d09294ed06598568438ac40138d4587bd02c 100644 (file)
@@ -1575,12 +1575,7 @@ void enable_x2apic(void)
 
 static int __init try_to_enable_IR(void)
 {
-#ifdef CONFIG_IRQ_REMAP
-       if (!irq_remapping_supported()) {
-               pr_debug("intr-remapping not supported\n");
-               return -1;
-       }
-
+#ifdef CONFIG_X86_IO_APIC
        if (!x2apic_enabled() && skip_ioapic_setup) {
                pr_info("Skipped enabling intr-remap because of skipping "
                        "io-apic setup\n");
index 98024856df07fc89e744cb1d7b2356a72146de51..59de6364a9109be4baba8f36fd7e331a13261128 100644 (file)
@@ -4284,7 +4284,6 @@ static int alloc_hpet_msi(unsigned int irq, unsigned int id)
 }
 
 struct irq_remap_ops amd_iommu_irq_ops = {
-       .supported              = amd_iommu_supported,
        .prepare                = amd_iommu_prepare,
        .enable                 = amd_iommu_enable,
        .disable                = amd_iommu_disable,
index 0039f87f48b822a04a5e1c5a5ea1c91e34756ab3..970979ecbebb3fa5e4b84c63945ac7ed95a7176a 100644 (file)
@@ -2129,11 +2129,6 @@ int __init amd_iommu_prepare(void)
        return iommu_go_to_state(IOMMU_ACPI_FINISHED);
 }
 
-int __init amd_iommu_supported(void)
-{
-       return amd_iommu_irq_remap ? 1 : 0;
-}
-
 int __init amd_iommu_enable(void)
 {
        int ret;
index 95ed6deae47fe76ac4a7a068b1b6f27e7f8a54c3..861af9d8338a84b8cc19b24a88a9e0684dd49021 100644 (file)
@@ -33,7 +33,6 @@ extern void amd_iommu_init_notifier(void);
 extern void amd_iommu_init_api(void);
 
 /* Needed for interrupt remapping */
-extern int amd_iommu_supported(void);
 extern int amd_iommu_prepare(void);
 extern int amd_iommu_enable(void);
 extern void amd_iommu_disable(void);
index 9d67c12c2ffbcd226212544e359284fc8841ac1d..fb72bd5f438c04c3461eba11867ffd63d2cdb1ec 100644 (file)
@@ -567,11 +567,6 @@ static int __init dmar_x2apic_optout(void)
        return dmar->flags & DMAR_X2APIC_OPT_OUT;
 }
 
-static int __init intel_irq_remapping_supported(void)
-{
-       return 1;
-}
-
 static void __init intel_cleanup_irq_remapping(void)
 {
        struct dmar_drhd_unit *drhd;
@@ -1216,7 +1211,6 @@ static int intel_alloc_hpet_msi(unsigned int irq, unsigned int id)
 }
 
 struct irq_remap_ops intel_irq_remap_ops = {
-       .supported              = intel_irq_remapping_supported,
        .prepare                = intel_prepare_irq_remapping,
        .enable                 = intel_enable_irq_remapping,
        .disable                = disable_irq_remapping,
index 91d5884d3ed96ba99c5c3f697b5fdc16d5eb6c70..e7449b42504d3b2dcc06a33ad628915da245e083 100644 (file)
@@ -199,19 +199,11 @@ void set_irq_remapping_broken(void)
        irq_remap_broken = 1;
 }
 
-int irq_remapping_supported(void)
+int __init irq_remapping_prepare(void)
 {
        if (disable_irq_remap)
-               return 0;
-
-       if (!remap_ops || !remap_ops->supported)
-               return 0;
+               return -ENOSYS;
 
-       return remap_ops->supported();
-}
-
-int __init irq_remapping_prepare(void)
-{
        remap_ops = &intel_irq_remap_ops;
 
 #ifdef CONFIG_AMD_IOMMU
index fde250f86e6034c5511ce392c255e73be70d2eaa..a8edfea0ab5d5ca8a3d87bfd83c50772dd67589a 100644 (file)
@@ -38,9 +38,6 @@ extern int no_x2apic_optout;
 extern int irq_remapping_enabled;
 
 struct irq_remap_ops {
-       /* Check whether Interrupt Remapping is supported */
-       int (*supported)(void);
-
        /* Initializes hardware and makes it ready for remapping interrupts */
        int  (*prepare)(void);