From: Peter Hurley <peter@hurleysoftware.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>,
Vincent Pillet <vincentx.pillet@intel.com>,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Peter Hurley <peter@hurleysoftware.com>
Subject: [PATCH tty-next] tty: Fix unsafe bit ops in tty_throttle_safe/unthrottle_safe
Date: Mon, 15 Apr 2013 11:06:06 -0400 [thread overview]
Message-ID: <1366038366-8332-1-git-send-email-peter@hurleysoftware.com> (raw)
In-Reply-To: <1362576053-1295-2-git-send-email-peter@hurleysoftware.com>
tty->flags needs to be atomically modified.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
drivers/tty/tty_ioctl.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/tty_ioctl.c b/drivers/tty/tty_ioctl.c
index 2febed5..ce67f2c 100644
--- a/drivers/tty/tty_ioctl.c
+++ b/drivers/tty/tty_ioctl.c
@@ -156,7 +156,7 @@ int tty_throttle_safe(struct tty_struct *tty)
if (tty->flow_change != TTY_THROTTLE_SAFE)
ret = 1;
else {
- __set_bit(TTY_THROTTLED, &tty->flags);
+ set_bit(TTY_THROTTLED, &tty->flags);
if (tty->ops->throttle)
tty->ops->throttle(tty);
}
@@ -187,7 +187,7 @@ int tty_unthrottle_safe(struct tty_struct *tty)
if (tty->flow_change != TTY_UNTHROTTLE_SAFE)
ret = 1;
else {
- __clear_bit(TTY_THROTTLED, &tty->flags);
+ clear_bit(TTY_THROTTLED, &tty->flags);
if (tty->ops->unthrottle)
tty->ops->unthrottle(tty);
}
--
1.8.1.2
next prev parent reply other threads:[~2013-04-15 15:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-06 13:20 [PATCH 1/3] n_tty: Inline check_unthrottle() at lone call site Peter Hurley
2013-03-06 13:20 ` [PATCH 2/3] tty: Add safe tty throttle/unthrottle functions Peter Hurley
2013-04-15 15:06 ` Peter Hurley [this message]
2013-03-06 13:20 ` [PATCH 3/3] n_tty: Fix stuck throttled driver Peter Hurley
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=1366038366-8332-1-git-send-email-peter@hurleysoftware.com \
--to=peter@hurleysoftware.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=vincentx.pillet@intel.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;
as well as URLs for NNTP newsgroup(s).