26 Jun, 2016

1 commit

  • The Kconfig currently controlling compilation of this code is:

    drivers/tty/serial/Kconfig:config SERIAL_M32R_SIO
    drivers/tty/serial/Kconfig: bool "M32R SIO I/F"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the modular code that is essentially orphaned, so that
    when reading the driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering remains unchanged with this commit.

    We also delete the MODULE_LICENSE tag etc. since all that information
    is already contained at the top of the file in the comments.

    We don't replace module.h with init.h since the file already has that.

    Cc: Greg Kroah-Hartman
    Cc: Jiri Slaby
    Cc: linux-serial@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     

25 Jun, 2016

1 commit

  • STD_COM_FLAGS is mostly a bad name for what the drivers thinks it is.
    Stop using it and pass the flags directly.

    cyclades defines it as 0, so we do not assign anything to freshly
    tty_port_init'ed structure.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

07 Feb, 2016

4 commits

  • struct uart_sio_port has a lots of unused members. Some of them are
    set to some constant but never read. Remove all those.

    This includes removal of uart_ops->pm handler as we never handle pm
    (pm was never set).

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • DEBUG_AUTOCONF is unused.

    Switch DEBUG_INTR to pr_debug. This is only enabled with DEBUG or
    dynamic debug when explicitly asked for.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • The only variables in old_serial_port are port and irq. So make
    old_serial_port contain only those two and move the initialization of
    the rest to the place where old_serial_port is actually read.

    Also get rid of SERIAL_PORT_DFNS. It is ugly and having the
    initializer where it belongs makes more sense. Finally, use already
    defined UART_NR in the loop.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • The only needed information from the header is struct old_serial_port.
    Move it to m32r_sio.c, make it const and anonymous. And kill the rest
    from the header as it is dead stuff.

    Given m32r_sio_suspend_port and m32r_sio_resume_port are local to
    m32r_sio.c and unused, kill them from .c too.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

14 Dec, 2015

1 commit


06 Nov, 2014

1 commit


11 Jul, 2014

1 commit

  • Commit 717f3bbab3c7628736ef738fdbf3d9a28578c26c,
    'serial_core: Fix conditional start_tx on ring buffer not empty'
    exposes an incorrect assumption in several drivers' start_tx methods;
    the tx ring buffer can, in fact, be empty when restarting tx while
    performing flow control.

    Affected drivers:
    sunsab.c
    ip22zilog.c
    pmac_zilog.c
    sunzilog.c
    m32r_sio.c
    imx.c

    Other in-tree serial drivers either are not affected or already
    test for empty tx ring buffer before transmitting.

    Test for empty tx ring buffer in start_tx() method, after transmitting
    x_char (if applicable).

    Reported-by: Aaro Koskinen
    Cc: Seth Bollinger
    Cc: "David S. Miller"
    Cc: Sam Ravnborg
    Cc: Thomas Bogendoerfer
    Signed-off-by: Peter Hurley
    Cc: stable # 3.15
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

20 Jun, 2014

1 commit

  • If IGNBRK is set without either BRKINT or PARMRK set, some uart
    drivers send a 0x00 byte for BREAK without the TTYBREAK flag to the
    line discipline, when it should send either nothing or the TTYBREAK flag
    set. This happens because the read_status_mask masks out the BI
    condition, which uart_insert_char() then interprets as a normal 0x00 byte.

    SUS v3 is clear regarding the meaning of IGNBRK; Section 11.2.2, General
    Terminal Interface - Input Modes, states:
    "If IGNBRK is set, a break condition detected on input shall be ignored;
    that is, not put on the input queue and therefore not read by any
    process."

    Fix read_status_mask to include the BI bit if IGNBRK is set; the
    lsr status retains the BI bit if a BREAK is recv'd, which is
    subsequently ignored in uart_insert_char() when masked with the
    ignore_status_mask.

    Affected drivers:
    8250 - all
    serial_txx9
    mfd
    amba-pl010
    amba-pl011
    atmel_serial
    bfin_uart
    dz
    ip22zilog
    max310x
    mxs-auart
    netx-serial
    pnx8xxx_uart
    pxa
    sb1250-duart
    sccnxp
    serial_ks8695
    sirfsoc_uart
    st-asc
    vr41xx_siu
    zs
    sunzilog
    fsl_lpuart
    sunsab
    ucc_uart
    bcm63xx_uart
    sunsu
    efm32-uart
    pmac_zilog
    mpsc
    msm_serial
    m32r_sio

    Unaffected drivers:
    omap-serial
    rp2
    sa1100
    imx
    icom

    Annotated for fixes:
    altera_uart
    mcf

    Drivers without break detection:
    21285
    xilinx-uartps
    altera_jtaguart
    apbuart
    arc-uart
    clps711x
    max3100
    uartlite
    msm_serial_hs
    nwpserial
    lantiq
    vt8500_serial

    Unknown:
    samsung
    mpc52xx_uart
    bfin_sport_uart
    cpm_uart/core

    Fixes: Bugzilla #71651, '8250_core.c incorrectly handles IGNBRK flag'
    Reported-by: Ivan
    Signed-off-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Peter Hurley
     

