11 Jun, 2009

1 commit

  • There are several pretty much unfixable races in the old ldisc code, especially
    with respect to pty behaviour and also to hangup. It's easier to rewrite the
    code than simply try and patch it up.

    This patch
    - splits the ldisc from the tty (so we will be able to refcount it more cleanly
    later)
    - introduces a mutex lock for ldisc changing on an active device
    - fixes the complete mess that hangup caused
    - implements hopefully correct setldisc/close/hangup locking

    There are still some problems around pty pairs that have always been there but
    at least it is now possible to understand the code and fix further problems.

    This fixes the following known bugs
    - hang up can leak ldisc references
    - hang up may not call open/close on ldisc in a matched way
    - pty/tty pairs can deadlock during an ldisc change
    - reading the ldisc proc files can cause every ldisc to be loaded

    and probably a few other of the mysterious ldisc race reports.

    I'm sure it also adds the odd new one.

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

    Alan Cox
     

01 Apr, 2009

1 commit


17 Oct, 2008

1 commit


14 Oct, 2008

6 commits

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

    Alan Cox
     
  • add_timer() is not supposed to be called when the timer is pending.
    ip2 driver attempts to avoid that condition by setting and resetting
    a flag (TimerOn) in timer function. But there is some gap between
    add_timer() and setting TimerOn.

    This patch fix this problem by using mod_timer() and remove TimerOn
    which has been unnecessary by this change.

    Signed-off-by: Akinobu Mita
    Signed-off-by: Jiri Slaby
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • Cleanup of module_init/exit:
    - mostly whitespace
    - remove empty functions
    - replace c++ comments
    - remove useless prints (module loaded, unloaded)
    - mark the calls as __exit and __init
    - use break; and return; to save some indent levels after it
    - note resource leakage

    It's still mess, but now it's readable.

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

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

    Jiri Slaby
     
  • - do not init .bss zeroed data to zero again (by memset or
    explicit assignment)
    - use char [] instead of char * for string constants

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

    Jiri Slaby
     
  • It's pretty useless to have one setup() function separated along with
    module_init() which only calls a function from ip2main anyway. Get rid
    of ip2base.

    Remove also checks of always-true now.

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

    Jiri Slaby
     

26 Jul, 2008

1 commit


22 Jul, 2008

1 commit


21 Jul, 2008

1 commit

  • Move the line disciplines towards a conventional ->ops arrangement. For
    the moment the actual 'tty_ldisc' struct in the tty is kept as part of
    the tty struct but this can then be changed if it turns out that when it
    all settles down we want to refcount ldiscs separately to the tty.

    Pull the ldisc code out of /proc and put it with our ldisc code.

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

    Alan Cox
     

15 Jul, 2008

2 commits

  • * 'for-2.6.27' of git://git.infradead.org/users/dwmw2/firmware-2.6: (64 commits)
    firmware: convert sb16_csp driver to use firmware loader exclusively
    dsp56k: use request_firmware
    edgeport-ti: use request_firmware()
    edgeport: use request_firmware()
    vicam: use request_firmware()
    dabusb: use request_firmware()
    cpia2: use request_firmware()
    ip2: use request_firmware()
    firmware: convert Ambassador ATM driver to request_firmware()
    whiteheat: use request_firmware()
    ti_usb_3410_5052: use request_firmware()
    emi62: use request_firmware()
    emi26: use request_firmware()
    keyspan_pda: use request_firmware()
    keyspan: use request_firmware()
    ttusb-budget: use request_firmware()
    kaweth: use request_firmware()
    smctr: use request_firmware()
    firmware: convert ymfpci driver to use firmware loader exclusively
    firmware: convert maestro3 driver to use firmware loader exclusively
    ...

    Fix up trivial conflicts with BKL removal in drivers/char/dsp56k.c and
    drivers/char/ip2/ip2main.c manually.

    Linus Torvalds
     
  • Jonathan Corbet
     

10 Jul, 2008

1 commit


21 Jun, 2008

1 commit

  • All of the open() functions which don't need the BKL on their face may
    still depend on its acquisition to serialize opens against driver
    initialization. So make those functions acquire then release the BKL to be
    on the safe side.

    Signed-off-by: Jonathan Corbet

    Jonathan Corbet
     

25 May, 2008

1 commit


30 Apr, 2008

