28 Sep, 2009

1 commit

  • The following commit made console open fails while booting:

    commit b50989dc444599c8b21edc23536fc305f4e9b7d5
    Author: Alan Cox
    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: Dave Young
    [ rjw: Rebased on top of 2.6.31-git, reworked the changelog. ]
    Signed-off-by: "Rafael J. Wysocki"
    [ Changed serial naming to match new rules, dropped tty_shutdown as per
    comments from Alan Stern - Linus ]
    Signed-off-by: Linus Torvalds

    Dave Young
     

11 Jun, 2009

1 commit

  • The tty throttling code can race due to the lock drops. It takes very high
    loads but this has been observed and verified by Rob Duncan.

    The basic problem is that on an SMP box we can go

    CPU #1 CPU #2
    need to throttle ?
    suppose we should buffer space cleared
    are we throttled
    yes ? - unthrottle
    call throttle method

    This changeet take the termios lock to protect against this. The termios
    lock isn't the initial obvious candidate but many implementations of throttle
    methods already need to poke around their own termios structures (and nobody
    really locks them against a racing change of flow control).

    This does mean that anyone who is setting tty->low_latency = 1 and then
    calling tty_flip_buffer_push from their unthrottle method is going to end up
    collapsing in a pile of locks. However we've removed all the known bogus
    users of low_latency = 1 and such use isn't safe anyway for other reasons so
    catching it would be an improvement.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

07 Apr, 2009

1 commit


01 Apr, 2009

2 commits

  • struct tty_operations::proc_fops took it's place and there is one less
    create_proc_read_entry() user now!

    Signed-off-by: Alexey Dobriyan
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Used for gradual switch of TTY drivers from using ->read_proc which helps
    with gradual switch from ->read_proc for the whole tree.

    As side effect, fix possible race condition when ->data initialized after
    PDE is hooked into proc tree.

    ->proc_fops takes precedence over ->read_proc.

    Signed-off-by: Alexey Dobriyan
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

03 Jan, 2009

1 commit

  • 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: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

14 Oct, 2008

6 commits

  • Pass-in 'inode' or 'tty' parameter to devpts interfaces. With multiple
    devpts instances, these parameters will be used in subsequent patches
    to identify the instance of devpts mounted. The parameters also help
    simplify devpts implementation.

    Changelog[v3]:
    - minor changes due to merge with ttydev updates
    - rename parameters to emphasize they are ptmx or pts inodes
    - pass-in tty_struct * to devpts_pty_kill() (this will help
    cleanup the get_node() call in a subsequent patch)

    Signed-off-by: Sukadev Bhattiprolu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Sukadev Bhattiprolu
     
  • We have the lookup operation abstracted which is nice for pty cleanup but
    we really want to abstract the add/remove entries as well so that we can
    pull the pty code out of the tty core and create a clear defined interface
    for the tty driver table.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Fix up the naming, style and extract some bits of code into the driver
    specific code

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Right now there are various drivers that try to use tty->count to know when
    they get the final close. Aristeau Rozanski showed while debugging the vt
    sysfs race that this isn't entirely safe.

    Instead of driver side tricks to work around this introduce a shutdown which
    is called when the tty is being destructed. This also means that the shutdown
    method is tied into the refcounting.

    Use this to rework the console close/sysfs logic.

    Remove lots of special case code from the tty core code. The pty code can now
    have a shutdown() method that replaces the special case hackery in the tree
    free up paths.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • We need a way to describe the various additional modes and flow control
    features that random weird hardware shows up and software such as wine
    wants to emulate as Windows supports them.

    TCGETX/TCSETX and the termiox ioctl are a SYS5 extension that we might as
    well adopt. This patches adds the structures and the basic ioctl interfaces
    when the TCGETX etc defines are added for an architecture. Drivers wishing
    to use this stuff need to add new methods.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

16 Aug, 2008

1 commit

  • This moves it to being a tty operation. That removes special cases and now
    also means that resize can be picked up by um and other non vt consoles
    which may have a resize operation.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

23 Jul, 2008

