Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116457
b: refs/heads/master
c: 9d6a4d0
h: refs/heads/master
i:
  116455: d28a934
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 16, 2008
1 parent 689f4d8 commit 7f68066
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 43 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f09cd20a24c5f13c571bc73ddcd47be0af3b70f
refs/heads/master: 9d6a4d0823b3b8e29156f5e698b5a68687afad32
25 changes: 0 additions & 25 deletions trunk/arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,29 +957,6 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
nr_ioapics++;
}

int get_nr_irqs_via_madt(void)
{
int idx;
int nr = 0;

for (idx = 0; idx < nr_ioapics; idx++) {
if (mp_ioapic_routing[idx].gsi_end > nr)
nr = mp_ioapic_routing[idx].gsi_end;
}

nr++;

/* double it for hotplug and msi and nmi */
nr <<= 1;

/* something wrong ? */
if (nr < 32)
nr = 32;

return nr;

}

static void assign_to_mp_irq(struct mp_config_intsrc *m,
struct mp_config_intsrc *mp_irq)
{
Expand Down Expand Up @@ -1278,8 +1255,6 @@ static int __init acpi_parse_madt_ioapic_entries(void)
}


nr_irqs = get_nr_irqs_via_madt();

count =
acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_parse_int_src_ovr,
nr_irqs);
Expand Down
43 changes: 30 additions & 13 deletions trunk/arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3596,6 +3596,36 @@ int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev)
}
#endif /* CONFIG_HT_IRQ */

int __init io_apic_get_redir_entries (int ioapic)
{
union IO_APIC_reg_01 reg_01;
unsigned long flags;

spin_lock_irqsave(&ioapic_lock, flags);
reg_01.raw = io_apic_read(ioapic, 1);
spin_unlock_irqrestore(&ioapic_lock, flags);

return reg_01.bits.entries;
}

int __init probe_nr_irqs(void)
{
int idx;
int nr = 0;

for (idx = 0; idx < nr_ioapics; idx++)
nr += io_apic_get_redir_entries(idx);

/* double it for hotplug and msi and nmi */
nr <<= 1;

/* something wrong ? */
if (nr < 32)
nr = 32;

return nr;
}

/* --------------------------------------------------------------------------
ACPI-based IOAPIC Configuration
-------------------------------------------------------------------------- */
Expand Down Expand Up @@ -3690,19 +3720,6 @@ int __init io_apic_get_version(int ioapic)
}
#endif

int __init io_apic_get_redir_entries (int ioapic)
{
union IO_APIC_reg_01 reg_01;
unsigned long flags;

spin_lock_irqsave(&ioapic_lock, flags);
reg_01.raw = io_apic_read(ioapic, 1);
spin_unlock_irqrestore(&ioapic_lock, flags);

return reg_01.bits.entries;
}


int io_apic_set_pci_routing (int ioapic, int pin, int irq, int triggering, int polarity)
{
if (!IO_APIC_IRQ(irq)) {
Expand Down
6 changes: 3 additions & 3 deletions trunk/arch/x86/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,15 +1069,15 @@ void __init setup_arch(char **cmdline_p)
prefill_possible_map();

#ifdef CONFIG_X86_64
/* need to wait for nr_cpu_ids settle down */
if (nr_irqs == NR_IRQS)
nr_irqs = 32 * nr_cpu_ids + 224;
init_cpu_to_node();
#endif

init_apic_mappings();
ioapic_init_mappings();

/* need to wait for io_apic is mapped */
nr_irqs = probe_nr_irqs();

kvm_guest_init();

e820_reserve_resources();
Expand Down
8 changes: 8 additions & 0 deletions trunk/include/asm-x86/io_apic.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <linux/types.h>
#include <asm/mpspec.h>
#include <asm/apicdef.h>
#include <asm/irq_vectors.h>

/*
* Intel IO-APIC support for SMP and UP systems.
Expand Down Expand Up @@ -187,10 +188,17 @@ extern void restore_IO_APIC_setup(void);
extern void reinit_intr_remapped_IO_APIC(int);
#endif

extern int probe_nr_irqs(void);

#else /* !CONFIG_X86_IO_APIC */
#define io_apic_assign_pci_irqs 0
static const int timer_through_8259 = 0;
static inline void ioapic_init_mappings(void) { }

static inline int probe_nr_irqs(void)
{
return NR_IRQS;
}
#endif

#endif /* ASM_X86__IO_APIC_H */
1 change: 0 additions & 1 deletion trunk/include/asm-x86/mpspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ extern void mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger,
u32 gsi);
extern void mp_config_acpi_legacy_irqs(void);
extern int mp_register_gsi(u32 gsi, int edge_level, int active_high_low);
extern int get_nr_irqs_via_madt(void);
#ifdef CONFIG_X86_IO_APIC
extern int mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
u32 gsi, int triggering, int polarity);
Expand Down

0 comments on commit 7f68066

Please sign in to comment.