diff options
author | Joerg Roedel <joro@8bytes.org> | 2012-09-26 06:44:37 -0400 |
---|---|---|
committer | Joerg Roedel <joro@8bytes.org> | 2013-01-28 04:48:30 -0500 |
commit | 71054d8841b442bb3d8be60bde2bfac0483c19da (patch) | |
tree | 0a5ba9b3ee50448bb94691b3622870c09c5e7f64 /arch/x86/kernel | |
parent | afcc8a40a090f7a65d3b72bac1a26fc6dbb63b10 (diff) |
x86, hpet: Introduce x86_msi_ops.setup_hpet_msi
This function pointer can be overwritten by the IRQ
remapping code. The irq_remapping_enabled check can be
removed from default_setup_hpet_msi.
Signed-off-by: Joerg Roedel <joro@8bytes.org>
Acked-by: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/hpet.c | 2 | ||||
-rw-r--r-- | arch/x86/kernel/x86_init.c | 10 |
3 files changed, 8 insertions, 12 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index a18e27a8882a..e7b87630c13d 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -3399,18 +3399,12 @@ static struct irq_chip hpet_msi_type = { | |||
3399 | .irq_retrigger = ioapic_retrigger_irq, | 3399 | .irq_retrigger = ioapic_retrigger_irq, |
3400 | }; | 3400 | }; |
3401 | 3401 | ||
3402 | int arch_setup_hpet_msi(unsigned int irq, unsigned int id) | 3402 | int default_setup_hpet_msi(unsigned int irq, unsigned int id) |
3403 | { | 3403 | { |
3404 | struct irq_chip *chip = &hpet_msi_type; | 3404 | struct irq_chip *chip = &hpet_msi_type; |
3405 | struct msi_msg msg; | 3405 | struct msi_msg msg; |
3406 | int ret; | 3406 | int ret; |
3407 | 3407 | ||
3408 | if (irq_remapping_enabled) { | ||
3409 | ret = setup_hpet_msi_remapped(irq, id); | ||
3410 | if (ret) | ||
3411 | return ret; | ||
3412 | } | ||
3413 | |||
3414 | ret = msi_compose_msg(NULL, irq, &msg, id); | 3408 | ret = msi_compose_msg(NULL, irq, &msg, id); |
3415 | if (ret < 0) | 3409 | if (ret < 0) |
3416 | return ret; | 3410 | return ret; |
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index e28670f9a589..da85a8e830a1 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -478,7 +478,7 @@ static int hpet_msi_next_event(unsigned long delta, | |||
478 | 478 | ||
479 | static int hpet_setup_msi_irq(unsigned int irq) | 479 | static int hpet_setup_msi_irq(unsigned int irq) |
480 | { | 480 | { |
481 | if (arch_setup_hpet_msi(irq, hpet_blockid)) { | 481 | if (x86_msi.setup_hpet_msi(irq, hpet_blockid)) { |
482 | destroy_irq(irq); | 482 | destroy_irq(irq); |
483 | return -EINVAL; | 483 | return -EINVAL; |
484 | } | 484 | } |
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c index ee4af8b04841..0357eee65673 100644 --- a/arch/x86/kernel/x86_init.c +++ b/arch/x86/kernel/x86_init.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/time.h> | 19 | #include <asm/time.h> |
20 | #include <asm/irq.h> | 20 | #include <asm/irq.h> |
21 | #include <asm/io_apic.h> | 21 | #include <asm/io_apic.h> |
22 | #include <asm/hpet.h> | ||
22 | #include <asm/pat.h> | 23 | #include <asm/pat.h> |
23 | #include <asm/tsc.h> | 24 | #include <asm/tsc.h> |
24 | #include <asm/iommu.h> | 25 | #include <asm/iommu.h> |
@@ -111,10 +112,11 @@ struct x86_platform_ops x86_platform = { | |||
111 | 112 | ||
112 | EXPORT_SYMBOL_GPL(x86_platform); | 113 | EXPORT_SYMBOL_GPL(x86_platform); |
113 | struct x86_msi_ops x86_msi = { | 114 | struct x86_msi_ops x86_msi = { |
114 | .setup_msi_irqs = native_setup_msi_irqs, | 115 | .setup_msi_irqs = native_setup_msi_irqs, |
115 | .teardown_msi_irq = native_teardown_msi_irq, | 116 | .teardown_msi_irq = native_teardown_msi_irq, |
116 | .teardown_msi_irqs = default_teardown_msi_irqs, | 117 | .teardown_msi_irqs = default_teardown_msi_irqs, |
117 | .restore_msi_irqs = default_restore_msi_irqs, | 118 | .restore_msi_irqs = default_restore_msi_irqs, |
119 | .setup_hpet_msi = default_setup_hpet_msi, | ||
118 | }; | 120 | }; |
119 | 121 | ||
120 | struct x86_io_apic_ops x86_io_apic_ops = { | 122 | struct x86_io_apic_ops x86_io_apic_ops = { |