diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-26 18:10:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-26 18:10:56 -0400 |
commit | f3845f3f6081b97ebc4dc905e097c07e868017b5 (patch) | |
tree | 03825cf80cfc678b70ca94a9c8f364b27b5374e8 /arch/x86/kernel | |
parent | 054319b5e255c0671012a5a89b344a7d55cda80c (diff) | |
parent | 035a02c1e1de31888e8b6adac0ff667971ac04db (diff) |
Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, amd: Restrict usage of c1e_idle()
x86: Fix placement of FIX_OHCI1394_BASE
x86: Handle legacy PIC interrupts on all the cpu's
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r-- | arch/x86/kernel/apic/io_apic.c | 8 | ||||
-rw-r--r-- | arch/x86/kernel/irqinit.c | 22 | ||||
-rw-r--r-- | arch/x86/kernel/process.c | 32 | ||||
-rw-r--r-- | arch/x86/kernel/smpboot.c | 2 |
4 files changed, 55 insertions, 9 deletions
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index e4e0ddcb1546..463de9a858ad 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -1268,6 +1268,14 @@ void __setup_vector_irq(int cpu) | |||
1268 | /* Mark the inuse vectors */ | 1268 | /* Mark the inuse vectors */ |
1269 | for_each_irq_desc(irq, desc) { | 1269 | for_each_irq_desc(irq, desc) { |
1270 | cfg = desc->chip_data; | 1270 | cfg = desc->chip_data; |
1271 | |||
1272 | /* | ||
1273 | * If it is a legacy IRQ handled by the legacy PIC, this cpu | ||
1274 | * will be part of the irq_cfg's domain. | ||
1275 | */ | ||
1276 | if (irq < legacy_pic->nr_legacy_irqs && !IO_APIC_IRQ(irq)) | ||
1277 | cpumask_set_cpu(cpu, cfg->domain); | ||
1278 | |||
1271 | if (!cpumask_test_cpu(cpu, cfg->domain)) | 1279 | if (!cpumask_test_cpu(cpu, cfg->domain)) |
1272 | continue; | 1280 | continue; |
1273 | vector = cfg->vector; | 1281 | vector = cfg->vector; |
diff --git a/arch/x86/kernel/irqinit.c b/arch/x86/kernel/irqinit.c index ef257fc2921b..f01d390f9c5b 100644 --- a/arch/x86/kernel/irqinit.c +++ b/arch/x86/kernel/irqinit.c | |||
@@ -141,6 +141,28 @@ void __init init_IRQ(void) | |||
141 | x86_init.irqs.intr_init(); | 141 | x86_init.irqs.intr_init(); |
142 | } | 142 | } |
143 | 143 | ||
144 | /* | ||
145 | * Setup the vector to irq mappings. | ||
146 | */ | ||
147 | void setup_vector_irq(int cpu) | ||
148 | { | ||
149 | #ifndef CONFIG_X86_IO_APIC | ||
150 | int irq; | ||
151 | |||
152 | /* | ||
153 | * On most of the platforms, legacy PIC delivers the interrupts on the | ||
154 | * boot cpu. But there are certain platforms where PIC interrupts are | ||
155 | * delivered to multiple cpu's. If the legacy IRQ is handled by the | ||
156 | * legacy PIC, for the new cpu that is coming online, setup the static | ||
157 | * legacy vector to irq mapping: | ||
158 | */ | ||
159 | for (irq = 0; irq < legacy_pic->nr_legacy_irqs; irq++) | ||
160 | per_cpu(vector_irq, cpu)[IRQ0_VECTOR + irq] = irq; | ||
161 | #endif | ||
162 | |||
163 | __setup_vector_irq(cpu); | ||
164 | } | ||
165 | |||
144 | static void __init smp_intr_init(void) | 166 | static void __init smp_intr_init(void) |
145 | { | 167 | { |
146 | #ifdef CONFIG_SMP | 168 | #ifdef CONFIG_SMP |
diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c index ad9540676fcc..28ad9f4d8b94 100644 --- a/arch/x86/kernel/process.c +++ b/arch/x86/kernel/process.c | |||
@@ -526,21 +526,37 @@ static int __cpuinit mwait_usable(const struct cpuinfo_x86 *c) | |||
526 | } | 526 | } |
527 | 527 | ||
528 | /* | 528 | /* |
529 | * Check for AMD CPUs, which have potentially C1E support | 529 | * Check for AMD CPUs, where APIC timer interrupt does not wake up CPU from C1e. |
530 | * For more information see | ||
531 | * - Erratum #400 for NPT family 0xf and family 0x10 CPUs | ||
532 | * - Erratum #365 for family 0x11 (not affected because C1e not in use) | ||
530 | */ | 533 | */ |
531 | static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) | 534 | static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c) |
532 | { | 535 | { |
536 | u64 val; | ||
533 | if (c->x86_vendor != X86_VENDOR_AMD) | 537 | if (c->x86_vendor != X86_VENDOR_AMD) |
534 | return 0; | 538 | goto no_c1e_idle; |
535 | |||
536 | if (c->x86 < 0x0F) | ||
537 | return 0; | ||
538 | 539 | ||
539 | /* Family 0x0f models < rev F do not have C1E */ | 540 | /* Family 0x0f models < rev F do not have C1E */ |
540 | if (c->x86 == 0x0f && c->x86_model < 0x40) | 541 | if (c->x86 == 0x0F && c->x86_model >= 0x40) |
541 | return 0; | 542 | return 1; |
542 | 543 | ||
543 | return 1; | 544 | if (c->x86 == 0x10) { |
545 | /* | ||
546 | * check OSVW bit for CPUs that are not affected | ||
547 | * by erratum #400 | ||
548 | */ | ||
549 | rdmsrl(MSR_AMD64_OSVW_ID_LENGTH, val); | ||
550 | if (val >= 2) { | ||
551 | rdmsrl(MSR_AMD64_OSVW_STATUS, val); | ||
552 | if (!(val & BIT(1))) | ||
553 | goto no_c1e_idle; | ||
554 | } | ||
555 | return 1; | ||
556 | } | ||
557 | |||
558 | no_c1e_idle: | ||
559 | return 0; | ||
544 | } | 560 | } |
545 | 561 | ||
546 | static cpumask_var_t c1e_mask; | 562 | static cpumask_var_t c1e_mask; |
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index a02e80c3c54b..06d98ae5a802 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -247,7 +247,7 @@ static void __cpuinit smp_callin(void) | |||
247 | /* | 247 | /* |
248 | * Need to setup vector mappings before we enable interrupts. | 248 | * Need to setup vector mappings before we enable interrupts. |
249 | */ | 249 | */ |
250 | __setup_vector_irq(smp_processor_id()); | 250 | setup_vector_irq(smp_processor_id()); |
251 | /* | 251 | /* |
252 | * Get our bogomips. | 252 | * Get our bogomips. |
253 | * | 253 | * |