1. 06 11月, 2014 7 次提交
    • P
      serial: core: Flush ldisc after dropping port mutex in uart_close() · 2e758910
      Peter Hurley 提交于
      The tty buffers (and any line discipline buffers) must be flushed after
      the UART hardware has shutdown; otherwise, a racing open on the same
      tty may receive data from the previous session, which is a security
      hazard. However, holding the port mutex while flushing the line
      discipline buffers creates a lock inversion if the set_termios()
      handler takes the port mutex (as it does in the followup patch,
      'serial: Fix locking for uart driver set_termios method'.
      
      Flush the ldisc buffers after dropping the port mutex; the tty lock
      is still held which prevents a concurrent open() from advancing while
      flushing. Since no new rx data is possible after uart_shutdown() until
      a new open reinitializes the port, the later flush has no impact on
      what data is being discarded.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e758910
    • P
      serial: Refactor uart_flush_buffer() from uart_close() · 479e9b94
      Peter Hurley 提交于
      In the context of the final tty & port close, flushing the tx
      ring buffer after the hardware has already been shutdown and
      the ring buffer freed is neither required nor desirable.
      
      uart_flush_buffer() performs 3 operations:
      1. Resets tx ring buffer indices, but the tx ring buffer has
         already been freed and the indices are reset if the port is
         re-opened.
      2. Calls uart driver's flush_buffer() method
         5 in-tree uart drivers define flush_buffer() methods:
           amba-pl011, atmel-serial, imx, serial-tegra, timbuart
         These have been refactored into the shutdown() method, if
         required.
      3. Kicks the ldisc for more writing, but this is undesirable.
         The file handle is being released; any waiting writer will
         will be kicked out by tty_release() with a warning. Further,
         the N_TTY ldisc may generate SIGIO for a file handle which
         is no longer valid.
      
      Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      479e9b94
    • M
      8250_pci: Added driver for Endrun Technologies PTP PCIe card. · 1bc8cde4
      Mike Skoog 提交于
      Added recognition of EndRun Technologies PCIe PTP slave card
      and setup two ttySx ports for communication with the card for
      retrieval of PTP based time and to communicate with the card's
      Linux OS.
      Signed-off-by: NMike Skoog <mskoog@endruntechnologies.com>
      Signed-off-by: NMike Korreng <mkorreng@endruntechnologies.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1bc8cde4
    • S
      tty: serial: 8250_core: restore the LCR register in set_sleep · edf4edac
      Sudhir Sreedharan 提交于
      In ST16650V2 based serial uarts, while initalizing the PM state,
      LCR registers are being initialized to 0 in serial8250_set_sleep().
      If console port is already initialized and being used, this will
      throws garbage in the console.
      Signed-off-by: NSudhir Sreedharan <ssreedharan@mvista.com>
      Reviewed-by: NPeter Hurley <peter@hurleysoftware.com>
      Tested-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      edf4edac
    • J
      serial: of-serial: fix up PM ops on no_console_suspend and port type · 513e4385
      Jingchang Lu 提交于
      This patch fixes commit 2dea53bf,
      "serial: of-serial: add PM suspend/resume support", which disables
      the uart clock on suspend, but also causes a hardware hang on register
      access if no_console_suspend command line option is used.
      
      Also, not every of_serial device is an 8250 port, so the serial8250
      suspend/resume functions should only be applied to a real 8250 port.
      Signed-off-by: NJingchang Lu <jingchang.lu@freescale.com>
      Tested-by: NJoseph Lo <josephl@nvidia.com>
      Reviewed-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      513e4385
    • P
      serial: Fix sparse warnings in uart_throttle()/uart_unthrottle() · 91f189de
      Peter Hurley 提交于
      The struct uart_port.flags field is type upf_t, as are the matching
      bit definitions. Change local mask variable to type upf_t.
      
      Fixes sparse warnings:
      drivers/tty/serial/serial_core.c:620:22: warning: invalid assignment: |=
      drivers/tty/serial/serial_core.c:620:22:    left side has type unsigned int
      drivers/tty/serial/serial_core.c:620:22:    right side has type restricted upf_t
      drivers/tty/serial/serial_core.c:622:22: warning: invalid assignment: |=
      drivers/tty/serial/serial_core.c:622:22:    left side has type unsigned int
      drivers/tty/serial/serial_core.c:622:22:    right side has type restricted upf_t
      drivers/tty/serial/serial_core.c:624:17: warning: restricted upf_t degrades to integer
      drivers/tty/serial/serial_core.c:626:22: warning: invalid assignment: &=
      drivers/tty/serial/serial_core.c:626:22:    left side has type unsigned int
      drivers/tty/serial/serial_core.c:626:22:    right side has type restricted upf_t
      drivers/tty/serial/serial_core.c:629:20: warning: restricted upf_t degrades to integer
      drivers/tty/serial/serial_core.c:632:20: warning: restricted upf_t degrades to integer
      drivers/tty/serial/serial_core.c:643:22: warning: invalid assignment: |=
      drivers/tty/serial/serial_core.c:643:22:    left side has type unsigned int
      drivers/tty/serial/serial_core.c:643:22:    right side has type restricted upf_t
      drivers/tty/serial/serial_core.c:645:22: warning: invalid assignment: |=
      drivers/tty/serial/serial_core.c:645:22:    left side has type unsigned int
      drivers/tty/serial/serial_core.c:645:22:    right side has type restricted upf_t
      drivers/tty/serial/serial_core.c:647:17: warning: restricted upf_t degrades to integer
      drivers/tty/serial/serial_core.c:649:22: warning: invalid assignment: &=
      drivers/tty/serial/serial_core.c:649:22:    left side has type unsigned int
      drivers/tty/serial/serial_core.c:649:22:    right side has type restricted upf_t
      drivers/tty/serial/serial_core.c:652:20: warning: restricted upf_t degrades to integer
      drivers/tty/serial/serial_core.c:655:20: warning: restricted upf_t degrades to integer
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      91f189de
    • P
      serial: Fix upstat_t sparse warnings · d4260b51
      Peter Hurley 提交于
      Commit 299245a1,
      serial: core: Privatize modem status enable flags, introduced
      the upstat_t type and matching bit definitions. The purpose is to
      produce sparse warnings if the wrong bit definitions are used
      (by warning of implicit integer conversions).
      
      Fix implicit conversion to integer return type from uart_cts_enabled()
      and uart_dcd_enabled().
      
      Fixes the following sparse warnings:
      drivers/tty/serial/serial_core.c:63:30: warning: incorrect type in return expression (different base types)
      drivers/tty/serial/serial_core.c:63:30:    expected int
      drivers/tty/serial/serial_core.c:63:30:    got restricted upstat_t
      include/linux/serial_core.h:364:30: warning: incorrect type in return expression (different base types)
      include/linux/serial_core.h:364:30:    expected bool
      include/linux/serial_core.h:364:30:    got restricted upstat_t
      include/linux/serial_core.h:364:30: warning: incorrect type in return expression (different base types)
      include/linux/serial_core.h:364:30:    expected bool
      include/linux/serial_core.h:364:30:    got restricted upstat_t
      Reported-by: NFengguang Wu <fengguang.wu@intel.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d4260b51
  2. 16 10月, 2014 2 次提交
  3. 03 10月, 2014 1 次提交
  4. 29 9月, 2014 12 次提交
  5. 27 9月, 2014 5 次提交
  6. 24 9月, 2014 5 次提交
  7. 23 9月, 2014 1 次提交
  8. 20 9月, 2014 1 次提交
  9. 19 9月, 2014 1 次提交
  10. 11 9月, 2014 2 次提交
  11. 10 9月, 2014 3 次提交