diff options
-rw-r--r-- | arch/x86/include/asm/mpspec.h | 6 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 23 | ||||
-rw-r--r-- | arch/x86/kernel/io_apic.c | 20 |
3 files changed, 44 insertions, 5 deletions
diff --git a/arch/x86/include/asm/mpspec.h b/arch/x86/include/asm/mpspec.h index d22f732eab8f..8c5620147c40 100644 --- a/arch/x86/include/asm/mpspec.h +++ b/arch/x86/include/asm/mpspec.h | |||
@@ -73,6 +73,7 @@ extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, | |||
73 | u32 gsi); | 73 | u32 gsi); |
74 | extern void mp_config_acpi_legacy_irqs(void); | 74 | extern void mp_config_acpi_legacy_irqs(void); |
75 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); | 75 | extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low); |
76 | extern int acpi_probe_gsi(void); | ||
76 | #ifdef CONFIG_X86_IO_APIC | 77 | #ifdef CONFIG_X86_IO_APIC |
77 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, | 78 | extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, |
78 | u32 gsi, int triggering, int polarity); | 79 | u32 gsi, int triggering, int polarity); |
@@ -84,6 +85,11 @@ mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin, | |||
84 | return 0; | 85 | return 0; |
85 | } | 86 | } |
86 | #endif | 87 | #endif |
88 | #else /* !CONFIG_ACPI: */ | ||
89 | static inline int acpi_probe_gsi(void) | ||
90 | { | ||
91 | return 0; | ||
92 | } | ||
87 | #endif /* CONFIG_ACPI */ | 93 | #endif /* CONFIG_ACPI */ |
88 | 94 | ||
89 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) | 95 | #define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS) |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 3efa996b036c..c334fe75dcd6 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -961,6 +961,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base) | |||
961 | nr_ioapics++; | 961 | nr_ioapics++; |
962 | } | 962 | } |
963 | 963 | ||
964 | int __init acpi_probe_gsi(void) | ||
965 | { | ||
966 | int idx; | ||
967 | int gsi; | ||
968 | int max_gsi = 0; | ||
969 | |||
970 | if (acpi_disabled) | ||
971 | return 0; | ||
972 | |||
973 | if (!acpi_ioapic) | ||
974 | return 0; | ||
975 | |||
976 | max_gsi = 0; | ||
977 | for (idx = 0; idx < nr_ioapics; idx++) { | ||
978 | gsi = mp_ioapic_routing[idx].gsi_end; | ||
979 | |||
980 | if (gsi > max_gsi) | ||
981 | max_gsi = gsi; | ||
982 | } | ||
983 | |||
984 | return max_gsi + 1; | ||
985 | } | ||
986 | |||
964 | static void assign_to_mp_irq(struct mpc_intsrc *m, | 987 | static void assign_to_mp_irq(struct mpc_intsrc *m, |
965 | struct mpc_intsrc *mp_irq) | 988 | struct mpc_intsrc *mp_irq) |
966 | { | 989 | { |
diff --git a/arch/x86/kernel/io_apic.c b/arch/x86/kernel/io_apic.c index 855209a1b172..56e51eb551a5 100644 --- a/arch/x86/kernel/io_apic.c +++ b/arch/x86/kernel/io_apic.c | |||
@@ -3824,14 +3824,24 @@ int __init io_apic_get_redir_entries (int ioapic) | |||
3824 | 3824 | ||
3825 | void __init probe_nr_irqs_gsi(void) | 3825 | void __init probe_nr_irqs_gsi(void) |
3826 | { | 3826 | { |
3827 | int idx; | ||
3828 | int nr = 0; | 3827 | int nr = 0; |
3829 | 3828 | ||
3830 | for (idx = 0; idx < nr_ioapics; idx++) | 3829 | nr = acpi_probe_gsi(); |
3831 | nr += io_apic_get_redir_entries(idx) + 1; | 3830 | if (nr > nr_irqs_gsi) { |
3832 | |||
3833 | if (nr > nr_irqs_gsi) | ||
3834 | nr_irqs_gsi = nr; | 3831 | nr_irqs_gsi = nr; |
3832 | } else { | ||
3833 | /* for acpi=off or acpi is not compiled in */ | ||
3834 | int idx; | ||
3835 | |||
3836 | nr = 0; | ||
3837 | for (idx = 0; idx < nr_ioapics; idx++) | ||
3838 | nr += io_apic_get_redir_entries(idx) + 1; | ||
3839 | |||
3840 | if (nr > nr_irqs_gsi) | ||
3841 | nr_irqs_gsi = nr; | ||
3842 | } | ||
3843 | |||
3844 | printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi); | ||
3835 | } | 3845 | } |
3836 | 3846 | ||
3837 | #ifdef CONFIG_SPARSE_IRQ | 3847 | #ifdef CONFIG_SPARSE_IRQ |