1 commit

  • Some hardware needs to do break handling itself and may have partial
    support only. Make break_ctl return an error code. Add a tty driver flag
    so you can indicate driver hardware side break support.

    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Alan Cox
     

24 Jun, 2008

1 commit


30 Apr, 2008

2 commits

  • Something Arjan suggested which allows us to clean up the code nicely

    Signed-off-by: Alan Cox
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • - Operations are now a shared const function block as with most other Linux
    objects

    - Introduce wrappers for some optional functions to get consistent behaviour

    - Wrap put_char which used to be patched by the tty layer

    - Document which functions are needed/optional

    - Make put_char report success/fail

    - Cache the driver->ops pointer in the tty as tty->ops

    - Remove various surplus lock calls we no longer need

    - Remove proc_write method as noted by Alexey Dobriyan

    - Introduce some missing sanity checks where certain driver/ldisc
    combinations would oops as they didn't check needed methods were present

    [akpm@linux-foundation.org: fix fs/compat_ioctl.c build]
    [akpm@linux-foundation.org: fix isicom]
    [akpm@linux-foundation.org: fix arch/ia64/hp/sim/simserial.c build]
    [akpm@linux-foundation.org: fix kgdb]
    Signed-off-by: Alan Cox
    Acked-by: Greg Kroah-Hartman
    Cc: Jason Wessel
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

18 Apr, 2008

1 commit

  • polled console handling support, to access a console in an irq-less
    way while in debug or irq context.

    absolutely zero impact as long as CONFIG_CONSOLE_POLL is disabled.
    (which is the default)

    [ jan.kiszka@siemens.com: lots of cleanups ]
    [ mingo@elte.hu: redesign, splitups, cleanups. ]

    Signed-off-by: Jason Wessel
    Signed-off-by: Ingo Molnar
    Signed-off-by: Jan Kiszka
    Reviewed-by: Thomas Gleixner

    Jason Wessel
     

11 May, 2007

1 commit

  • Add compat_ioctl method for tty code to allow processing of 32 bit ioctl
    calls on 64 bit systems by tty core, tty drivers, and line disciplines.

    Based on patch by Arnd Bergmann:
    http://www.uwsg.iu.edu/hypermail/linux/kernel/0511.0/1732.html

    [akpm@linux-foundation.org: make things static]
    Signed-off-by: Paul Fulghum
    Acked-by: Arnd Bergmann
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Fulghum
     

09 Dec, 2006

1 commit

  • This is the core of the switch to the new framework. I've split it from the
    driver patches which are mostly search/replace and would encourage people to
    give this one a good hard stare.

    The references to BOTHER and ISHIFT are the termios values that must be
    defined by a platform once it wants to turn on "new style" ioctl support. The
    code patches here ensure that providing

    1. The termios overlays the ktermios in memory
    2. The only new kernel only fields are c_ispeed/c_ospeed (or none)

    the existing behaviour is retained. This is true for the patches at this
    point in time.

    Future patches will define BOTHER, ISHIFT and enable newer termios structures
    for each architecture, and once they are all done some of the ifdefs also
    vanish.

    [akpm@osdl.org: warning fix]
    [akpm@osdl.org: IRDA fix]
    Signed-off-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     

02 Oct, 2006

1 commit

  • As part of an SMP cleanliness pass over UML, I consted a bunch of
    structures in order to not have to document their locking. One of these
    structures was a struct tty_operations. In order to const it in UML
    without introducing compiler complaints, the declaration of
    tty_set_operations needs to be changed, and then all of its callers need to
    be fixed.

    This patch declares all struct tty_operations in the tree as const. In all
    cases, they are static and used only as input to tty_set_operations. As an
    extra check, I ran an i386 allyesconfig build which produced no extra
    warnings.

    53 drivers are affected. I checked the history of a bunch of them, and in
    most cases, there have been only a handful of maintenance changes in the
    last six months. serial_core.c was the busiest one that I looked at.

    Signed-off-by: Jeff Dike
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

27 Jun, 2006

2 commits


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds