mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* make x86 MSR driver preempt safe
@ 2003-03-24 16:41 davej
  0 siblings, 0 replies; only message in thread
From: davej @ 2003-03-24 16:41 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

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-03-08 09:56:25.000000000 +0000
+++ linux-2.5/arch/i386/kernel/msr.c	2003-03-18 21:22:30.000000000 +0000
@@ -115,9 +115,13 @@ static void msr_smp_rdmsr(void *cmd_bloc
 static inline int do_wrmsr(int cpu, u32 reg, u32 eax, u32 edx)
 {
   struct msr_command cmd;
+  int ret;
 
+  preempt_disable();
   if ( cpu == smp_processor_id() ) {
-    return wrmsr_eio(reg, eax, edx);
+    ret = wrmsr_eio(reg, eax, edx);
+    preempt_enable();
+    return ret;
   } else {
     cmd.cpu = cpu;
     cmd.reg = reg;
@@ -125,6 +129,7 @@ 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;
   }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-03-24 16:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-24 16:41 make x86 MSR driver preempt safe davej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®