1. 08 11月, 2014 5 次提交
  2. 07 11月, 2014 1 次提交
  3. 06 11月, 2014 1 次提交
    • 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
  4. 09 9月, 2014 1 次提交
  5. 10 7月, 2014 1 次提交
  6. 20 6月, 2014 1 次提交
    • P
      serial: Fix IGNBRK handling · ef8b9ddc
      Peter Hurley 提交于
      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: NIvan <athlon_@mail.ru>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ef8b9ddc
  7. 21 5月, 2014 1 次提交
  8. 25 4月, 2014 1 次提交
  9. 17 4月, 2014 2 次提交
  10. 14 2月, 2014 1 次提交
  11. 18 12月, 2013 6 次提交
  12. 09 12月, 2013 3 次提交
  13. 04 10月, 2013 1 次提交
  14. 13 8月, 2013 1 次提交
  15. 01 8月, 2013 1 次提交
  16. 16 6月, 2013 1 次提交
  17. 21 5月, 2013 2 次提交
  18. 20 4月, 2013 1 次提交
  19. 18 4月, 2013 1 次提交
  20. 04 4月, 2013 1 次提交
  21. 30 3月, 2013 1 次提交
    • C
      ARM: PL011: Add support for Rx DMA buffer polling. · cb06ff10
      Chanho Min 提交于
      In DMA support, The received data is not pushed to tty until the DMA buffer
      is filled. But some megabyte rate chips such as BT expect fast response and
      data should be pushed immediately. In order to fix this issue, We suggest
      the use of the timer for polling DMA buffer.
      In our test, no data loss occurred at high-baudrate as compared with interrupt-
      driven (We tested with 3Mbps).
      We changes:
      
      - We add timer for polling. If we set poll_timer to 10, every 10ms,
       timer handler checks the residue in the dma buffer and transfer data
       to the tty. Also, last_residue is updated for the next polling.
      
      - poll_timeout is used to prevent the timer's system cost.
        If poll_timeout is set to 3000 and no data is received in 3 seconds,
        we inactivate poll timer and driver falls back to interrupt-driven.
        When data is received again in FIFO and UART irq is occurred, we switch
        back to DMA mode and start polling.
      
      - We use consistent DMA mappings to avoid from the frequent cache operation
        of the timer function for default.
      
      - pl011_dma_rx_chars is modified. the pending size is recalculated because
        data can be taken by polling.
      
      - the polling time is adjusted if dma rx poll is enabled but no rate is
        specified. Ideal polling interval to push 1 character at every interval
        is the reciprocal of 'baud rate / 10 line bits per character / 1000 ms
        per sec'. But It is very aggressive to system. Experimentally,
       '10000000 / baud' is suitable to receive dozens of characters. the poll rate
       can be specified statically by dma_rx_poll_rate of the platform data as well.
      
      Changes compared to v1:
       - Use of consistent DMA mappings.
       - Added dma_rx_poll_rate in platform data to specify the polling interval.
       - Added dma_rx_poll_timeout in platform data to specify the polling timeout.
      
      Changes compared to v2:
       - Use of consistent DMA mappings for default.
       - Added dma_rx_poll_enable in platform data to adjust the polling time
         according to the baud rate.
       - remove unnecessary lock from the polling function.
      Signed-off-by: NChanho Min <chanho.min@lge.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb06ff10
  22. 13 3月, 2013 1 次提交
    • A
      serial: pl011: use generic DMA slave configuration if possible · 787b0c1f
      Arnd Bergmann 提交于
      With the new OF DMA binding, it is possible to completely avoid the
      need for platform_data for configuring a DMA channel. In cases where the
      platform has already been converted, calling dma_request_slave_channel
      should get all the necessary information from the device tree.
      
      This also adds a binding document specific to the pl011 controller,
      and extends the generic primecell binding to mention "dmas" and other
      common properties.
      
      Like the patch that converts the dw_dma controller, this is completely
      untested and is looking for someone to try it out.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Viresh Kumar <viresh.kumar@linaro.org>
      Cc: devicetree-discuss@lists.ozlabs.org
      Cc: linux-arm-kernel@lists.infradead.org
      787b0c1f
  23. 16 1月, 2013 2 次提交
    • J
      TTY: switch tty_flip_buffer_push · 2e124b4a
      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.
      
      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: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e124b4a
    • J
      TTY: switch tty_insert_flip_string · 05c7cd39
      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_string this time.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      05c7cd39
  24. 26 10月, 2012 1 次提交
  25. 27 9月, 2012 2 次提交
    • A
      tty/serial/amba-pl011: Quiesce interrupts in poll_get_char · 5c8124a0
      Anton Vorontsov 提交于
      We need to quiesce interrupts in the poll_get_char routine, otherwise,
      if used with KGDB NMI debugger, we'll keep reentering the NMI.
      
      Quiescing interrupts is pretty straightforward, except for TXIM
      interrupt. The interrupt has "ready to transmit" meaning, so it's
      almost always raised, and the only way to silence it is to mask it. But
      that's OK, ops->start_tx will unmask it.
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5c8124a0
    • A
      tty/serial/amba-pl011: Implement poll_init callback · b3564c2c
      Anton Vorontsov 提交于
      The callback is used to initialize the hardware, nothing else should be
      done, i.e. we should not request interrupts (but we can and do unmask
      some of them, as they might be useful for NMI entry).
      
      As a side-effect, the patch also fixes a division by zero[1] when booting
      with kgdboc options specified (e.g. kgdboc=ttyAMA0,115200n8). The issue
      happens because serial core calls set_termios callback, but the driver
      doesn't know clock frequency, and thus cannot calculate proper baud rate
      values.
      
      [1]
      WARNING: at drivers/tty/serial/serial_core.c:400 uart_get_baud_rate+0xe8/0x14c()
      Modules linked in:
      [<c0018e50>] (unwind_backtrace+0x0/0xf0) from [<c0020ae8>] (warn_slowpath_common+0x4c/0x64)
      [<c0020ae8>] (warn_slowpath_common+0x4c/0x64) from [<c0020b1c>] (warn_slowpath_null+0x1c/0x24)
      [<c0020b1c>] (warn_slowpath_null+0x1c/0x24) from [<c0185ed8>] (uart_get_baud_rate+0xe8/0x14c)
      [<c0185ed8>] (uart_get_baud_rate+0xe8/0x14c) from [<c0187078>] (pl011_set_termios+0x48/0x278)
      [<c0187078>] (pl011_set_termios+0x48/0x278) from [<c01850b0>] (uart_set_options+0xe8/0x114)
      [<c01850b0>] (uart_set_options+0xe8/0x114) from [<c0185de4>] (uart_poll_init+0xd4/0xe0)
      [<c0185de4>] (uart_poll_init+0xd4/0xe0) from [<c016da8c>] (tty_find_polling_driver+0x100/0x17c)
      [<c016da8c>] (tty_find_polling_driver+0x100/0x17c) from [<c0188538>] (configure_kgdboc+0xc8/0x1b8)
      [<c0188538>] (configure_kgdboc+0xc8/0x1b8) from [<c00088a4>] (do_one_initcall+0x30/0x168)
      [<c00088a4>] (do_one_initcall+0x30/0x168) from [<c033784c>] (do_basic_setup+0x94/0xc8)
      [<c033784c>] (do_basic_setup+0x94/0xc8) from [<c03378e0>] (kernel_init+0x60/0xf4)
      [<c03378e0>] (kernel_init+0x60/0xf4) from [<c00144a0>] (kernel_thread_exit+0x0/0x8)
      ---[ end trace 7d41c9186f342c40 ]---
      Division by zero in kernel.
      [<c0018e50>] (unwind_backtrace+0x0/0xf0) from [<c014546c>] (Ldiv0+0x8/0x10)
      [<c014546c>] (Ldiv0+0x8/0x10) from [<c0187098>] (pl011_set_termios+0x68/0x278)
      [<c0187098>] (pl011_set_termios+0x68/0x278) from [<c01850b0>] (uart_set_options+0xe8/0x114)
      [<c01850b0>] (uart_set_options+0xe8/0x114) from [<c0185de4>] (uart_poll_init+0xd4/0xe0)
      [<c0185de4>] (uart_poll_init+0xd4/0xe0) from [<c016da8c>] (tty_find_polling_driver+0x100/0x17c)
      [<c016da8c>] (tty_find_polling_driver+0x100/0x17c) from [<c0188538>] (configure_kgdboc+0xc8/0x1b8)
      [<c0188538>] (configure_kgdboc+0xc8/0x1b8) from [<c00088a4>] (do_one_initcall+0x30/0x168)
      [<c00088a4>] (do_one_initcall+0x30/0x168) from [<c033784c>] (do_basic_setup+0x94/0xc8)
      [<c033784c>] (do_basic_setup+0x94/0xc8) from [<c03378e0>] (kernel_init+0x60/0xf4)
      [<c03378e0>] (kernel_init+0x60/0xf4) from [<c00144a0>] (kernel_thread_exit+0x0/0x8)
      Division by zero in kernel.
      [<c0018e50>] (unwind_backtrace+0x0/0xf0) from [<c014546c>] (Ldiv0+0x8/0x10)
      [<c014546c>] (Ldiv0+0x8/0x10) from [<c0183a98>] (uart_update_timeout+0x4c/0x5c)
      [<c0183a98>] (uart_update_timeout+0x4c/0x5c) from [<c01870f8>] (pl011_set_termios+0xc8/0x278)
      [<c01870f8>] (pl011_set_termios+0xc8/0x278) from [<c01850b0>] (uart_set_options+0xe8/0x114)
      [<c01850b0>] (uart_set_options+0xe8/0x114) from [<c0185de4>] (uart_poll_init+0xd4/0xe0)
      [<c0185de4>] (uart_poll_init+0xd4/0xe0) from [<c016da8c>] (tty_find_polling_driver+0x100/0x17c)
      [<c016da8c>] (tty_find_polling_driver+0x100/0x17c) from [<c0188538>] (configure_kgdboc+0xc8/0x1b8)
      [<c0188538>] (configure_kgdboc+0xc8/0x1b8) from [<c00088a4>] (do_one_initcall+0x30/0x168)
      [<c00088a4>] (do_one_initcall+0x30/0x168) from [<c033784c>] (do_basic_setup+0x94/0xc8)
      [<c033784c>] (do_basic_setup+0x94/0xc8) from [<c03378e0>] (kernel_init+0x60/0xf4)
      [<c03378e0>] (kernel_init+0x60/0xf4) from [<c00144a0>] (kernel_thread_exit+0x0/0x8)
      Signed-off-by: NAnton Vorontsov <anton.vorontsov@linaro.org>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b3564c2c