aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/tty_driver.h
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-09-10 15:06:31 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-09-23 21:19:35 -0700
commitf9e053dcfc02b0ad29daec8524fb1afe09774976 (patch)
tree2d930c2d89b011b40c03eeb13ee6f431cb602d3f /include/linux/tty_driver.h
parenttty: Convert tty_struct bitfield to ints (diff)
downloadlinux-dev-f9e053dcfc02b0ad29daec8524fb1afe09774976.tar.xz
linux-dev-f9e053dcfc02b0ad29daec8524fb1afe09774976.zip
tty: Serialize tty flow control changes with flow_lock
Without serialization, the flow control state can become inverted wrt. the actual hardware state. For example, CPU 0 | CPU 1 stop_tty() | lock ctrl_lock | tty->stopped = 1 | unlock ctrl_lock | | start_tty() | lock ctrl_lock | tty->stopped = 0 | unlock ctrl_lock | driver->start() driver->stop() | In this case, the flow control state now indicates the tty has been started, but the actual hardware state has actually been stopped. Introduce tty->flow_lock spinlock to serialize tty flow control changes. Split out unlocked __start_tty()/__stop_tty() flavors for use by ioctl(TCXONC) in follow-on patch. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/tty_driver.h')
-rw-r--r--include/linux/tty_driver.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index e48c608a8fa8..92e337c18839 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -152,6 +152,8 @@
* This routine notifies the tty driver that it should stop
* outputting characters to the tty device.
*
+ * Called with ->flow_lock held. Serialized with start() method.
+ *
* Optional:
*
* Note: Call stop_tty not this method.
@@ -161,6 +163,8 @@
* This routine notifies the tty driver that it resume sending
* characters to the tty device.
*
+ * Called with ->flow_lock held. Serialized with stop() method.
+ *
* Optional:
*
* Note: Call start_tty not this method.