Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=13424f6514f6444554a103362dd9d31eabbbdc54
Commit:     13424f6514f6444554a103362dd9d31eabbbdc54
Parent:     0a4b2ccc555fa2ca6873d60219047104e4805d45
Author:     Venki Pallipadi <[EMAIL PROTECTED]>
AuthorDate: Wed May 23 15:42:13 2007 -0700
Committer:  Dave Jones <[EMAIL PROTECTED]>
CommitDate: Tue May 29 16:56:40 2007 -0400

    [CPUFREQ] acpi-cpufreq: Proper ReadModifyWrite of PERF_CTL MSR
    
    During recent acpi-cpufreq changes, writing to PERF_CTL msr
    changed from RMW of entire 64 bit to RMW of low 32 bit and clearing of
    upper 32 bit. Fix it back to do a proper RMW of the MSR.
    
    Signed-off-by: Venkatesh Pallipadi <[EMAIL PROTECTED]>
    Signed-off-by: Dave Jones <[EMAIL PROTECTED]>
---
 arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c 
b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
index 10baa35..18c8b67 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi-cpufreq.c
@@ -167,11 +167,13 @@ static void do_drv_read(struct drv_cmd *cmd)
 
 static void do_drv_write(struct drv_cmd *cmd)
 {
-       u32 h = 0;
+       u32 lo, hi;
 
        switch (cmd->type) {
        case SYSTEM_INTEL_MSR_CAPABLE:
-               wrmsr(cmd->addr.msr.reg, cmd->val, h);
+               rdmsr(cmd->addr.msr.reg, lo, hi);
+               lo = (lo & ~INTEL_MSR_RANGE) | (cmd->val & INTEL_MSR_RANGE);
+               wrmsr(cmd->addr.msr.reg, lo, hi);
                break;
        case SYSTEM_IO_CAPABLE:
                acpi_os_write_port((acpi_io_address)cmd->addr.io.port,
@@ -372,7 +374,6 @@ static int acpi_cpufreq_target(struct cpufreq_policy 
*policy,
        struct cpufreq_freqs freqs;
        cpumask_t online_policy_cpus;
        struct drv_cmd cmd;
-       unsigned int msr;
        unsigned int next_state = 0; /* Index into freq_table */
        unsigned int next_perf_state = 0; /* Index into perf table */
        unsigned int i;
@@ -417,11 +418,7 @@ static int acpi_cpufreq_target(struct cpufreq_policy 
*policy,
        case SYSTEM_INTEL_MSR_CAPABLE:
                cmd.type = SYSTEM_INTEL_MSR_CAPABLE;
                cmd.addr.msr.reg = MSR_IA32_PERF_CTL;
-               msr =
-                   (u32) perf->states[next_perf_state].
-                   control & INTEL_MSR_RANGE;
-               cmd.val = get_cur_val(online_policy_cpus);
-               cmd.val = (cmd.val & ~INTEL_MSR_RANGE) | msr;
+               cmd.val = (u32) perf->states[next_perf_state].control;
                break;
        case SYSTEM_IO_CAPABLE:
                cmd.type = SYSTEM_IO_CAPABLE;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to