1. 31 8月, 2016 2 次提交
  2. 26 6月, 2016 1 次提交
  3. 04 5月, 2016 1 次提交
  4. 01 5月, 2016 9 次提交
  5. 07 2月, 2016 1 次提交
  6. 29 1月, 2016 9 次提交
  7. 14 12月, 2015 2 次提交
  8. 18 10月, 2015 1 次提交
  9. 05 10月, 2015 1 次提交
    • M
      serial_core: support native endianness · d215d809
      Max Filippov 提交于
      There are three natural ways in which devices may be wired to the system:
      little endian (device receives correctly ordered bits of a word written
      by little-endian CPU to its register, but big-endian CPU needs to swap
      bytes of a word before writing it), big endian (same, but with big-endian
      CPU in more favourable position) and native endian (CPU of either
      endianness may do word-sized I/O without need for byteswapping).
      
      Adding an option for native endianness allows using single kernel command
      line for boards with native-endian serial ports on bi-endian
      architectures. This goes in parallel with 'native-endian' DTS attribute.
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d215d809
  10. 05 8月, 2015 2 次提交
  11. 24 7月, 2015 1 次提交
    • P
      serial: core: Fix crashes while echoing when closing · e144c58c
      Peter Hurley 提交于
      While closing, new rx data may be received after the input buffers
      have been flushed but before stop_rx() halts receiving [1]. The
      new data might not be processed by flush_to_ldisc() until after
      uart_shutdown() and normal input processing is re-enabled (ie.,
      tty->closing = 0). The race is outlined below:
      
      CPU 0                         | CPU 1
                                    |
      uart_close()                  |
         tty_port_close_start()     |
            tty->closing = 1        |
            tty_ldisc_flush()       |
                                    | => IRQ
                                    |   while (LSR & data ready)
                                    |      uart_insert_char()
                                    |   tty_flip_buffer_push()
                                    | <= EOI
         stop_rx()                  |   .
         uart_shutdown()            |   .
            free xmit.buf           |   .
         tty_port_tty_set(NULL)     |   .
         tty->closing = 0           |   .
                                    | flush_to_ldisc()
                                    |   n_tty_receive_buf_common()
                                    |      __receive_buf()
                                    |         ...
                                    |         commit_echoes()
                                    |            uart_flush_chars()
                                    |               __uart_start()
                                    | ** OOPS on port.tty deref **
         tty_ldisc_flush()          |
      
      Input processing must be prevented from echoing (tty->closing = 1)
      until _after_ the input buffers have been flushed again at the end
      of uart_close().
      
      [1] In fact, some input may actually be buffered _after_ stop_rx()
      since the rx interrupt may have already triggered but not yet been
      handled when stop_rx() disables rx interrupts.
      
      Fixes: 2e758910 ("serial: core: Flush ldisc after dropping port
      mutex in uart_close()")
      Reported-by: NRobert Elliott <elliott@hp.com>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e144c58c
  12. 13 6月, 2015 1 次提交
  13. 01 6月, 2015 1 次提交
  14. 07 5月, 2015 1 次提交
  15. 28 4月, 2015 1 次提交
  16. 26 3月, 2015 2 次提交
  17. 07 3月, 2015 2 次提交
  18. 03 2月, 2015 2 次提交
    • P
      serial: core: Rework hw-assisted flow control support · 391f93f2
      Peter Hurley 提交于
      hw-assisted flow control support was added to the serial core
      in v3.8 with commits,
      dba05832 ("SERIAL: core: add hardware assisted h/w flow control support")
      2cbacafd ("SERIAL: core: add hardware assisted s/w flow control support")
      9aba8d5b ("SERIAL: core: add throttle/unthrottle callbacks for hardware
                      assisted flow control")
      Since then, additional requirements for serial core support have arisen.
      Specifically,
      1. Separate tx and rx flow control settings for UARTs which only support
         tx flow control (ie., autoCTS).
      2. Disable sw-assisted CTS flow control in autoCTS mode
      3. Support for RTS flow control by serial core and userspace in autoRTS mode
      
      Distinguish mode from capability; introduce UPSTAT_AUTORTS, UPSTAT_AUTOCTS
      and UPSTAT_AUTOXOFF which, when set by the uart driver, enable serial core
      support for hw-assisted rx, hw-assisted tx and hw-assisted in-band/IXOFF
      rx flow control, respectively. [Note: hw-assisted in-band/IXON tx flow
      control does not require serial core support/intervention and can be
      enabled by the uart driver when required.]
      
      These modes must be set/reset in the driver's set_termios() method, based
      on termios settings, and thus can be safely queried in any context in which
      one of the port lock, port mutex or termios rwsem are held. Set these modes
      in the 2 in-tree drivers, omap-serial and 8250_omap, which currently
      use UPF_HARD_FLOW/UPF_SOFT_FLOW support.
      
      Retain UPF_HARD_FLOW and UPF_SOFT_FLOW as capabilities; re-define
      UPF_HARD_FLOW as both UPF_AUTO_RTS and UPF_AUTO_CTS to allow for distinct
      and separate rx and tx flow control capabilities.
      
      Disable sw-assisted CTS flow control when UPSTAT_AUTOCTS is enabled.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      391f93f2
    • P
      serial: core: Simplify console suspend logic in uart_suspend_port() · b164c972
      Peter Hurley 提交于
      When the uart port being suspended is a console and consoles are
      not suspending (kernel command line contains no_console_suspend),
      then no action is performed for that port, and the function can
      return early.
      
      If the function has not returned early, then one of the conditions
      is not true, so the expression
         (console_suspend_enabled || !uart_console(uport))
      must be true and can be eliminated.
      
      Similarly, the expression
         (console_suspend_enabled && uart_console(uport))
      simplifies to just uart_console(uport).
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b164c972