14 Dec, 2006

2 commits

  • tty_ldisc_deref() should only be called when tty_ldisc_ref() succeeds
    otherwise it triggers a BUG(). There's already a function
    tty_ldisc_flush() that flushes properly.

    Signed-off-by: Dan Carpenter
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Carpenter
     
  • 24ec839c431eb79bb8f6abc00c4e1eb3b8c4d517 causes this:

    WARNING: "get_current_tty" [drivers/s390/char/fs3270.ko] undefined!

    Cc: Martin Schwidefsky
    Acked-by: Peter Zijlstra
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     

09 Dec, 2006

5 commits

  • 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
     
  • Add an anonymous union and ((deprecated)) to catch direct usage of the
    session field.

    [akpm@osdl.org: fix various missed conversions]
    [jdike@addtoit.com: fix UML bug]
    Signed-off-by: Jeff Dike
    Cc: Cedric Le Goater
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cedric Le Goater
     
  • Replace occurences of task->signal->session by a new process_session() helper
    routine.

    It will be useful for pid namespaces to abstract the session pid number.

    Signed-off-by: Cedric Le Goater
    Cc: Kirill Korotaev
    Cc: Eric W. Biederman
    Cc: Herbert Poetzl
    Cc: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cedric Le Goater
     
  • Signed-off-by: Josef Sipek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Josef Sipek
     
  • Fix the locking of signal->tty.

    Use ->sighand->siglock to protect ->signal->tty; this lock is already used
    by most other members of ->signal/->sighand. And unless we are 'current'
    or the tasklist_lock is held we need ->siglock to access ->signal anyway.

    (NOTE: sys_unshare() is broken wrt ->sighand locking rules)

    Note that tty_mutex is held over tty destruction, so while holding
    tty_mutex any tty pointer remains valid. Otherwise the lifetime of ttys
    are governed by their open file handles. This leaves some holes for tty
    access from signal->tty (or any other non file related tty access).

    It solves the tty SLAB scribbles we were seeing.

    (NOTE: the change from group_send_sig_info to __group_send_sig_info needs to
    be examined by someone familiar with the security framework, I think
    it is safe given the SEND_SIG_PRIV from other __group_send_sig_info
    invocations)

    [schwidefsky@de.ibm.com: 3270 fix]
    [akpm@osdl.org: various post-viro fixes]
    Signed-off-by: Peter Zijlstra
    Acked-by: Alan Cox
    Cc: Oleg Nesterov
    Cc: Prarit Bhargava
    Cc: Chris Wright
    Cc: Roland McGrath
    Cc: Stephen Smalley
    Cc: James Morris
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Martin Schwidefsky
    Cc: Jan Kara
    Signed-off-by: Martin Schwidefsky
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Zijlstra
     

05 Dec, 2006

1 commit


02 Dec, 2006

1 commit


22 Nov, 2006

2 commits

  • Pass the work_struct pointer to the work function rather than context data.
    The work function can use container_of() to work out the data.

    For the cases where the container of the work_struct may go away the moment the
    pending bit is cleared, it is made possible to defer the release of the
    structure by deferring the clearing of the pending bit.

    To make this work, an extra flag is introduced into the management side of the
    work_struct. This governs auto-release of the structure upon execution.

    Ordinarily, the work queue executor would release the work_struct for further
    scheduling or deallocation by clearing the pending bit prior to jumping to the
    work function. This means that, unless the driver makes some guarantee itself
    that the work_struct won't go away, the work function may not access anything
    else in the work_struct or its container lest they be deallocated.. This is a
    problem if the auxiliary data is taken away (as done by the last patch).

    However, if the pending bit is *not* cleared before jumping to the work
    function, then the work function *may* access the work_struct and its container
    with no problems. But then the work function must itself release the
    work_struct by calling work_release().

    In most cases, automatic release is fine, so this is the default. Special
    initiators exist for the non-auto-release case (ending in _NAR).

    Signed-Off-By: David Howells

    David Howells
     
  • Separate delayable work items from non-delayable work items be splitting them
    into a separate structure (delayed_work), which incorporates a work_struct and
    the timer_list removed from work_struct.

    The work_struct struct is huge, and this limits it's usefulness. On a 64-bit
    architecture it's nearly 100 bytes in size. This reduces that by half for the
    non-delayable type of event.

    Signed-Off-By: David Howells

    David Howells
     

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
     

30 Sep, 2006

