From: davej@codemonkey.org.uk
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: make x86 MSR driver preempt safe
Date: Mon, 24 Mar 2003 16:41:45 +0000 [thread overview]
Message-ID: <200303241641.h2OGfw35008204@deviant.impure.org.uk> (raw)
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;
}
}
reply other threads:[~2003-03-24 16:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200303241641.h2OGfw35008204@deviant.impure.org.uk \
--to=davej@codemonkey.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®