4 commits

  • Signed-off-by: Alan Cox

    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
     
  • - remove i2os.h -- there was only macro to macro renaming or useless
    stuff
    - remove another uselless stuf (NULLFUNC, NULLPTR, YES, NO)
    - use outb/inb directly
    - use locking functions directly
    - don't define another ROUNDUP, use roundup(x, 2) instead
    - some comments and whitespace cleanup
    - remove some commented crap
    - prepend the rest by I2 prefix to not collide with rest of the world
    like in following output (pointed out by akpm)

    In file included from drivers/char/ip2/ip2main.c:128:
    drivers/char/ip2/i2ellis.h:608:1: warning: "COMPLETE" redefined
    In file included from include/net/netns/ipv4.h:8,
    from include/net/net_namespace.h:13,
    from include/linux/seq_file.h:7,
    from include/asm/machdep.h:12,
    from include/asm/pci.h:17,
    from include/linux/pci.h:951,
    from drivers/char/ip2/ip2main.c:95:
    include/net/inet_frag.h:28:1: warning: this is the location of the previous definition

    Signed-off-by: Jiri Slaby
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     
  • Replace init_module and cleanup_module with static functions and
    module_init/module_exit.

    Signed-off-by: Jon Schindler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jon Schindler
     

29 Apr, 2008

2 commits

  • /******************************************/
    /* Remove useless comment, while I am it. */
    /******************************************/

    Signed-off-by: Alexey Dobriyan
    Cc: Greg Kroah-Hartman
    Cc: Jeff Garzik
    Cc: Jeff Dike
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • Remove proc_root export. Creation and removal works well if parent PDE is
    supplied as NULL -- it worked always that way.

    So, one useless export removed and consistency added, some drivers created
    PDEs with &proc_root as parent but removed them as NULL and so on.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

03 Apr, 2008

1 commit


08 Feb, 2008

1 commit


03 Feb, 2008

1 commit


24 Oct, 2007

2 commits


17 Oct, 2007

2 commits


13 Oct, 2007

1 commit


01 Aug, 2007

1 commit

  • CONFIG_PCI=n:

    drivers/char/ip2/ip2main.c: In function `ip2_loadmain':
    drivers/char/ip2/ip2main.c:503: warning: unused variable `status'

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

20 Jul, 2007

1 commit


17 Jul, 2007

1 commit


22 Feb, 2007

1 commit


13 Feb, 2007

2 commits

  • Of kernel subsystems that work with pids the tty layer is probably the largest
    consumer. But it has the nice virtue that the assiation with a session only
    lasts until the session leader exits. Which means that no reference counting
    is required. So using struct pid winds up being a simple optimization to
    avoid hash table lookups.

    In the long term the use of pid_nr also ensures that when we have multiple pid
    spaces mixed everything will work correctly.

    Signed-off-by: Eric W. Biederman
    Cc: Alan Cox
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • - Use timer macros to set function and data members and to modify
    expiration time.
    - Use DEFINE_TIMER for global timers and do not init them at run-time in
    these cases.
    - del_timer_sync is common in most cases -- we want to wait for timer
    function if it's still running.

    Signed-off-by: Jiri Slaby
    Cc: Dave Airlie
    Cc: David Woodhouse
    Cc: Dominik Brodowski
    Cc: Alessandro Zummo
    Cc: Paul Fulghum
    Cc: Kylene Jo Hall
    Cc: Wim Van Sebroeck
    Acked-by: Dmitry Torokhov (Input bits)
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

12 Feb, 2007

1 commit

  • tty_wakeup cleanup

    - remove wake_up_interruptible(&tty->write_wait) surrounding
    tty_wakup(tty);
    - substitute tty->ldisc.write_wakeup(tty) + wake_up() by tty_wakeup(tty);

    Signed-off-by: Jiri Slaby
    Cc: Alan Cox
    Acked-by: Tilman Schmidt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jiri Slaby
     

06 Jan, 2007

1 commit

  • Make this:

    drivers/char/ip2/ip2main.c: In function 'ip2_loadmain':
    drivers/char/ip2/ip2main.c:654: warning: control may reach end of non-void function 'iiSetAddress' being inlined
    drivers/char/ip2/ip2main.c:808: warning: control may reach end of non-void function 'iiInitialize' being inlined

    go away.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

09 Dec, 2006

1 commit

  • This is the grungy swap all the occurrences in the right places patch that
    goes with the updates. At this point we have the same functionality as
    before (except that sgttyb() returns speeds not zero) and are ready to
    begin turning new stuff on providing nobody reports lots of bugs

    If you are a tty driver author converting an out of tree driver the only
    impact should be termios->ktermios name changes for the speed/property
    setting functions from your upper layers.

    If you are implementing your own TCGETS function before then your driver
    was broken already and its about to get a whole lot more painful for you so
    please fix it 8)

    Also fill in c_ispeed/ospeed on init for most devices, although the current
    code will do this for you anyway but I'd like eventually to lose that extra
    paranoia

    [akpm@osdl.org: bluetooth fix]
    [mp3@de.ibm.com: sclp fix]
    [mp3@de.ibm.com: warning fix for tty3270]
    [hugh@veritas.com: fix tty_ioctl powerpc build]
    [jdike@addtoit.com: uml: fix ->set_termios declaration]
    Signed-off-by: Alan Cox
    Signed-off-by: Martin Peschke
    Acked-by: Peter Oberparleiter
    Cc: Cornelia Huck
    Signed-off-by: Hugh Dickins
    Signed-off-by: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox