14 Oct, 2008

31 commits

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

    Alan Cox
     
  • Right now we have ifdefs and hooks in the core ioctl handler for TIOCLINUX
    and then test if its a console. This is brain dead. Instead call the
    tioclinux helper from the relevant driver ioctl methods.

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

    Alan Cox
     
  • This requires three changes:

    1) Remove !SPARC restriction in Kconfig.

    2) Move Sparc specific serial drivers before 8250, so that serial
    console devices don't change names on us, even if 8250 finds
    devices.

    3) Since the Sparc specific serial drivers try to use the
    same major/minor device namespace as 8250, some coordination
    is necessary. Use the sunserial_*() layer routines to allocate
    minor number space within TTY_MAJOR when CONFIG_SPARC.

    This has no effect on other platforms.

    Thanks to Josip Rodin for bringing up this issue and testing
    plus debugging various revisions of this patch.

    Signed-off-by: David S. Miller
    Signed-off-by: Andrew Morton
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    David Miller
     
  • Remove some inlines from various functions that are called once, are too
    big to inline, or are called only from slow path code. This saves around
    300 bytes of code for me.

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

    Will Newton
     
  • talking about leaks - I noticed that the 'check return of
    pci_enable_dev()' in the 8250 pci resume function finally made it in
    despite my objections against it (causing stuff in higher levels to
    leak).

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

    Alan Cox
     
  • Fixes #10783

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

    Alan Cox
     
  • This patch removes the private check for the termios_initialized for
    the pl2303 usb driver. It forced the baud to 9600 on the first call
    to pl2303_set_termios()

    Based on the tty changes in the 2.6.27 kernel, the termios passed to
    the *_set_termios functions is always populated the first time.

    This means there is no need to privately initialize the settings the
    first time, and doing so will not allow the use of the kernel
    parameter "console=ttyUSB0,115200" as an example.

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

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

    Andrew Morton
     
  • Nozomi assumes the close method isn't called if open errors. The tty layer
    is different to other drives in this respect however. Pointed out by Denis J
    Barrow.

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

    Alan Cox
     
  • Otherwise the top 32-bits of the resource value get chopped
    off on 64-bit systems, and the resulting I/O accesses go to
    random places.

    Thanks to testing and debugging by Josip Rodin, which helped
    track this down.

    Signed-off-by: David S. Miller
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    David Miller
     
  • Data read from a TTY can contain an embedded NUL byte (e.g. after
    pressing Ctrl-2, or sent to a PTY). After the previous patch, the data
    would be logged only up to the first NUL.

    This patch modifies the AUDIT_TTY record to always use the hexadecimal
    format, which does not terminate at the first NUL byte. The vast
    majority of recorded TTY input data will contain either ' ' or '\n', so
    the hexadecimal format would have been used anyway.

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

    Miloslav Trmac
     
  • 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
     
  • board->base is increased for CF cards after mapping. Use board->base2
    for unmapping the region, since it holds the original/correct address.

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

    Jiri Slaby
     
  • readl/writel are not expected to accept iomap return value. Replace
    bogus mapping by standard ioremap.

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

    Jiri Slaby
     
  • For some reason the oti6858 driver undefines and redefines the dbg
    macro. This makes it spew debugging messages at KERN_INFO instead of
    KERN_DEBUG.

    This patch removes the undef and define making the driver log like every
    other USB serial driver.

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

    Scott Ashcroft
     
  • Signed-off-by: Sonic Zhang
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Sonic Zhang
     
  • We now use the sir_dev/irtty_sir/uart/bfin_serial drivers framework
    to monitor the TX status.

    Signed-off-by: Graf Yang
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Graf Yang
     
  • Disable irq and return immediately.

    Signed-off-by: Sonic Zhang
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Sonic Zhang
     
  • Signed-off-by: Sonic Zhang
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Sonic Zhang
     
  • move common variables out of serial headers and into the serial driver and
    rename "nr_ports" to "nr_active_ports" so as to easily differentiate
    between BFIN_UART_NR_PORTS (the # of available) and nr_ports (the # of enabled)

    Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Mike Frysinger
     
  • Signed-off-by: Sonic Zhang
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

    Sonic Zhang
     
  • Signed-off-by: Mike Frysinger
    Signed-off-by: Bryan Wu
    Signed-off-by: Alan Cox
    Signed-off-by: Linus Torvalds

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

    Alan Cox
     
  • This patch contains the scheduled removal of the obsolete
    SERIAL_COLDFIRE driver.

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

    Adrian Bunk
     
  • The call to put_tty_driver is out of place and is applied to the wrong
    argument.

    The function enclosing the patched code calls alloc_tty_driver and stores
    the result in drv. Subsequently, there are two occurrences of error
    handling code, one making a goto to put_tty and one making a goto to
    stop_thread. At the point of the first one the assignment hvc_driver = drv
    has not yet been executed, and from inspecting the rest of the file it
    seems that hvc_driver would be NULL. Thus the current call to
    put_tty_driver is useless, and one applied to drv is needed. The goto
    stop_thread is in the error handling code for a call to
    tty_register_driver, but the error cases in tty_register_driver do not free
    its argument, so it should be done here. Thus, I have moved the put_tty
    label after the stop_thread label, so that put_tty_driver is called in both
    cases.

    The semantic match that finds this problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    expression E,f;
    position p1,p2,p3;
    identifier l;
    statement S;
    @@

    x = alloc_tty_driver@p1(...)
    ...
    if (x == NULL) S
    ... when != E = x
    when != put_tty_driver(x)
    goto@p2 l;
    ... when != E = x
    when != f(...,x,...)
    when any
    (
    return \(0\|x\);
    |
    return@p3 ...;
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    p3 << r.p3;
    @@

    print "%s: call on line %s not freed or saved before return on line %s via line %s" % (p1[0].file,p1[0].line,p3[0].line,p2[0].line)
    //

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

    Julia Lawall
     
  • alloc_tty_driver is called at the beginning of the function containing the
    lines of code shown in the patch. Thus, put_tty_driver is needed before
    returning in the error handling code.

    The semantic match that finds this problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @nr exists@
    local idexpression x;
    expression E,f;
    position p1,p2,p3;
    identifier l;
    statement S;
    @@

    x = alloc_tty_driver@p1(...)
    ...
    if (x == NULL) S
    ... when != E = x
    when != put_tty_driver(x)
    when != goto l;
    (
    return \(0\|x\);
    |
    return@p3 ...;
    )

    @script:python@
    p1 << nr.p1;
    p3 << nr.p3;
    @@

    print "%s: call on line %s not freed or saved before return on line %s" % (p1[0].file,p1[0].line,p3[0].line)
    //

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

    Julia Lawall
     

13 Oct, 2008

9 commits