28 Aug, 2013

1 commit

  • The current driver triggers a lockdep warning for if tty_flip_buffer_push() is
    called with uart_port->lock locked. This never shows up on UP kernels and comes
    up only on SMP kernels.

    Crash looks like this (produced with samsung.c driver):

    -----
    [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14)
    [] (show_stack+0x10/0x14) from [] (dump_stack+0x6c/0xac)
    [] (dump_stack+0x6c/0xac) from [] (do_raw_spin_unlock+0xc4/0xd8)
    [] (do_raw_spin_unlock+0xc4/0xd8) from [] (_raw_spin_unlock_irqrestore+0xc/0)
    [] (_raw_spin_unlock_irqrestore+0xc/0x38) from [] (s3c24xx_serial_rx_chars+0)
    [] (s3c24xx_serial_rx_chars+0x12c/0x260) from [] (s3c64xx_serial_handle_irq+)
    [] (s3c64xx_serial_handle_irq+0x48/0x60) from [] (handle_irq_event_percpu+0x)
    [] (handle_irq_event_percpu+0x50/0x194) from [] (handle_irq_event+0x3c/0x5c)
    [] (handle_irq_event+0x3c/0x5c) from [] (handle_fasteoi_irq+0x80/0x13c)
    [] (handle_fasteoi_irq+0x80/0x13c) from [] (generic_handle_irq+0x20/0x30)
    [] (generic_handle_irq+0x20/0x30) from [] (handle_IRQ+0x38/0x94)
    [] (handle_IRQ+0x38/0x94) from [] (gic_handle_irq+0x34/0x68)
    [] (gic_handle_irq+0x34/0x68) from [] (__irq_svc+0x40/0x70)
    Exception stack(0xc04cdf70 to 0xc04cdfb8)
    df60: 00000000 00000000 0000166e 00000000
    df80: c04cc000 c050278f c050278f 00000001 c04d444c 410fc0f4 c03649b0 00000000
    dfa0: 00000001 c04cdfb8 c000f758 c000f75c 60070013 ffffffff
    [] (__irq_svc+0x40/0x70) from [] (arch_cpu_idle+0x28/0x30)
    [] (arch_cpu_idle+0x28/0x30) from [] (cpu_startup_entry+0x5c/0x148)
    [] (cpu_startup_entry+0x5c/0x148) from [] (start_kernel+0x334/0x38c)
    BUG: spinlock lockup suspected on CPU#0, kworker/0:1/360
    lock: s3c24xx_serial_ports+0x1d8/0x370, .magic: dead4ead, .owner: /-1, .owner_cpu: -1
    CPU: 0 PID: 360 Comm: kworker/0:1 Not tainted 3.11.0-rc6-next-20130819-00003-g75485f1 #2
    Workqueue: events flush_to_ldisc
    [] (unwind_backtrace+0x0/0xf8) from [] (show_stack+0x10/0x14)
    [] (show_stack+0x10/0x14) from [] (dump_stack+0x6c/0xac)
    [] (dump_stack+0x6c/0xac) from [] (do_raw_spin_lock+0x100/0x17c)
    [] (do_raw_spin_lock+0x100/0x17c) from [] (_raw_spin_lock_irqsave+0x20/0x28)
    [] (_raw_spin_lock_irqsave+0x20/0x28) from [] (uart_start+0x18/0x34)
    [] (uart_start+0x18/0x34) from [] (__receive_buf+0x4b4/0x738)
    [] (__receive_buf+0x4b4/0x738) from [] (n_tty_receive_buf2+0x30/0x98)
    [] (n_tty_receive_buf2+0x30/0x98) from [] (flush_to_ldisc+0xec/0x138)
    [] (flush_to_ldisc+0xec/0x138) from [] (process_one_work+0xfc/0x348)
    [] (process_one_work+0xfc/0x348) from [] (worker_thread+0x138/0x37c)
    [] (worker_thread+0x138/0x37c) from [] (kthread+0xa4/0xb0)
    [] (kthread+0xa4/0xb0) from [] (ret_from_fork+0x14/0x3c)
    -----

    Release the port lock before calling tty_flip_buffer_push() and reacquire it
    after the call.

    Similar stuff was already done for few other drivers in the past, like:

    commit 2389b272168ceec056ca1d8a870a97fa9c26e11a
    Author: Thomas Gleixner
    Date: Tue May 29 21:53:50 2007 +0100

    [ARM] 4417/1: Serial: Fix AMBA drivers locking

    Signed-off-by: Viresh Kumar
    Signed-off-by: Greg Kroah-Hartman

    Viresh Kumar
     

