diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2014-10-16 15:33:25 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-05 19:34:36 -0500 |
commit | 6054c16e80318d32ee084a0f5620a863ae8cea33 (patch) | |
tree | ad3c3d6cbcc440714a529d772ca6be940b6acbbc /drivers/tty/n_tty.c | |
parent | 4d8c1dff6a8666a2e18a7d5954c2156be0d5b152 (diff) |
tty: Use spin_lock_irq() for ctrl_lock when interrupts enabled
Interrupts are enabled in the n_tty_read() loop, ioctl(TIOCPKT)
and pty driver flush_buffer() routine; no need to save and restore
local interrupt state.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Reviewed-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 89c4cee253e3..d521058ee55a 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -2128,7 +2128,6 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, | |||
2128 | int minimum, time; | 2128 | int minimum, time; |
2129 | ssize_t retval = 0; | 2129 | ssize_t retval = 0; |
2130 | long timeout; | 2130 | long timeout; |
2131 | unsigned long flags; | ||
2132 | int packet; | 2131 | int packet; |
2133 | 2132 | ||
2134 | c = job_control(tty, file); | 2133 | c = job_control(tty, file); |
@@ -2174,10 +2173,10 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, | |||
2174 | unsigned char cs; | 2173 | unsigned char cs; |
2175 | if (b != buf) | 2174 | if (b != buf) |
2176 | break; | 2175 | break; |
2177 | spin_lock_irqsave(&tty->link->ctrl_lock, flags); | 2176 | spin_lock_irq(&tty->link->ctrl_lock); |
2178 | cs = tty->link->ctrl_status; | 2177 | cs = tty->link->ctrl_status; |
2179 | tty->link->ctrl_status = 0; | 2178 | tty->link->ctrl_status = 0; |
2180 | spin_unlock_irqrestore(&tty->link->ctrl_lock, flags); | 2179 | spin_unlock_irq(&tty->link->ctrl_lock); |
2181 | if (tty_put_user(tty, cs, b++)) { | 2180 | if (tty_put_user(tty, cs, b++)) { |
2182 | retval = -EFAULT; | 2181 | retval = -EFAULT; |
2183 | b--; | 2182 | b--; |