1. 25 6月, 2016 1 次提交
  2. 01 5月, 2016 3 次提交
  3. 07 2月, 2016 2 次提交
  4. 15 8月, 2015 1 次提交
  5. 24 7月, 2015 1 次提交
  6. 27 3月, 2015 1 次提交
  7. 26 3月, 2015 1 次提交
  8. 11 3月, 2015 1 次提交
  9. 07 11月, 2014 1 次提交
  10. 06 11月, 2014 4 次提交
  11. 27 9月, 2014 1 次提交
    • S
      tty: serial: 8250_core: add run time pm · d74d5d1b
      Sebastian Andrzej Siewior 提交于
      While comparing the OMAP-serial and the 8250 part of this I noticed that
      the latter does not use run time-pm. Here are the pieces. It is
      basically a get before first register access and a last_busy + put after
      last access. This has to be enabled from userland _and_ UART_CAP_RPM is
      required for this.
      The runtime PM can usually work transparently in the background however
      there is one exception to this: After serial8250_tx_chars() completes
      there still may be unsent bytes in the FIFO (depending on CPU speed vs
      baud rate + flow control). Even if the TTY-buffer is empty we do not
      want RPM to disable the device because it won't send the remaining
      bytes. Instead we leave serial8250_tx_chars() with RPM enabled and wait
      for the FIFO empty interrupt. Once we enter serial8250_tx_chars() with
      an empty buffer we know that the FIFO is empty and since we are not going
      to send anything, we can disable the device.
      That xchg() is to ensure that serial8250_tx_chars() can be called
      multiple times and only the first invocation will actually invoke the
      runtime PM function. So that the last invocation of __stop_tx() will
      disable runtime pm.
      
      NOTE: do not enable RPM on the device unless you know what you do! If
      the device goes idle, it won't be woken up by incomming RX data _unless_
      there is a wakeup irq configured which is usually the RX pin configure
      for wakeup via the reset module. The RX activity will then wake up the
      device from idle. However the first character is garbage and lost. The
      following bytes will be received once the device is up in time. On the
      beagle board xm (omap3) it takes approx 13ms from the first wakeup byte
      until the first byte that is received properly if the device was in
      core-off.
      
      v5…v8:
      	- drop RPM from serial8250_set_mctrl() it will be used in
      	  restore path which already has RPM active and holds
      	  dev->power.lock
      v4…v5:
      	- add a wrapper around rpm function and introduce UART_CAP_RPM
      	  to ensure RPM put is invoked after the TX FIFO is empty.
      v3…v4:
      	- added runtime to the console code
      	- removed device_may_wakeup() from serial8250_set_sleep()
      
      Cc: mika.westerberg@linux.intel.com
      Reviewed-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d74d5d1b
  12. 11 9月, 2014 1 次提交
  13. 09 9月, 2014 1 次提交
  14. 18 7月, 2014 1 次提交
    • Y
      serial/uart/8250: Add tunable RX interrupt trigger I/F of FIFO buffers · aef9a7bd
      Yoshihiro YUNOMAE 提交于
      Add tunable RX interrupt trigger I/F of FIFO buffers.
      
      Serial devices are used as not only message communication devices but control
      or sending communication devices. For the latter uses, normally small data
      will be exchanged, so user applications want to receive data unit as soon as
      possible for real-time tendency. If we have a sensor which sends a 1 byte data
      each time and must control a device based on the sensor feedback, the RX
      interrupt should be triggered for each data.
      
      According to HW specification of serial UART devices, RX interrupt trigger
      can be changed, but the trigger is hard-coded. For example, RX interrupt trigger
      in 16550A can be set to 1, 4, 8, or 14 bytes for HW, but current driver sets
      the trigger to only 8bytes.
      
      This patch makes some devices change RX interrupt trigger from userland.
      
      <How to use>
      - Read current setting
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       8
      
      - Write user setting
       # echo 1 > /sys/class/tty/ttyS0/rx_trig_bytes
       # cat /sys/class/tty/ttyS0/rx_trig_bytes
       1
      
      <Support uart devices>
      - 16550A and Tegra (1, 4, 8, or 14 bytes)
      - 16650V2 (8, 16, 24, or 28 bytes)
      - 16654 (8, 16, 56, or 60 bytes)
      - 16750 (1, 16, 32, or 56 bytes)
      
      <Change log>
      Changes in V9:
       - Use attr_group instead of dev_spec_attr_group of uart_port structure
      
      Changes in V8:
       - Divide this patch from V7's patch based on Greg's comment
      
      Changes in V7:
       - Add Documentation
       - Change I/F name from rx_int_trig to rx_trig_bytes because the name
         rx_int_trig is hard to understand how users specify the value
      
      Changes in V6:
       - Move FCR_RX_TRIG_* definition in 8250.h to include/uapi/linux/serial_reg.h,
         rename those to UART_FCR_R_TRIG_*, and use UART_FCR_TRIGGER_MASK to
         UART_FCR_R_TRIG_BITS()
       - Change following function names:
          convert_fcr2val() => fcr_get_rxtrig_bytes()
          convert_val2rxtrig() => bytes_to_fcr_rxtrig()
       - Fix typo in serial8250_do_set_termios()
       - Delete the verbose error message pr_info() in bytes_to_fcr_rxtrig()
       - Rename *rx_int_trig/rx_trig* to *rxtrig* for several functions or variables
         (but UI remains rx_int_trig)
       - Change the meaningless variable name 'val' to 'bytes' following functions:
          fcr_get_rxtrig_bytes(), bytes_to_fcr_rxtrig(), do_set_rxtrig(),
          do_serial8250_set_rxtrig(), and serial8250_set_attr_rxtrig()
       - Use up->fcr in order to get rxtrig_bytes instead of rx_trig_raw in
         fcr_get_rxtrig_bytes()
       - Use conf_type->rxtrig_bytes[0] instead of switch statement for support check
         in register_dev_spec_attr_grp()
       - Delete the checking whether a user changed FCR or not when minimum buffer
         is needed in serial8250_do_set_termios()
      
      Changes in V5.1:
       - Fix FCR_RX_TRIG_MAX_STATE definition
      
      Changes in V5:
       - Support Tegra, 16650V2, 16654, and 16750
       - Store default FCR value to up->fcr when the port is first created
       - Add rx_trig_byte[] in uart_config[] for each device and use rx_trig_byte[]
         in convert_fcr2val() and convert_val2rxtrig()
      
      Changes in V4:
       - Introduce fifo_bug flag in uart_8250_port structure
         This is enabled only when parity is enabled and UART_BUG_PARITY is enabled
         for up->bugs. If this flag is enabled, user cannot set RX trigger.
       - Return -EOPNOTSUPP when it does not support device at convert_fcr2val() and
         at convert_val2rxtrig()
       - Set the nearest lower RX trigger when users input a meaningless value at
         convert_val2rxtrig()
       - Check whether p->fcr is existing at serial8250_clear_and_reinit_fifos()
       - Set fcr = up->fcr in the begging of serial8250_do_set_termios()
      
      Changes in V3:
       - Change I/F from ioctl(2) to sysfs(rx_int_trig)
      
      Changed in V2:
       - Use _IOW for TIOCSFIFORTRIG definition
       - Pass the interrupt trigger value itself
      Signed-off-by: NYoshihiro YUNOMAE <yoshihiro.yunomae.ez@hitachi.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aef9a7bd
  15. 26 3月, 2013 1 次提交
  16. 18 1月, 2013 1 次提交
  17. 16 1月, 2013 1 次提交
  18. 25 10月, 2012 1 次提交
  19. 27 9月, 2012 1 次提交
  20. 06 9月, 2012 1 次提交
  21. 18 7月, 2012 1 次提交
  22. 13 7月, 2012 1 次提交
  23. 03 5月, 2012 1 次提交
  24. 19 4月, 2012 1 次提交
  25. 10 3月, 2012 1 次提交
    • P
      serial: make 8250's serial_in shareable to other drivers. · 3f0ab327
      Paul Gortmaker 提交于
      Currently 8250.c has serial_in and serial_out as shortcuts
      to doing the port I/O.  They are implemented as macros a
      ways down in the file.  This isn't by accident, but is
      implicitly required, so cpp doesn't mangle other instances
      of the common string "serial_in", as it exists as a field
      in the port struct itself.
      
      The above mangling avoidance violates the principle of least
      surprise, and it also prevents the shortcuts from being
      relocated up to the top of file, or into 8250.h -- either
      being a better location than the current one.
      
      Move them to 8250.h so other 8250-like drivers can also use
      the shortcuts, and in the process, make the conflicting
      names go away by using static inlines instead of macros.
      The object file size remains unchanged with this modification.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3f0ab327
  26. 25 1月, 2012 1 次提交
  27. 10 12月, 2011 1 次提交
  28. 16 11月, 2011 2 次提交
    • G
      Revert "tty/serial: Prevent drop of DCD on suspend for Tegra UARTs" · 6edf0c9b
      Greg Kroah-Hartman 提交于
      This reverts commit 9636b755.
      
      It wasn't supposed to be applied, thanks to Doug for letting me know.
      
      Cc: Doug Anderson <dianders@chromium.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      6edf0c9b
    • D
      tty/serial: Prevent drop of DCD on suspend for Tegra UARTs · 9636b755
      Doug Anderson 提交于
      On Tegra UARTs (except UART1), the DTR / DCD / DSR lines are not
      externally accessible.  Instead, the DTR line internally appears to be
      looped back to be the input to the DCD and DSR lines.  The net effect
      of this is that when we drop DTR (like when we suspend), we'll see DCD
      drop too.  ...and when we see DCD drop, we treat that as a hangup.
      
      In order to prevent this hangup from occurring at every sleep, we need
      to force DTR to remain high on Tegra UARTs.
      
      This patch uses the mcr_mask / mcr_force fields, which were originally
      added for the kludge ALPHA_KLUDGE_MCR.  Using these fields does not
      prevent us from removing ALPHA_KLUDGE_MCR--we can just remove the "if"
      tests I have added and always init mcr_mask / mcr_force from the
      serial8250_config.
      
      NOTE: If we have people that are using UARTA on a Tegra and need to
      control DTR, we'll need to either add a separate port type for UARTA
      or we'll need to add some tegra-specific code to detect whether the
      DTR needs to be left high.
      Signed-off-by: NDoug Anderson <dianders@chromium.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9636b755
  29. 20 5月, 2011 1 次提交
    • S
      tty/serial: Add explicit PORT_TEGRA type · 4539c24f
      Stephen Warren 提交于
      Tegra's UART is currently auto-detected as PORT_XSCALE due to register
      bit UART_IER.UUE being writable. However, the Tegra documentation states
      that this register bit is reserved. Hence, we should not program it.
      
      Instead, the documentation specifies that the UART is 16550 compatible.
      However, Tegra does need register bit UART_IER.RTOIE set, which is not
      enabled by any 16550 port type. This was not noticed before, since
      PORT_XSCALE enables CAP_UUE, which conflates both UUE and RTOIE bit
      programming.
      
      This change defines PORT_TEGRA that doesn't set UART_CAP_UUE, but does
      set UART_CAP_RTOIE, which is a new capability indicating that the RTOIE
      bit needs to be enabled.
      Based-on-code-by: NLaxman Dewangan <ldewangan@nvidia.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Acked-by: NAlan Cox <alan@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      4539c24f
  30. 20 4月, 2011 1 次提交
  31. 14 1月, 2011 1 次提交
    • G
      tty: move drivers/serial/ to drivers/tty/serial/ · ab4382d2
      Greg Kroah-Hartman 提交于
      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 <arnd@arndb.de>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Rogier Wolff <R.E.Wolff@bitwizard.nl>
      Cc: Michael H. Warfield <mhw@wittsend.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      ab4382d2
  32. 20 9月, 2009 1 次提交
  33. 03 9月, 2008 1 次提交
    • W
      8250: improve workaround for UARTs that don't re-assert THRE correctly · 363f66fe
      Will Newton 提交于
      Recent changes to tighten the check for UARTs that don't correctly
      re-assert THRE (01c194d9: "serial 8250:
      tighten test for using backup timer") caused problems when such a UART was
      opened for the second time - the bug could only successfully be detected
      at first initialization.  For users of this version of this particular
      UART IP it is fatal.
      
      This patch stores the information about the bug in the bugs field of the
      port structure when the port is first started up so subsequent opens can
      check this bit even if the test for the bug fails.
      
      David Brownell: "My own exposure to this is that the UART on DaVinci
      hardware, which TI allegedly derived from its original 16550 logic, has
      periodically gone from working to unusable with the mainline 8250.c ...
      and back and forth a bunch.  Currently it's "unusable", a regression from
      some previous versions.  With this patch from Will, it's usable."
      Signed-off-by: NWill Newton <will.newton@gmail.com>
      Acked-by: NAlex Williamson <alex.williamson@hp.com>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: David Brownell <david-b@pacbell.net>
      Cc: <stable@kernel.org>		[2.6.26.x]
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      363f66fe