16 Jan, 2013

2 commits

  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    Now, the one where most of tty_port_tty_get gets removed:
    tty_flip_buffer_push.

    IOW we also closed all the races in drivers not using tty_port_tty_get
    at all yet.

    Also we move tty_flip_buffer_push declaration from include/linux/tty.h
    to include/linux/tty_flip.h to all others while we are changing it
    anyway.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     
  • Now, we start converting tty buffer functions to actually use
    tty_port. This will allow us to get rid of the need of tty in many
    call sites. Only tty_port will needed and hence no more
    tty_port_tty_get in those paths.

    tty_insert_flip_char is the next one to proceed. This one is used all
    over the code, so the patch is huge.

    Signed-off-by: Jiri Slaby
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

06 Sep, 2012

1 commit

  • The struct serial_uart_config is hardly used at all, and the
    use case like this one are somewhat needless. Remove the
    trivial usage so that we can remove serial_uart_config.

    Since the type field isn't really used at all, we also delete
    the initialization and references of it here as well.

    Cc: Hirokazu Takata
    Signed-off-by: Paul Gortmaker
    Acked-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     

09 Mar, 2012

1 commit


27 Jan, 2012

1 commit


05 Jan, 2012

1 commit

  • This driver was copied from the original 8250 driver and hence
    got the DEC alpha errata workaround. But the workaround is ugly
    and we don't really want it in any more places than it absolutely
    needs to be. Obviously ARCH=m32r means ARCH != alpha, so just
    remove the references to the ALPHA_KLUDGE_MCR define.

    Signed-off-by: Paul Gortmaker
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     

23 Sep, 2011

1 commit

  • linux/tty_flip.h is included in linux/serial_core.h. But this may (and
    will) change in the future. Then we would get build errors such as:
    .../tty/serial/max3107.c: In function ‘put_data_to_circ_buf’:
    .../tty/serial/max3107.c:149:2: error: implicit declaration of function ‘tty_insert_flip_string’

    So fix all the drviers which call tty flip buffer helpers to really
    include linux/tty_flip.h. And also make sure that those include
    linux/tty.h when operating with struct tty_struct.

    Signed-off-by: Jiri Slaby
    Cc: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jiri Slaby
     

10 Jun, 2011

1 commit


27 May, 2011

1 commit


14 Jan, 2011

1 commit

  • The serial drivers are really just tty drivers, so move them to
    drivers/tty/ to make things a bit neater overall.

    This is part of the tty/serial driver movement proceedure as proposed by
    Arnd Bergmann and approved by everyone involved a number of months ago.

    Cc: Arnd Bergmann
    Cc: Alan Cox
    Cc: Geert Uytterhoeven
    Cc: Rogier Wolff
    Cc: Michael H. Warfield
    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman