1. 06 11月, 2014 1 次提交
  2. 29 9月, 2014 2 次提交
    • F
      tty: omap-serial: pull out calculation from baud_is_mode16 · 13d6ceb4
      Frans Klaver 提交于
      To determine the correct divisor, we need to know the difference between
      the desired baud rate and the actual baud rate. The calculation for this
      difference is implemented twice within omap_serial_baud_is_mode16().
      Pull out the calculation for easier maintenance.
      
      While at it, remove the CamelCasing from the variable names.
      Signed-off-by: NFrans Klaver <frans.klaver@xsens.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      13d6ceb4
    • F
      tty: omap-serial: fix division by zero · dc318756
      Frans Klaver 提交于
      If the chosen baud rate is large enough (e.g. 3.5 megabaud), the
      calculated n values in serial_omap_is_baud_mode16() may become 0. This
      causes a division by zero when calculating the difference between
      calculated and desired baud rates. To prevent this, cap the n13 and n16
      values on 1.
      
      Division by zero in kernel.
      [<c00132e0>] (unwind_backtrace) from [<c00112ec>] (show_stack+0x10/0x14)
      [<c00112ec>] (show_stack) from [<c01ed7bc>] (Ldiv0+0x8/0x10)
      [<c01ed7bc>] (Ldiv0) from [<c023805c>] (serial_omap_baud_is_mode16+0x4c/0x68)
      [<c023805c>] (serial_omap_baud_is_mode16) from [<c02396b4>] (serial_omap_set_termios+0x90/0x8d8)
      [<c02396b4>] (serial_omap_set_termios) from [<c0230a0c>] (uart_change_speed+0xa4/0xa8)
      [<c0230a0c>] (uart_change_speed) from [<c0231798>] (uart_set_termios+0xa0/0x1fc)
      [<c0231798>] (uart_set_termios) from [<c022bb44>] (tty_set_termios+0x248/0x2c0)
      [<c022bb44>] (tty_set_termios) from [<c022c17c>] (set_termios+0x248/0x29c)
      [<c022c17c>] (set_termios) from [<c022c3e4>] (tty_mode_ioctl+0x1c8/0x4e8)
      [<c022c3e4>] (tty_mode_ioctl) from [<c0227e70>] (tty_ioctl+0xa94/0xb18)
      [<c0227e70>] (tty_ioctl) from [<c00cf45c>] (do_vfs_ioctl+0x4a0/0x560)
      [<c00cf45c>] (do_vfs_ioctl) from [<c00cf568>] (SyS_ioctl+0x4c/0x74)
      [<c00cf568>] (SyS_ioctl) from [<c000e480>] (ret_fast_syscall+0x0/0x30)
      Signed-off-by: NFrans Klaver <frans.klaver@xsens.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc318756
  3. 25 4月, 2014 9 次提交
  4. 17 4月, 2014 2 次提交
    • T
      serial: omap: Fix missing pm_runtime_resume handling by simplifying code · d758c9c1
      Tony Lindgren 提交于
      The lack of pm_runtime_resume handling for the device state leads into
      device wake-up interrupts not working after a while for runtime PM.
      
      Also, serial-omap is confused about the use of device_may_wakeup.
      The checks for device_may_wakeup should only be done for suspend and
      resume, not for pm_runtime_suspend and pm_runtime_resume. The wake-up
      events for PM runtime should always be enabled.
      
      The lack of pm_runtime_resume handling leads into device wake-up
      interrupts not working after a while for runtime PM.
      
      Rather than try to patch over the issue of adding complex tests to
      the pm_runtime_resume, let's fix the issues properly:
      
      1. Make serial_omap_enable_wakeup deal with all internal PM state
         handling so we don't need to test for up->wakeups_enabled elsewhere.
      
         Later on once omap3 boots in device tree only mode we can also
         remove the up->wakeups_enabled flag and rely on the wake-up
         interrupt enable/disable state alone.
      
      2. Do the device_may_wakeup checks in suspend and resume only,
         for runtime PM the wake-up events need to be always enabled.
      
      3. Finally just call serial_omap_enable_wakeup and make sure we
         call it also in pm_runtime_resume.
      
      4. Note that we also have to use disable_irq_nosync as serial_omap_irq
         calls pm_runtime_get_sync.
      
      Fixes: 2a0b965c (serial: omap: Add support for optional wake-up)
      Cc: stable@vger.kernel.org # v3.13+
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d758c9c1
    • S
  5. 18 3月, 2014 2 次提交
  6. 14 2月, 2014 3 次提交
  7. 01 11月, 2013 1 次提交
  8. 30 10月, 2013 3 次提交
  9. 17 10月, 2013 1 次提交
  10. 27 9月, 2013 2 次提交
  11. 28 8月, 2013 2 次提交
  12. 16 8月, 2013 1 次提交
  13. 15 8月, 2013 1 次提交
    • M
      OMAP: add RS485 support · 4a0ac0f5
      Mark Jackson 提交于
      This patch adds RS485 support to the OMAP serial driver, as
      defined in:-
      
      Documentation/devicetree/bindings/serial/rs485.txt
      
      When a UART transmitter is connected to (eg) a RS485 driver, it is
      necessary to turn the driver on/off as quickly as possible.  This is
      best achieved in the serial driver itself (rather than in userspace
      where the latency can be quite large).
      
      This patch allows a GPIO pin to be defined (via DT) that controls
      the enabling of the driver at the start of a message, and disables
      the driver when the message has been completed.
      
      When RS485 is disabled, the RTS pin is set to on.
      Signed-off-by: NMark Jackson <mpfj@newflow.co.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4a0ac0f5
  14. 01 8月, 2013 1 次提交
  15. 27 7月, 2013 6 次提交
  16. 25 7月, 2013 1 次提交
  17. 18 6月, 2013 1 次提交
    • T
      serial: omap: Fix device tree based PM runtime · a630fbfb
      Tony Lindgren 提交于
      In the runtime_suspend function pdata is not being used, and
      also blocks the function in device tree based booting. Fix it
      by removing the unused pdata from the runtime_suspend function.
      
      Further, context loss count is not being passed in pdata, so
      let's just reinitialize the port every time for those case.
      This can be further optimized later on for the device tree
      case by adding detection for the hardware state and possibly
      by adding a driver specific autosuspend timeout.
      
      And doing this, we can then make the related dev_err into a
      dev_dbg message instead of an error.
      
      In order for the wake-up events to work, we also need to set
      autosuspend_timeout to -1 if 0, and also device_init_wakeup()
      as that's not being done by the platform init code for the
      device tree case.
      
      Note that this does not affect legacy booting, and in fact
      might make it work for the cases where the context loss info
      is not being passed in pdata.
      
      Thanks to Kevin Hilman <khilman@linaro.org> for debugging
      and suggesting fixes for the autosuspend_timeout and
      device_init_wakeup() related initializiation.
      Reviewed-by: NKevin Hilman <khilman@linaro.org>
      Tested-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a630fbfb
  18. 07 6月, 2013 1 次提交