From: Peter Buckingham <peter@pantasys.com>
To: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: [PATCH 2.6] fix duart locking
Date: Wed, 15 Sep 2004 17:19:10 -0700 [thread overview]
Message-ID: <4148DBFE.4020600@pantasys.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 229 bytes --]
Hi Ralf,
the duart code tries to hold a spin lock across a call to
copy_from_user(). This patch releases the spin lock before the call and
reacquires it afterwards.
peter
Signed-off-by: Peter Buckingham <peter@pantasys.com>
[-- Attachment #2: p --]
[-- Type: text/plain, Size: 966 bytes --]
? drivers/i2c/algos/.built-in.o.cmd
? drivers/i2c/algos/.i2c-algo-bit.o.cmd
? drivers/i2c/busses/.built-in.o.cmd
? drivers/i2c/chips/.built-in.o.cmd
? drivers/input/misc/.built-in.o.cmd
? drivers/input/misc/.pcspkr.o.cmd
? drivers/input/misc/.uinput.o.cmd
Index: drivers/char/sb1250_duart.c
===================================================================
RCS file: /home/cvs/linux/drivers/char/sb1250_duart.c,v
retrieving revision 1.23
diff -u -r1.23 sb1250_duart.c
--- drivers/char/sb1250_duart.c 15 Oct 2003 16:19:12 -0000 1.23
+++ drivers/char/sb1250_duart.c 16 Sep 2004 00:10:31 -0000
@@ -326,10 +326,11 @@
if (c <= 0) break;
if (from_user) {
+ spin_unlock_irqrestore(&us->outp_lock, flags);
if (copy_from_user(us->outp_buf + us->outp_tail, buf, c)) {
- spin_unlock_irqrestore(&us->outp_lock, flags);
return -EFAULT;
}
+ spin_lock_irqsave(&us->outp_lock, flags);
} else {
memcpy(us->outp_buf + us->outp_tail, buf, c);
}
reply other threads:[~2004-09-16 0:19 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=4148DBFE.4020600@pantasys.com \
--to=peter@pantasys.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/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