1. 04 May, 2016 1 commit
  2. 30 Apr, 2016 6 commits
  3. 07 Feb, 2016 1 commit
  4. 28 Jan, 2016 1 commit
  5. 17 Oct, 2015 1 commit
    • Peter Hurley's avatar
      tty: Remove ASYNC_CLOSING checks in open()/hangup() methods · fef062cb
      Peter Hurley authored
      Since at least before 2.6.30, tty drivers that do not drop the tty lock
      while closing cannot observe ASYNC_CLOSING set while holding the
      tty lock; this includes the tty driver's open() and hangup() methods,
      since the tty core calls these methods holding the tty lock.
      
      For these drivers, waiting for ASYNC_CLOSING to clear while opening
      is not required, since this condition cannot occur. Similarly, even
      when the open() method drops and reacquires the tty lock after
      blocking, ASYNC_CLOSING cannot be set (again, for drivers that
      do not drop the tty lock while closing).
      
      Now that tty port drivers no longer drop the tty lock while closing
      (since 'tty: Remove tty_wait_until_sent_from_close()'), the same
      conditions apply: waiting for ASYNC_CLOSING to clear while opening
      is not required, nor is re-checking ASYNC_CLOSING after dropping and
      reacquiring the tty lock while blocking (eg., in *_block_til_ready()).
      
      Note: The ASYNC_CLOSING flag state is still maintained since several
      bitrotting drivers use it for (dubious) other purposes.
      Signed-off-by: 's avatarPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fef062cb
  6. 10 May, 2015 1 commit
  7. 10 Jul, 2014 1 commit
    • Peter Hurley's avatar
      tty: Remove tty_hung_up_p() tests from tty drivers' open() · e359a4e3
      Peter Hurley authored
      Since at least before 2.6.30, it has not been possible to observe
      a hung up file pointer in a tty driver's open() method unless/until
      the driver open() releases the tty_lock() (eg., before blocking).
      
      This is because tty_open() adds the file pointer while holding
      the tty_lock() _and_ doesn't release the lock until after calling
      the tty driver's open() method. [ Before tty_lock(), this was
      lock_kernel(). ]
      
      Since __tty_hangup() first waits on the tty_lock() before
      enumerating and hanging up the open file pointers, either
      __tty_hangup() will wait for the tty_lock() or tty_open() will
      not yet have added the file pointer. For example,
      
      CPU 0                          |  CPU 1
                                     |
      tty_open                       |  __tty_hangup
        ..                           |    ..
        tty_lock                     |    ..
        tty_reopen                   |    tty_lock  / blocks
        ..                           |
        tty_add_file(tty, filp)      |
        ..                           |
        tty->ops->open(tty, filp)    |
          tty_port_open              |
            tty_port_block_til_ready |
              ..                     |
              while (1)              |
                ..                   |
                tty_unlock           |    / unblocks
                schedule             |    for each filp on tty->tty_files
                                     |      f_ops = tty_hung_up_fops;
                                     |    ..
                                     |    tty_unlock
                tty_lock             |
        ..                           |
        tty_unlock                   |
      
      Note that since tty_port_block_til_ready() and similar drop
      the tty_lock while blocking, when woken, the file pointer
      must then be tested for having been hung up.
      
      Also, fix bit-rotted drivers that used extra_count to track the
      port->count bump.
      
      CC: Mikael Starvik <starvik@axis.com>
      CC: Samuel Ortiz <samuel@sortiz.org>
      CC: "David S. Miller" <davem@davemloft.net>
      Signed-off-by: 's avatarPeter Hurley <peter@hurleysoftware.com>
      Acked-by: 's avatarJesper Nilsson <jesper.nilsson@axis.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e359a4e3
  8. 17 Mar, 2014 1 commit
  9. 07 Jan, 2014 1 commit
    • Arnd Bergmann's avatar
      tty: synclink: avoid sleep_on race · b8c98ae4
      Arnd Bergmann authored
      The four variants of the synclink driver use the same code in their
      open() callback to wait for a port in process of being closed,
      using interruptible_sleep_on, which is racy and going away soon.
      
      Making things worse, these functions hold the BTM while doing so,
      which means that if we ever enter this code path, we cannot actually
      continue since the other thread that is in process of closing the
      port can no longer get the BTM.
      
      This addresses both issues by using wait_event_interruptible_tty()
      instead.
      Signed-off-by: 's avatarArnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8c98ae4
  10. 24 Jul, 2013 1 commit
  11. 12 Apr, 2013 1 commit
  12. 29 Jan, 2013 1 commit
    • Joe Perches's avatar
      TTY: synclink: Convert + to | for bit operations · 9fe8074b
      Joe Perches authored
      Dan Carpenter noticed a missing set of parentheses
      around a multiple field addition.
      
      https://lkml.org/lkml/2013/1/27/166
      
      His original commit message:
      
      There is a kind of precedence problem here, but it doesn't affect how
      the code works because ->serial_signals is unsigned char.  We want to
      clear two flags here.
      
      #define SerialSignal_RTS            0x20     /* Request to Send */
      #define SerialSignal_DTR            0x80     /* Data Terminal Ready */
      
      Without the parenthesis then it does:
      
      	info->serial_signals &= 0x5f;
      
      With the parenthesis it does:
      
      	info->serial_signals &= 0xffffff5f;
      
      info->serial_signals is an unsigned char so the two statements are
      equivalent, but it's cleaner to add the parenthesis.  In other dtr_rts()
      functions the parenthesis are there so this makes it more consistent.
      
      Other changes:
      
      Convert all + uses to | for these bit operations.
      
      Reorder the multiple fields for consistency.
      Update the comments too.
      Reported-by: 's avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: 's avatarJoe Perches <joe@perches.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fe8074b
  13. 15 Jan, 2013 5 commits
  14. 21 Nov, 2012 3 commits
  15. 15 Nov, 2012 1 commit
    • Jiri Slaby's avatar
      TTY: call tty_port_destroy in the rest of drivers · 191c5f10
      Jiri Slaby authored
      After commit "TTY: move tty buffers to tty_port", the tty buffers are
      not freed in some drivers. This is because tty_port_destructor is not
      called whenever a tty_port is freed. This was an assumption I counted
      with but was unfortunately untrue. So fix the drivers to fulfil this
      assumption.
      
      To be sure, the TTY buffers (and later some stuff) are gone along with
      the tty_port, we have to call tty_port_destroy at tear-down places.
      This is mostly where the structure containing a tty_port is freed.
      This patch does exactly that -- put tty_port_destroy at those places.
      Signed-off-by: 's avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      191c5f10
  16. 05 Sep, 2012 1 commit
  17. 13 Aug, 2012 1 commit
  18. 10 Aug, 2012 1 commit
    • Alan Cox's avatar
      tty: localise the lock · 89c8d91e
      Alan Cox authored
      The termios and other changes mean the other protections needed on the driver
      tty arrays should be adequate. Turn it all back on.
      
      This contains pieces folded in from the fixes made to the original patches
      
      | From: Geert Uytterhoeven <geert@linux-m68k.org>	(fix m68k)
      | From: Paul Gortmaker <paul.gortmaker@windriver.com>	(fix cris)
      | From: Jiri Kosina <jkosina@suze.cz>			(lockdep)
      | From: Eric Dumazet <eric.dumazet@gmail.com>		(lockdep)
      Signed-off-by: 's avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      89c8d91e
  19. 16 Jul, 2012 2 commits
  20. 06 Jul, 2012 1 commit
    • Alan Cox's avatar
      tty: localise the lock · f5e3bcc5
      Alan Cox authored
      The termios and other changes mean the other protections needed on the driver
      tty arrays should be adequate. Turn it all back on.
      
      This contains pieces folded in from the fixes made to the original patches
      
      | From: Geert Uytterhoeven <geert@linux-m68k.org>	(fix m68k)
      | From: Paul Gortmaker <paul.gortmaker@windriver.com>	(fix cris)
      | From: Jiri Kosina <jkosina@suze.cz>			(lockdep)
      | From: Eric Dumazet <eric.dumazet@gmail.com>		(lockdep)
      Signed-off-by: 's avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f5e3bcc5
  21. 02 Jun, 2012 1 commit
    • Linus Torvalds's avatar
      tty: Revert the tty locking series, it needs more work · f309532b
      Linus Torvalds authored
      This reverts the tty layer change to use per-tty locking, because it's
      not correct yet, and fixing it will require some more deep surgery.
      
      The main revert is d29f3ef3 ("tty_lock: Localise the lock"), but
      there are several smaller commits that built upon it, they also get
      reverted here. The list of reverted commits is:
      
        fde86d31 - tty: add lockdep annotations
        8f6576ad - tty: fix ldisc lock inversion trace
        d3ca8b64 - pty: Fix lock inversion
        b1d679af - tty: drop the pty lock during hangup
        abcefe5f - tty/amiserial: Add missing argument for tty_unlock()
        fd11b42e - cris: fix missing tty arg in wait_event_interruptible_tty call
        d29f3ef3 - tty_lock: Localise the lock
      
      The revert had a trivial conflict in the 68360serial.c staging driver
      that got removed in the meantime.
      Signed-off-by: 's avatarLinus Torvalds <torvalds@linux-foundation.org>
      f309532b
  22. 04 May, 2012 1 commit
  23. 28 Mar, 2012 1 commit
  24. 08 Mar, 2012 2 commits
  25. 12 Jan, 2012 1 commit
  26. 29 Sep, 2011 1 commit
  27. 31 Mar, 2011 1 commit