Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / drivers / tty / tty_ioctl.c
index 9ce20df8a2c8d086a2bbb889d4a47d079008731e..03ba081c577251a0947466b79f23b36b359b51c1 100644 (file)
@@ -151,7 +151,7 @@ int tty_throttle_safe(struct tty_struct *tty)
 {
        int ret = 0;
 
-       down_write(&tty->termios_rwsem);
+       mutex_lock(&tty->throttle_mutex);
        if (!test_bit(TTY_THROTTLED, &tty->flags)) {
                if (tty->flow_change != TTY_THROTTLE_SAFE)
                        ret = 1;
@@ -161,7 +161,7 @@ int tty_throttle_safe(struct tty_struct *tty)
                                tty->ops->throttle(tty);
                }
        }
-       up_write(&tty->termios_rwsem);
+       mutex_unlock(&tty->throttle_mutex);
 
        return ret;
 }
@@ -182,7 +182,7 @@ int tty_unthrottle_safe(struct tty_struct *tty)
 {
        int ret = 0;
 
-       down_write(&tty->termios_rwsem);
+       mutex_lock(&tty->throttle_mutex);
        if (test_bit(TTY_THROTTLED, &tty->flags)) {
                if (tty->flow_change != TTY_UNTHROTTLE_SAFE)
                        ret = 1;
@@ -192,7 +192,7 @@ int tty_unthrottle_safe(struct tty_struct *tty)
                                tty->ops->unthrottle(tty);
                }
        }
-       up_write(&tty->termios_rwsem);
+       mutex_unlock(&tty->throttle_mutex);
 
        return ret;
 }