x86: Add pci_init_irq to x86_init
Moorestown wants to reuse pcibios_init_irq but needs to provide its own implementation of pci_enable_irq. After we distangled the init we can move the init_irq call to x86_init and remove the pci_enable_irq != NULL check in pcibios_init_irq. pci_enable_irq is compile time initialized to pirq_enable_irq and the special cases which override it (visws and acpi) set the x86_init function pointer to noop. That allows MSRT to override pci_enable_irq and otherwise run pcibios_init_irq unmodified. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> LKML-Reference: <43F901BD926A4E43B106BF17856F07559FB80CFF@orsmsx508.amr.corp.intel.com> Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Jacob Pan <jacob.jun.pan@intel.com> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
b72d0db9dd
commit
ab3b37937e
|
@ -110,7 +110,7 @@ extern void __init dmi_check_skip_isa_align(void);
|
||||||
|
|
||||||
/* some common used subsys_initcalls */
|
/* some common used subsys_initcalls */
|
||||||
extern int __init pci_acpi_init(void);
|
extern int __init pci_acpi_init(void);
|
||||||
extern int __init pcibios_irq_init(void);
|
extern void __init pcibios_irq_init(void);
|
||||||
extern int __init pcibios_init(void);
|
extern int __init pcibios_init(void);
|
||||||
extern int pci_legacy_init(void);
|
extern int pci_legacy_init(void);
|
||||||
|
|
||||||
|
@ -187,6 +187,8 @@ static inline void mmio_config_writel(void __iomem *pos, u32 val)
|
||||||
# else
|
# else
|
||||||
# define x86_default_pci_init pci_legacy_init
|
# define x86_default_pci_init pci_legacy_init
|
||||||
# endif
|
# endif
|
||||||
|
# define x86_default_pci_init_irq pcibios_irq_init
|
||||||
#else
|
#else
|
||||||
# define x86_default_pci_init NULL
|
# define x86_default_pci_init NULL
|
||||||
|
# define x86_default_pci_init_irq NULL
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -101,9 +101,11 @@ struct x86_init_iommu {
|
||||||
/*
|
/*
|
||||||
* struct x86_init_pci - platform specific pci init functions
|
* struct x86_init_pci - platform specific pci init functions
|
||||||
* @init: platform specific pci init
|
* @init: platform specific pci init
|
||||||
|
* @init_irq: platform specific pci irq init
|
||||||
*/
|
*/
|
||||||
struct x86_init_pci {
|
struct x86_init_pci {
|
||||||
int (*init)(void);
|
int (*init)(void);
|
||||||
|
void (*init_irq)(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -238,6 +238,7 @@ void __init visws_early_detect(void)
|
||||||
x86_init.irqs.trap_init = visws_trap_init;
|
x86_init.irqs.trap_init = visws_trap_init;
|
||||||
x86_init.timers.timer_init = visws_time_init;
|
x86_init.timers.timer_init = visws_time_init;
|
||||||
x86_init.pci.init = pci_visws_init;
|
x86_init.pci.init = pci_visws_init;
|
||||||
|
x86_init.pci.init_irq = x86_init_noop;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Install reboot quirks:
|
* Install reboot quirks:
|
||||||
|
|
|
@ -74,6 +74,7 @@ struct x86_init_ops x86_init __initdata = {
|
||||||
|
|
||||||
.pci = {
|
.pci = {
|
||||||
.init = x86_default_pci_init,
|
.init = x86_default_pci_init,
|
||||||
|
.init_irq = x86_default_pci_init_irq,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -289,6 +289,7 @@ int __init pci_acpi_init(void)
|
||||||
acpi_irq_penalty_init();
|
acpi_irq_penalty_init();
|
||||||
pcibios_enable_irq = acpi_pci_irq_enable;
|
pcibios_enable_irq = acpi_pci_irq_enable;
|
||||||
pcibios_disable_irq = acpi_pci_irq_disable;
|
pcibios_disable_irq = acpi_pci_irq_disable;
|
||||||
|
x86_init.pci.init_irq = x86_init_noop;
|
||||||
|
|
||||||
if (pci_routeirq) {
|
if (pci_routeirq) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -53,7 +53,7 @@ struct irq_router_handler {
|
||||||
int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device);
|
int (*probe)(struct irq_router *r, struct pci_dev *router, u16 device);
|
||||||
};
|
};
|
||||||
|
|
||||||
int (*pcibios_enable_irq)(struct pci_dev *dev) = NULL;
|
int (*pcibios_enable_irq)(struct pci_dev *dev) = pirq_enable_irq;
|
||||||
void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
|
void (*pcibios_disable_irq)(struct pci_dev *dev) = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1110,12 +1110,12 @@ static struct dmi_system_id __initdata pciirq_dmi_table[] = {
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
int __init pcibios_irq_init(void)
|
void __init pcibios_irq_init(void)
|
||||||
{
|
{
|
||||||
DBG(KERN_DEBUG "PCI: IRQ init\n");
|
DBG(KERN_DEBUG "PCI: IRQ init\n");
|
||||||
|
|
||||||
if (pcibios_enable_irq || raw_pci_ops == NULL)
|
if (raw_pci_ops == NULL)
|
||||||
return 0;
|
return;
|
||||||
|
|
||||||
dmi_check_system(pciirq_dmi_table);
|
dmi_check_system(pciirq_dmi_table);
|
||||||
|
|
||||||
|
@ -1142,8 +1142,6 @@ int __init pcibios_irq_init(void)
|
||||||
pirq_table = NULL;
|
pirq_table = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
pcibios_enable_irq = pirq_enable_irq;
|
|
||||||
|
|
||||||
pcibios_fixup_irqs();
|
pcibios_fixup_irqs();
|
||||||
|
|
||||||
if (io_apic_assign_pci_irqs && pci_routeirq) {
|
if (io_apic_assign_pci_irqs && pci_routeirq) {
|
||||||
|
@ -1157,8 +1155,6 @@ int __init pcibios_irq_init(void)
|
||||||
for_each_pci_dev(dev)
|
for_each_pci_dev(dev)
|
||||||
pirq_enable_irq(dev);
|
pirq_enable_irq(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pirq_penalize_isa_irq(int irq, int active)
|
static void pirq_penalize_isa_irq(int irq, int active)
|
||||||
|
|
|
@ -60,7 +60,7 @@ int __init pci_subsys_init(void)
|
||||||
pci_legacy_init();
|
pci_legacy_init();
|
||||||
|
|
||||||
pcibios_fixup_peer_bridges();
|
pcibios_fixup_peer_bridges();
|
||||||
pcibios_irq_init();
|
x86_init.pci.init_irq();
|
||||||
pcibios_init();
|
pcibios_init();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue