Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163042
b: refs/heads/master
c: f3a0867
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and H. Peter Anvin committed Jul 29, 2009
1 parent 86c114c commit dc44b4e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 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: d0c87d1f61704ed589fc0788bedd753632340e98
refs/heads/master: f3a0867b12e0cf1512c0bd0665f2339fc75ed2a8
4 changes: 4 additions & 0 deletions trunk/arch/x86/include/asm/msr-index.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@

#define THERM_STATUS_PROCHOT (1 << 0)

#define MSR_THERM2_CTL 0x0000019d

#define MSR_THERM2_CTL_TM_SELECT (1ULL << 16)

#define MSR_IA32_MISC_ENABLE 0x000001a0

/* MISC_ENABLE bits: architectural */
Expand Down
13 changes: 10 additions & 3 deletions trunk/arch/x86/kernel/cpu/mcheck/therm_throt.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,6 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
return;
}

if (cpu_has(c, X86_FEATURE_TM2) && (l & MSR_IA32_MISC_ENABLE_TM2))
tm2 = 1;

/* Check whether a vector already exists */
if (h & APIC_VECTOR_MASK) {
printk(KERN_DEBUG
Expand All @@ -264,6 +261,16 @@ void intel_init_thermal(struct cpuinfo_x86 *c)
return;
}

/* early Pentium M models use different method for enabling TM2 */
if (cpu_has(c, X86_FEATURE_TM2)) {
if (c->x86 == 6 && (c->x86_model == 9 || c->x86_model == 13)) {
rdmsr(MSR_THERM2_CTL, l, h);
if (l & MSR_THERM2_CTL_TM_SELECT)
tm2 = 1;
} else if (l & MSR_IA32_MISC_ENABLE_TM2)
tm2 = 1;
}

/* We'll mask the thermal vector in the lapic till we're ready: */
h = THERMAL_APIC_VECTOR | APIC_DM_FIXED | APIC_LVT_MASKED;
apic_write(APIC_LVTTHMR, h);
Expand Down

0 comments on commit dc44b4e

Please sign in to comment.