Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 136687
b: refs/heads/master
c: cc6c500
h: refs/heads/master
i:
  136685: 8c9b907
  136683: 050482b
  136679: 8b7573a
  136671: 74e4fd1
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Feb 9, 2009
1 parent ebcdbea commit aa38a2f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 6 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: f72dccace737df74d04a96461785a3ad61724b9f
refs/heads/master: cc6c50066ec1ac98bef97117e2f078bb89bbccc7
6 changes: 6 additions & 0 deletions trunk/arch/x86/include/asm/mpspec.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ 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 acpi_probe_gsi(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 All @@ -84,6 +85,11 @@ mp_config_acpi_gsi(unsigned char number, unsigned int devfn, u8 pin,
return 0;
}
#endif
#else /* !CONFIG_ACPI: */
static inline int acpi_probe_gsi(void)
{
return 0;
}
#endif /* CONFIG_ACPI */

#define PHYSID_ARRAY_SIZE BITS_TO_LONGS(MAX_APICS)
Expand Down
23 changes: 23 additions & 0 deletions trunk/arch/x86/kernel/acpi/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,29 @@ void __init mp_register_ioapic(int id, u32 address, u32 gsi_base)
nr_ioapics++;
}

int __init acpi_probe_gsi(void)
{
int idx;
int gsi;
int max_gsi = 0;

if (acpi_disabled)
return 0;

if (!acpi_ioapic)
return 0;

max_gsi = 0;
for (idx = 0; idx < nr_ioapics; idx++) {
gsi = mp_ioapic_routing[idx].gsi_end;

if (gsi > max_gsi)
max_gsi = gsi;
}

return max_gsi + 1;
}

static void assign_to_mp_irq(struct mpc_intsrc *m,
struct mpc_intsrc *mp_irq)
{
Expand Down
20 changes: 15 additions & 5 deletions trunk/arch/x86/kernel/io_apic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3824,14 +3824,24 @@ int __init io_apic_get_redir_entries (int ioapic)

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

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

if (nr > nr_irqs_gsi)
nr = acpi_probe_gsi();
if (nr > nr_irqs_gsi) {
nr_irqs_gsi = nr;
} else {
/* for acpi=off or acpi is not compiled in */
int idx;

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

if (nr > nr_irqs_gsi)
nr_irqs_gsi = nr;
}

printk(KERN_DEBUG "nr_irqs_gsi: %d\n", nr_irqs_gsi);
}

#ifdef CONFIG_SPARSE_IRQ
Expand Down

0 comments on commit aa38a2f

Please sign in to comment.