8 commits

  • This patch limits the messages when ldisc open faulures happen. It happens
    under memory pressure.

    Signed-off-by: Akinobu Mita
    Acked-by: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Akinobu Mita
     
  • If your driver implements "break on" and "break off" this ensures you won't
    get multiple overlapping requests or requests in parallel. If your driver
    has its own break handling then its still your problem as the driver
    author.

    Break is also now serialized against writes from user space properly but no
    new guarantees are made driver level about writes from the line discipline
    itself (eg flow control or echo)

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

    Alan Cox
     
  • [akpm@osdl.org: build fix]
    [akpm@osdl.org: warning fix]
    Signed-off-by: Alan Cox
    Acked-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • [akpm@osdl.org: fix]
    Cc: Alan Cox
    Cc: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     
  • Now we lock the set ioctl its trivial to lock the get one so the data
    copied is consistent. At the moment we have the BKL here but this removes
    the need for it and is a step in the right direction

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

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

    Alan Cox
     
  • The current kernel serializes console resizes but does not serialize the
    resize against the tty structure updates. This means that while two
    parallel resizes cannot mess up the console you can get incorrect results
    reported.

    Secondly while doing this I added vc_lock_resize() to lock and resize the
    console. This leaves all knowledge of the console_sem in the vt/console
    driver and kicks it out of the tty layer, which is good

    Thirdly while doing this I decided I couldn't stand "disallocate" any
    longer so I switched it to "deallocate".

    Signed-off-by: Alan Cox
    Cc: Paul Fulghum
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alan Cox
     
  • Just comment and next "while" look _very_ wrong. Place { correctly to hint
    unsuspecting ones that it's the end of the loop actually.

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

    Alexey Dobriyan
     

28 Aug, 2006

3 commits


04 Jul, 2006

2 commits

  • cleanup: remove task_t and convert all the uses to struct task_struct. I
    introduced it for the scheduler anno and it was a mistake.

    Conversion was mostly scripted, the result was reviewed and all
    secondary whitespace and style impact (if any) was fixed up by hand.

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

    Ingo Molnar
     
  • Mark the static struct file_operations in drivers/char as const. Making
    them const prevents accidental bugs, and moves them to the .rodata section
    so that they no longer do any false sharing; in addition with the proper
    debug option they are then protected against corruption..

    [akpm@osdl.org: build fix]
    Signed-off-by: Arjan van de Ven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Arjan van de Ven
     

01 Jul, 2006

1 commit


30 Jun, 2006

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/devfs-2.6: (22 commits)
    [PATCH] devfs: Remove it from the feature_removal.txt file
    [PATCH] devfs: Last little devfs cleanups throughout the kernel tree.
    [PATCH] devfs: Rename TTY_DRIVER_NO_DEVFS to TTY_DRIVER_DYNAMIC_DEV
    [PATCH] devfs: Remove the tty_driver devfs_name field as it's no longer needed
    [PATCH] devfs: Remove the line_driver devfs_name field as it's no longer needed
    [PATCH] devfs: Remove the videodevice devfs_name field as it's no longer needed
    [PATCH] devfs: Remove the gendisk devfs_name field as it's no longer needed
    [PATCH] devfs: Remove the miscdevice devfs_name field as it's no longer needed
    [PATCH] devfs: Remove the devfs_fs_kernel.h file from the tree
    [PATCH] devfs: Remove devfs_remove() function from the kernel tree
    [PATCH] devfs: Remove devfs_mk_cdev() function from the kernel tree
    [PATCH] devfs: Remove devfs_mk_bdev() function from the kernel tree
    [PATCH] devfs: Remove devfs_mk_symlink() function from the kernel tree
    [PATCH] devfs: Remove devfs_mk_dir() function from the kernel tree
    [PATCH] devfs: Remove devfs_*_tape() functions from the kernel tree
    [PATCH] devfs: Remove devfs support from the sound subsystem
    [PATCH] devfs: Remove devfs support from the ide subsystem.
    [PATCH] devfs: Remove devfs support from the serial subsystem
    [PATCH] devfs: Remove devfs from the init code
    [PATCH] devfs: Remove devfs from the partition code
    ...

    Linus Torvalds
     

29 Jun, 2006

3 commits

  • Remove 'active' field from tty buffer structure. This was added in 2.6.16
    as part of a patch to make the new tty buffering SMP safe. This field is
    unnecessary with the more intelligently written flush_to_ldisc that adds
    receive_room handling.

    Removing this field reverts to simpler logic where the tail buffer is
    always the 'active' buffer, which should not be freed by flush_to_ldisc.
    (active == buffer being filled with new data)

    The result is simpler, smaller, and faster tty buffer code.

    Signed-off-by: Paul Fulghum
    Cc: Alan Cox
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Fulghum
     
  • Flush data serially to line discipline in blocks no larger than
    tty->receive_room to avoid losing data if line discipline is busy (such as
    N_TTY operating at high speed on heavily loaded system) or does not accept
    data in large blocks (such as N_MOUSE).

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

    Paul Fulghum
     
  • Remove TTY_DONT_FLIP tty flag. This flag was introduced in 2.1.X kernels
    to prevent the N_TTY line discipline functions read_chan() and
    n_tty_receive_buf() from running at the same time. 2.2.15 introduced
    tty->read_lock to protect access to the N_TTY read buffer, which is the
    only state requiring protection between these two functions.

    The current TTY_DONT_FLIP implementation is broken for SMP, and is not
    universally honored by drivers that send data directly to the line
    discipline receive_buf function.

    Because TTY_DONT_FLIP is not necessary, is broken in implementation, and is
    not universally honored, it is removed.

    Signed-off-by: Paul Fulghum
    Cc: Alan Cox
    Cc: Theodore Ts'o
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Paul Fulghum
     

28 Jun, 2006

1 commit


27 Jun, 2006

4 commits


22 Jun, 2006

1 commit


24 May, 2006

1 commit

  • We still don't have the tty layer licensing compatibility quite right.

    tty_insert_flip_char() used to be inlined in include/linux/tty_flip.h. It
    is now out-of-lined and hence needs EXPORT_SYMBOL() to be back-compatible.

    One known offender is the Intel Modem driver.

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

    Tobias Powalowski
     

20 Apr, 2006

1 commit

  • There are places in the kernel where we look up files in fd tables and
    access the file structure without holding refereces to the file. So, we
    need special care to avoid the race between looking up files in the fd
    table and tearing down of the file in another CPU. Otherwise, one might
    see a NULL f_dentry or such torn down version of the file. This patch
    fixes those special places where such a race may happen.

    Signed-off-by: Dipankar Sarma
    Acked-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dipankar Sarma
     

14 Apr, 2006

1 commit

  • By calling send_sig do_SAK is recursively taking the
    tasklist_lock, which is silly.

    In addition I just audited the kernel and this was the only
    place where tasklist_lock is taken inside of task_lock.

    So this one line change is a general worthwhile cleanup and
    it increases our options on how to fix the ptrace_attach races.

    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

11 Apr, 2006

1 commit