lkml.org 
[lkml]   [2003]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectPreemption fixes for x86 MSR driver.
wrmsr is ok, but needs cleans up, second part (rdmsr)
is currently broken.

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/arch/i386/kernel/msr.c linux-2.5/arch/i386/kernel/msr.c
--- bk-linus/arch/i386/kernel/msr.c 2003-04-10 06:01:09.000000000 +0100
+++ linux-2.5/arch/i386/kernel/msr.c 2003-04-06 23:05:55.000000000 +0100
@@ -120,8 +120,6 @@ static inline int do_wrmsr(int cpu, u32
preempt_disable();
if ( cpu == smp_processor_id() ) {
ret = wrmsr_eio(reg, eax, edx);
- preempt_enable();
- return ret;
} else {
cmd.cpu = cpu;
cmd.reg = reg;
@@ -129,17 +127,20 @@ static inline int do_wrmsr(int cpu, u32
cmd.data[1] = edx;

smp_call_function(msr_smp_wrmsr, &cmd, 1, 1);
- preempt_enable();
- return cmd.err;
+ ret = cmd.err;
}
+ preempt_enable();
+ return ret;
}

static inline int do_rdmsr(int cpu, u32 reg, u32 *eax, u32 *edx)
{
struct msr_command cmd;
+ int ret;

+ preempt_disable();
if ( cpu == smp_processor_id() ) {
- return rdmsr_eio(reg, eax, edx);
+ ret = rdmsr_eio(reg, eax, edx);
} else {
cmd.cpu = cpu;
cmd.reg = reg;
@@ -149,8 +150,10 @@ static inline int do_rdmsr(int cpu, u32
*eax = cmd.data[0];
*edx = cmd.data[1];

- return cmd.err;
+ ret = cmd.err;
}
+ preempt_enable();
+ return ret;
}

#else /* ! CONFIG_SMP */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.055 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site