1. 06 11月, 2014 2 次提交
    • F
      serial: imx: Remove unneeded goto label · cb0f0a5f
      Fabio Estevam 提交于
      Instead of jumping to 'error_out1' label we can simplify the code and return the
      error code directly.
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb0f0a5f
    • F
      serial: imx: Fix the reporting of interrupts · c0d1c6b0
      Fabio Estevam 提交于
      On a imx system with ttymxc0, ttymxc1 and ttymxc4 registered we see the
      following output from 'cat /proc/interrupts':
      
      $ cat /proc/interrupts
                 CPU0
      ...
       58:         39       GIC  58  2020000.serial
       67:        115       GIC  67  21f8000.i2c
      
      The only uart irq that appears is ttymxc0, which is the console.
      
      As ttymxc1 and ttymxc4 will only have their irq registered at imx_startup(),
      they are not shown right after probe.
      
      Transmitting to ttymxc1 and ttymxc4 will cause their irqs to be registered, but
      the output shows:
      
      $ echo "111111" > /dev/ttymxc1
      $ echo "444444" > /dev/ttymxc4
      $ cat /proc/interrupts
                 CPU0
      ...
       58:        150       GIC  58  2020000.serial
       59:          1       GIC  59
       62:          1       GIC  62
       67:        115       GIC  67  21f8000.i2c
      
      ,which misses printing the associated device address.
      
      In order to fix this, register all the irqs inside the probe function via
      devm_request_irq(), which will correctly report the serial interrupts associated
      with their correspondent serial device and also helps simplyfing the code by
      avoiding the calls to free_irq().
      
      $ echo "111111" > /dev/ttymxc1
      $ echo "444444" > /dev/ttymxc4
      $ cat /proc/interrupts
      
      	   CPU0
      ....
       58:        202       GIC  58  2020000.serial
       59:          1       GIC  59  21e8000.serial
       62:          1       GIC  62  21f4000.serial
       67:        115       GIC  67  21f8000.i2c
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c0d1c6b0
  2. 29 9月, 2014 3 次提交
  3. 09 9月, 2014 2 次提交
    • D
      serial: imx: clean up imx_poll_get_char() · 26c47412
      Dirk Behme 提交于
      Looking at the get_poll_char() function of the 8250.c serial driver,
      we learn:
      
      * poll_get_char() doesn't have to save/disable/restore the interrupt
        registers. No interrupt handling is needed in this function at all.
        Remove it.
      
      * Don't block in case there is no data available. So instead blocking
        in the do {} while loop, just return with NO_POLL_CHAR, immediately .
      
      Additionally, while the i.MX6 register URXD[7-0] contain the RX_DATA,
      the upper bits of this register (URXD[15-10]) might contain some
      control flags. To ensure that these are not returned with the data
      read, just mask out URXD[7-0].
      
      These changes fix the 'hang' working with kdb:
      
      $ echo ttymxc3 > /sys/module/kgdboc/parameters/kgdboc
      $ echo g >/proc/sysrq-trigger
      [0]kdb> help
      ...
      <hang>
      Signed-off-by: NDirk Behme <dirk.behme@de.bosch.com>
      Signed-off-by: NDaniel Thompson <daniel.thompson@linaro.org>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: linux-serial@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      26c47412
    • P
      serial: imx: Fix x_char handling and tx flow control · 5e42e9a3
      Peter Hurley 提交于
      The serial core expects the UART driver to transmit x_char
      (START/STOP chars) even if tx is stopped and before data already
      in the tx ring buffer if possible. Also, sending x_char must
      not cause additional data in the tx ring buffer to transmit
      if tx is stopped.
      
      Cause x_char to be transmitted before any other data is sent.
      Auto-stop tx if the tx ring buffer is empty or tx should be stopped.
      Only perform one write wakeup if tx ring buffer space is below
      threshold.
      
      x_char handling in DMA mode is still broken; add FIXME.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5e42e9a3
  4. 12 7月, 2014 1 次提交
  5. 11 7月, 2014 1 次提交
    • P
      serial: Test for no tx data on tx restart · c557d392
      Peter Hurley 提交于
      Commit 717f3bba,
      'serial_core: Fix conditional start_tx on ring buffer not empty'
      exposes an incorrect assumption in several drivers' start_tx methods;
      the tx ring buffer can, in fact, be empty when restarting tx while
      performing flow control.
      
      Affected drivers:
      sunsab.c
      ip22zilog.c
      pmac_zilog.c
      sunzilog.c
      m32r_sio.c
      imx.c
      
      Other in-tree serial drivers either are not affected or already
      test for empty tx ring buffer before transmitting.
      
      Test for empty tx ring buffer in start_tx() method, after transmitting
      x_char (if applicable).
      Reported-by: NAaro Koskinen <aaro.koskinen@iki.fi>
      Cc: Seth Bollinger <sethb@digi.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Sam Ravnborg <sam@ravnborg.org>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Cc: stable <stable@vger.kernel.org> # 3.15
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c557d392
  6. 30 5月, 2014 1 次提交
  7. 29 5月, 2014 5 次提交
  8. 01 3月, 2014 3 次提交
  9. 14 2月, 2014 1 次提交
  10. 09 12月, 2013 1 次提交
  11. 17 10月, 2013 5 次提交
  12. 08 10月, 2013 1 次提交
  13. 27 9月, 2013 2 次提交
  14. 31 8月, 2013 1 次提交
  15. 13 8月, 2013 1 次提交
  16. 01 8月, 2013 1 次提交
  17. 27 7月, 2013 5 次提交
  18. 25 7月, 2013 1 次提交
  19. 18 6月, 2013 1 次提交
    • F
      serial: imx: Fix serial clock unbalance · 80c48497
      Fabio Estevam 提交于
      Since commit 0c375501 (serial: imx: enable the clocks for console), the
      imx_startup() function calls clk_prepare_enable conditionally, so we
      need to call clk_disable_unprepare inside imx_shutdown() under the same
      condition to avoid unbalanced clock calls.
      
      This avoids the following warning:
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 70 at drivers/clk/clk.c:780 __clk_disable+0x68/0x84()
      Modules linked in:
      CPU: 0 PID: 70 Comm: mountall Not tainted 3.10.0-rc4-next-20130607+ #435
      Backtrace:
      [<800116a4>] (dump_backtrace+0x0/0x10c) from [<80011844>] (show_stack+0x18/0x1c)
       r6:8069f4e8 r5:0000030c r4:00000000 r3:00000000
      [<8001182c>] (show_stack+0x0/0x1c) from [<8053bce0>] (dump_stack+0x78/0x94)
      [<8053bc68>] (dump_stack+0x0/0x94) from [<80023df8>] (warn_slowpath_common+0x6c/0x8c)
       r4:00000000 r3:00000000
      [<80023d8c>] (warn_slowpath_common+0x0/0x8c) from [<80023e3c>] (warn_slowpath_null+0x24/0x2c)
       r8:bf2ed008 r7:bfaa9810 r6:000f0013 r5:bf824b80 r4:bf824b80
      [<80023e18>] (warn_slowpath_null+0x0/0x2c) from [<8041af84>] (__clk_disable+0x68/0x84)
      [<8041af1c>] (__clk_disable+0x0/0x84) from [<8041b098>] (clk_disable+0x20/0x2c)
       r4:600f0013 r3:00000001
      [<8041b078>] (clk_disable+0x0/0x2c) from [<802c93e8>] (imx_shutdown+0xbc/0xec)
       r5:bf824b80 r4:bfaa9810
      [<802c932c>] (imx_shutdown+0x0/0xec) from [<802c63a0>] (uart_port_shutdown+0x34/0x40)
       r5:bf86f860 r4:bfaa9810
      [<802c636c>] (uart_port_shutdown+0x0/0x40) from [<802c68c0>] (uart_shutdown+0x98/0xc4)
       r4:bf86f800 r3:00000000
      [<802c6828>] (uart_shutdown+0x0/0xc4) from [<802c7514>] (uart_close+0x5c/0x198)
       r7:bfaa9810 r6:bf274400 r5:bf86f86c r4:bf86f800
      [<802c74b8>] (uart_close+0x0/0x198) from [<802ac648>] (tty_release+0xf8/0x500)
      [<802ac550>] (tty_release+0x0/0x500) from [<800c5a30>] (__fput+0x9c/0x208)
      [<800c5994>] (__fput+0x0/0x208) from [<800c5bac>] (____fput+0x10/0x14)
      [<800c5b9c>] (____fput+0x0/0x14) from [<80040234>] (task_work_run+0xb4/0xec)
      [<80040180>] (task_work_run+0x0/0xec) from [<80029238>] (do_exit+0x2b0/0x920)
       r8:8000e144 r7:000000f8 r6:bf306300 r5:00000000 r4:bfac1180
      [<80028f88>] (do_exit+0x0/0x920) from [<80029a4c>] (do_group_exit+0x50/0xd4)
       r7:000000f8
      [<800299fc>] (do_group_exit+0x0/0xd4) from [<80029ae8>] (__wake_up_parent+0x0/0x28)
       r7:000000f8 r6:00000001 r5:0006f7ae r4:0006f79a
      [<80029ad0>] (SyS_exit_group+0x0/0x18) from [<8000dfc0>] (ret_fast_syscall+0x0/0x30)
      ---[ end trace 16d080eb7efea4e9 ]---
      Reported-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
      Tested-by: NShawn Guo <shawn.guo@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      80c48497
  20. 09 6月, 2013 1 次提交
  21. 07 6月, 2013 1 次提交