1. 24 10月, 2016 1 次提交
  2. 05 5月, 2016 1 次提交
  3. 01 5月, 2016 5 次提交
  4. 29 1月, 2016 1 次提交
  5. 18 10月, 2015 1 次提交
    • P
      tty: Remove ASYNC_CLOSING checks in open()/hangup() methods · fef062cb
      Peter Hurley 提交于
      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: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fef062cb
  6. 01 6月, 2015 1 次提交
  7. 30 5月, 2015 1 次提交
  8. 11 7月, 2014 2 次提交
    • P
      char: synclink: Remove WARN_ON for bad port count · 69fee688
      Peter Hurley 提交于
      tty_port_close_start() already validates the port counts and issues
      a diagnostic if validation fails.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      69fee688
    • P
      tty: Remove tty_hung_up_p() tests from tty drivers' open() · e359a4e3
      Peter Hurley 提交于
      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: NPeter Hurley <peter@hurleysoftware.com>
      Acked-by: NJesper Nilsson <jesper.nilsson@axis.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e359a4e3
  9. 17 4月, 2014 1 次提交
  10. 08 1月, 2014 1 次提交
    • A
      tty: synclink: avoid sleep_on race · b8c98ae4
      Arnd Bergmann 提交于
      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: NArnd Bergmann <arnd@arndb.de>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b8c98ae4
  11. 27 7月, 2013 1 次提交
  12. 04 6月, 2013 1 次提交
  13. 23 2月, 2013 1 次提交
  14. 09 2月, 2013 2 次提交
  15. 30 1月, 2013 1 次提交
    • J
      TTY: synclink: Convert + to | for bit operations · 9fe8074b
      Joe Perches 提交于
      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: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9fe8074b
  16. 19 1月, 2013 1 次提交
    • J
      tty: Added a CONFIG_TTY option to allow removal of TTY · 4f73bc4d
      Joe Millenbach 提交于
      The option allows you to remove TTY and compile without errors. This
      saves space on systems that won't support TTY interfaces anyway.
      bloat-o-meter output is below.
      
      The bulk of this patch consists of Kconfig changes adding "depends on
      TTY" to various serial devices and similar drivers that require the TTY
      layer.  Ideally, these dependencies would occur on a common intermediate
      symbol such as SERIO, but most drivers "select SERIO" rather than
      "depends on SERIO", and "select" does not respect dependencies.
      
      bloat-o-meter output comparing our previous minimal to new minimal by
      removing TTY.  The list is filtered to not show removed entries with awk
      '$3 != "-"' as the list was very long.
      
      add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350)
      function                                     old     new   delta
      chr_dev_init                                 166     170      +4
      allow_signal                                  80      82      +2
      static.__warned                              143     142      -1
      disallow_signal                               63      62      -1
      __set_special_pids                            95      94      -1
      unregister_console                           126     121      -5
      start_kernel                                 546     541      -5
      register_console                             593     588      -5
      copy_from_user                                45      40      -5
      sys_setsid                                   128     120      -8
      sys_vhangup                                   32      19     -13
      do_exit                                     1543    1526     -17
      bitmap_zero                                   60      40     -20
      arch_local_irq_save                          137     117     -20
      release_task                                 674     652     -22
      static.spin_unlock_irqrestore                308     260     -48
      Signed-off-by: NJoe Millenbach <jmillenbach@gmail.com>
      Reviewed-by: NJamey Sharp <jamey@minilop.net>
      Reviewed-by: NJosh Triplett <josh@joshtriplett.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4f73bc4d
  17. 16 1月, 2013 6 次提交
  18. 16 11月, 2012 1 次提交
    • J
      TTY: call tty_port_destroy in the rest of drivers · 191c5f10
      Jiri Slaby 提交于
      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: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      191c5f10
  19. 27 9月, 2012 1 次提交
  20. 06 9月, 2012 1 次提交
  21. 17 8月, 2012 1 次提交
  22. 14 8月, 2012 4 次提交
  23. 20 7月, 2012 1 次提交
  24. 29 3月, 2012 1 次提交
  25. 09 3月, 2012 2 次提交