Commit 80749df4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86/apic changes from Ingo Molnar:
 "Smaller fixes and cleanups"

* 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  x86/api: Rename mp_register_lapic in a comment
  x86/irq/i8259: Fix incorrect comment
  x86: dt: Use linear irq domain for ioapic(s)
parents 2fff5664 57c078ce
...@@ -656,7 +656,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu) ...@@ -656,7 +656,7 @@ static int __cpuinit _acpi_map_lsapic(acpi_handle handle, int *pcpu)
acpi_register_lapic(physid, ACPI_MADT_ENABLED); acpi_register_lapic(physid, ACPI_MADT_ENABLED);
/* /*
* If mp_register_lapic successfully generates a new logical cpu * If acpi_register_lapic successfully generates a new logical cpu
* number, then the following will get us exactly what was mapped * number, then the following will get us exactly what was mapped
*/ */
cpumask_andnot(new_map, cpu_present_mask, tmp_map); cpumask_andnot(new_map, cpu_present_mask, tmp_map);
......
...@@ -342,6 +342,47 @@ const struct irq_domain_ops ioapic_irq_domain_ops = { ...@@ -342,6 +342,47 @@ const struct irq_domain_ops ioapic_irq_domain_ops = {
.xlate = ioapic_xlate, .xlate = ioapic_xlate,
}; };
static void dt_add_ioapic_domain(unsigned int ioapic_num,
struct device_node *np)
{
struct irq_domain *id;
struct mp_ioapic_gsi *gsi_cfg;
int ret;
int num;
gsi_cfg = mp_ioapic_gsi_routing(ioapic_num);
num = gsi_cfg->gsi_end - gsi_cfg->gsi_base + 1;
id = irq_domain_add_linear(np, num, &ioapic_irq_domain_ops,
(void *)ioapic_num);
BUG_ON(!id);
if (gsi_cfg->gsi_base == 0) {
/*
* The first NR_IRQS_LEGACY irq descs are allocated in
* early_irq_init() and need just a mapping. The
* remaining irqs need both. All of them are preallocated
* and assigned so we can keep the 1:1 mapping which the ioapic
* is having.
*/
ret = irq_domain_associate_many(id, 0, 0, NR_IRQS_LEGACY);
if (ret)
pr_err("Error mapping legacy IRQs: %d\n", ret);
if (num > NR_IRQS_LEGACY) {
ret = irq_create_strict_mappings(id, NR_IRQS_LEGACY,
NR_IRQS_LEGACY, num - NR_IRQS_LEGACY);
if (ret)
pr_err("Error creating mapping for the "
"remaining IRQs: %d\n", ret);
}
irq_set_default_host(id);
} else {
ret = irq_create_strict_mappings(id, gsi_cfg->gsi_base, 0, num);
if (ret)
pr_err("Error creating IRQ mapping: %d\n", ret);
}
}
static void __init ioapic_add_ofnode(struct device_node *np) static void __init ioapic_add_ofnode(struct device_node *np)
{ {
struct resource r; struct resource r;
...@@ -356,15 +397,7 @@ static void __init ioapic_add_ofnode(struct device_node *np) ...@@ -356,15 +397,7 @@ static void __init ioapic_add_ofnode(struct device_node *np)
for (i = 0; i < nr_ioapics; i++) { for (i = 0; i < nr_ioapics; i++) {
if (r.start == mpc_ioapic_addr(i)) { if (r.start == mpc_ioapic_addr(i)) {
struct irq_domain *id; dt_add_ioapic_domain(i, np);
struct mp_ioapic_gsi *gsi_cfg;
gsi_cfg = mp_ioapic_gsi_routing(i);
id = irq_domain_add_legacy(np, 32, gsi_cfg->gsi_base, 0,
&ioapic_irq_domain_ops,
(void*)i);
BUG_ON(!id);
return; return;
} }
} }
......
...@@ -263,7 +263,7 @@ static void i8259A_shutdown(void) ...@@ -263,7 +263,7 @@ static void i8259A_shutdown(void)
* out of. * out of.
*/ */
outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */ outb(0xff, PIC_MASTER_IMR); /* mask all of 8259A-1 */
outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-1 */ outb(0xff, PIC_SLAVE_IMR); /* mask all of 8259A-2 */
} }
static struct syscore_ops i8259_syscore_ops = { static struct syscore_ops i8259_syscore_ops = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment