diff options
-rw-r--r-- | arch/x86/Kconfig | 1 | ||||
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 33 |
2 files changed, 34 insertions, 0 deletions
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 25d2c6f7325e..47247708c9eb 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -831,6 +831,7 @@ config X86_LOCAL_APIC | |||
831 | config X86_IO_APIC | 831 | config X86_IO_APIC |
832 | def_bool y | 832 | def_bool y |
833 | depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI | 833 | depends on X86_64 || SMP || X86_32_NON_STANDARD || X86_UP_IOAPIC || PCI_MSI |
834 | select GENERIC_IRQ_LEGACY_ALLOC_HWIRQ | ||
834 | 835 | ||
835 | config X86_REROUTE_FOR_BROKEN_BOOT_IRQS | 836 | config X86_REROUTE_FOR_BROKEN_BOOT_IRQS |
836 | bool "Reroute for broken boot IRQs" | 837 | bool "Reroute for broken boot IRQs" |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 992060e09897..b7175c0c552c 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -3010,6 +3010,39 @@ void destroy_irqs(unsigned int irq, unsigned int count) | |||
3010 | destroy_irq(irq + i); | 3010 | destroy_irq(irq + i); |
3011 | } | 3011 | } |
3012 | 3012 | ||
3013 | int arch_setup_hwirq(unsigned int irq, int node) | ||
3014 | { | ||
3015 | struct irq_cfg *cfg; | ||
3016 | unsigned long flags; | ||
3017 | int ret; | ||
3018 | |||
3019 | cfg = alloc_irq_cfg(irq, node); | ||
3020 | if (!cfg) | ||
3021 | return -ENOMEM; | ||
3022 | |||
3023 | raw_spin_lock_irqsave(&vector_lock, flags); | ||
3024 | ret = __assign_irq_vector(irq, cfg, apic->target_cpus()); | ||
3025 | raw_spin_unlock_irqrestore(&vector_lock, flags); | ||
3026 | |||
3027 | if (!ret) | ||
3028 | irq_set_chip_data(irq, cfg); | ||
3029 | else | ||
3030 | free_irq_cfg(irq, cfg); | ||
3031 | return ret; | ||
3032 | } | ||
3033 | |||
3034 | void arch_teardown_hwirq(unsigned int irq) | ||
3035 | { | ||
3036 | struct irq_cfg *cfg = irq_get_chip_data(irq); | ||
3037 | unsigned long flags; | ||
3038 | |||
3039 | free_remapped_irq(irq); | ||
3040 | raw_spin_lock_irqsave(&vector_lock, flags); | ||
3041 | __clear_irq_vector(irq, cfg); | ||
3042 | raw_spin_unlock_irqrestore(&vector_lock, flags); | ||
3043 | free_irq_cfg(irq, cfg); | ||
3044 | } | ||
3045 | |||
3013 | /* | 3046 | /* |
3014 | * MSI message composition | 3047 | * MSI message composition |
3015 | */ | 3048 | */ |