1. 11 Dec, 2009 3 commits
  2. 27 Sep, 2009 1 commit
    • Dave Young's avatar
      tty: Fix regressions caused by commit b50989dc · f278a2f7
      Dave Young authored
      The following commit made console open fails while booting:
      
      	commit b50989dc
      	Author: Alan Cox <alan@linux.intel.com>
      	Date:   Sat Sep 19 13:13:22 2009 -0700
      
      	tty: make the kref destructor occur asynchronously
      
      Due to tty release routines run in a workqueue now, error like the
      following will be reported while booting:
      
      INIT open /dev/console Input/output error
      
      It also causes hibernation regression to appear as reported at
      http://bugzilla.kernel.org/show_bug.cgi?id=14229
      
      
      
      The reason is that now there's latency issue with closing, but when
      we open a "closing not finished" tty, -EIO will be returned.
      
      Fix it as per the following Alan's suggestion:
      
        Fun but it's actually not a bug and the fix is wrong in itself as
        the port may be closing but not yet being destructed, in which case
        it seems to do the wrong thing.  Opening a tty that is closing (and
        could be closing for long periods) is supposed to return -EIO.
      
        I suspect a better way to deal with this and keep the old console
        timing is to split tty->shutdown into two functions.
      
        tty->shutdown() - called synchronously just before we dump the tty
        onto the waitqueue for destruction
      
        tty->cleanup() - called when the destructor runs.
      
        We would then do the shutdown part which can occur in IRQ context
        fine, before queueing the rest of the release (from tty->magic = 0
        ...  the end) to occur asynchronously
      
        The USB update in -next would then need a call like
      
             if (tty->cleanup)
                     tty->cleanup(tty);
      
        at the top of the async function and the USB shutdown to be split
        between shutdown and cleanup as the USB resource cleanup and final
        tidy cannot occur synchronously as it needs to sleep.
      
        In other words the logic becomes
      
             final kref put
                     make object unfindable
      
             async
                     clean it up
      Signed-off-by: default avatarDave Young <hidave.darkstar@gmail.com>
      [ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ]
      Signed-off-by: default avatar"Rafael J. Wysocki" <rjw@sisk.pl>
      [ Changed serial naming to match new rules, dropped tty_shutdown as per
        comments from Alan Stern  - Linus ]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f278a2f7
  3. 19 Sep, 2009 4 commits
  4. 16 Jun, 2009 1 commit
    • Alan Cox's avatar
      tty: fix sanity check · 1aa4bed8
      Alan Cox authored
      
      
      The WARN_ON() that was added to tty_reopen can be triggered in the specific
      case of a hangup occurring during a re-open of a tty which is not in the
      middle of being otherwise closed.
      
      In that case however the WARN() is bogus as we don't hold the neccessary
      locks to make a correct decision.
      
      The case we should be checking is "if the ldisc is not changing and reopen
      is occuring". We could drop the WARN_ON but for the moment the debug is more
      valuable even if it means taking a mutex as it will find any other cases.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1aa4bed8
  5. 11 Jun, 2009 4 commits
  6. 03 Apr, 2009 2 commits
  7. 01 Apr, 2009 1 commit
  8. 16 Mar, 2009 1 commit
    • Jonathan Corbet's avatar
      Use f_lock to protect f_flags · db1dd4d3
      Jonathan Corbet authored
      
      
      Traditionally, changes to struct file->f_flags have been done under BKL
      protection, or with no protection at all.  This patch causes all f_flags
      changes after file open/creation time to be done under protection of
      f_lock.  This allows the removal of some BKL usage and fixes a number of
      longstanding (if microscopic) races.
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
      db1dd4d3
  9. 27 Jan, 2009 1 commit
  10. 02 Jan, 2009 3 commits
    • Alan Cox's avatar
      pty: simplify resize · fc6f6238
      Alan Cox authored
      
      
      We have special case logic for resizing pty/tty pairs. We also have a per
      driver resize method so for the pty case we should use it.
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fc6f6238
    • Jason Wessel's avatar
      tty: Fix sparse static warning for tty_driver_lookup_tty · a47d545f
      Jason Wessel authored
      
      
      Fixed sparse warning:
      drivers/char/tty_io.c:1216:19: warning: symbol 'tty_driver_lookup_tty' was not declared. Should it be static?
      Signed-off-by: default avatarJason Wessel <jason.wessel@windriver.com>
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a47d545f
    • Joe Peterson's avatar
      n_tty: Fix loss of echoed characters and remove bkl from n_tty · a88a69c9
      Joe Peterson authored
      
      
      Fixes the loss of echoed (and other ldisc-generated characters) when
      the tty is stopped or when the driver output buffer is full (happens
      frequently for input during continuous program output, such as ^C)
      and removes the Big Kernel Lock from the N_TTY line discipline.
      
      Adds an "echo buffer" to the N_TTY line discipline that handles all
      ldisc-generated output (including echoed characters).  Along with the
      loss of characters, this also fixes the associated loss of sync between
      tty output and the ldisc state when characters cannot be immediately
      written to the tty driver.
      
      The echo buffer stores (in addition to characters) state operations that need
      to be done at the time of character output (like management of the column
      position).  This allows echo to cooperate correctly with program output,
      since the ldisc state remains consistent with actual characters written.
      
      Since the echo buffer code now isolates the tty column state code
      to the process_out* and process_echoes functions, we can remove the
      Big Kernel Lock (BKL) and replace it with mutex locks.
      
      Highlights are:
      
      * Handles echo (and other ldisc output) when tty driver buffer is full
        - continuous program output can block echo
      * Saves echo when tty is in stopped state (e.g. ^S)
        - (e.g.: ^Q will correctly cause held characters to be released for output)
      * Control character pairs (e.g. "^C") are treated atomically and not
        split up by interleaved program output
      * Line discipline state is kept consistent with characters sent to
        the tty driver
      * Remove the big kernel lock (BKL) from N_TTY line discipline
      Signed-off-by: default avatarJoe Peterson <joe@skyrush.com>
      Signed-off-by: default avatarAlan Cox <alan@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      a88a69c9
  11. 09 Dec, 2008 1 commit
    • Al Viro's avatar
      Audit: Log TIOCSTI · 1e641743
      Al Viro authored
      
      
      AUDIT_TTY records currently log all data read by processes marked for
      TTY input auditing, even if the data was "pushed back" using the TIOCSTI
      ioctl, not typed by the user.
      
      This patch records all TIOCSTI calls to disambiguate the input.  It
      generates one audit message per character pushed back; considering
      TIOCSTI is used very rarely, this simple solution is probably good
      enough.  (The only program I could find that uses TIOCSTI is mailx/nail
      in "header editing" mode, e.g. using the ~h escape.  mailx is used very
      rarely, and the escapes are used even rarer.)
      Signed-Off-By: default avatarMiloslav Trmac <mitr@redhat.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarJames Morris <jmorris@namei.org>
      1e641743
  12. 01 Dec, 2008 1 commit
  13. 16 Oct, 2008 1 commit
  14. 15 Oct, 2008 1 commit
  15. 13 Oct, 2008 15 commits