1. 08 3月, 2017 1 次提交
    • K
      serial: samsung: Continue to work if DMA request fails · f98c7bce
      Krzysztof Kozlowski 提交于
      If DMA is not available (even when configured in DeviceTree), the driver
      will fail the startup procedure thus making serial console not
      available.
      
      For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
          [    1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
          ...
          [   11.435732] samsung-uart 13800000.serial: DMA request failed
          [   72.963893] samsung-uart 13800000.serial: DMA request failed
          [   73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
      
      DMA is not necessary for serial to work, so continue with UART startup
      after emitting a warning.
      
      Fixes: 62c37eed ("serial: samsung: add dma reqest/release functions")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f98c7bce
  2. 03 2月, 2017 1 次提交
  3. 12 1月, 2017 1 次提交
  4. 31 8月, 2016 1 次提交
  5. 26 6月, 2016 3 次提交
    • M
      tty: serial: samsung: add byte-order aware bit functions · bbb5ff91
      Matthew Leach 提交于
      This driver makes use of the __set_bit() and __clear_bit() functions.
      When running under big-endian, these functions don't convert the bit
      indexes when working with peripheral registers, leading to the
      incorrect bits being set and cleared when running big-endian.
      
      Add two new driver functions for setting and clearing bits that are
      byte-order aware.
      Signed-off-by: NMatthew Leach <matthew@mattleach.net>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bbb5ff91
    • K
      serial: samsung: Fix possible out of bounds access on non-DT platform · 926b7b51
      Krzysztof Kozlowski 提交于
      On non-DeviceTree platforms, the index of serial device is a static
      variable incremented on each probe.  It is incremented even if deferred
      probe happens when getting the clock in s3c24xx_serial_init_port().
      
      This index is used for referencing elements of statically allocated
      s3c24xx_serial_ports array.  In case of re-probe, the index will point
      outside of this array leading to memory corruption.
      
      Increment the index only on successful probe.
      Reported-by: NBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Fixes: b497549a ("[ARM] S3C24XX: Split serial driver into core and per-cpu drivers")
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      926b7b51
    • K
      serial: samsung: Fix ERR pointer dereference on deferred probe · e51e4d8a
      Krzysztof Kozlowski 提交于
      When the clk_get() of "uart" clock returns EPROBE_DEFER, the next re-probe
      finishes with success but uses invalid (ERR_PTR) values.  This leads to
      dereferencing of ERR_PTR stored under ourport->clk:
      
      	12c30000.serial: Controller clock not found
      	(...)
      	12c30000.serial: ttySAC3 at MMIO 0x12c30000 (irq = 61, base_baud = 0) is a S3C6400/10
      	Unable to handle kernel paging request at virtual address fffffdfb
      
      	(clk_prepare) from [<c039f7d0>] (s3c24xx_serial_pm+0x20/0x128)
      	(s3c24xx_serial_pm) from [<c0395414>] (uart_change_pm+0x38/0x40)
      	(uart_change_pm) from [<c039689c>] (uart_add_one_port+0x31c/0x44c)
      	(uart_add_one_port) from [<c03a035c>] (s3c24xx_serial_probe+0x2a8/0x418)
      	(s3c24xx_serial_probe) from [<c03ee110>] (platform_drv_probe+0x50/0xb0)
      	(platform_drv_probe) from [<c03ecb44>] (driver_probe_device+0x1f4/0x2b0)
      	(driver_probe_device) from [<c03eb0c0>] (bus_for_each_drv+0x44/0x8c)
      	(bus_for_each_drv) from [<c03ec8c8>] (__device_attach+0x9c/0x100)
      	(__device_attach) from [<c03ebf54>] (bus_probe_device+0x84/0x8c)
      	(bus_probe_device) from [<c03ec388>] (deferred_probe_work_func+0x60/0x8c)
      	(deferred_probe_work_func) from [<c012fee4>] (process_one_work+0x120/0x328)
      	(process_one_work) from [<c0130150>] (worker_thread+0x2c/0x4ac)
      	(worker_thread) from [<c0135320>] (kthread+0xd8/0xf4)
      	(kthread) from [<c0107978>] (ret_from_fork+0x14/0x3c)
      
      The first unsuccessful clk_get() causes s3c24xx_serial_init_port() to
      exit with failure but the s3c24xx_uart_port is left half-configured
      (e.g. port->mapbase is set, clk contains ERR_PTR).  On next re-probe,
      the function s3c24xx_serial_init_port() will exit early with success
      because of configured port->mapbase and driver will use old values,
      including the ERR_PTR as clock.
      
      Fix this by cleaning the port->mapbase on error path so each re-probe
      will initialize all of the port settings.
      
      Fixes: 60e93575 ("serial: samsung: enable clock before clearing pending interrupts during init")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Tested-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Tested-by: NKevin Hilman <khilman@baylibre.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e51e4d8a
  6. 01 5月, 2016 1 次提交
  7. 08 3月, 2016 1 次提交
  8. 07 2月, 2016 1 次提交
    • P
      earlycon: Use common framework for earlycon declarations · 2eaa7909
      Peter Hurley 提交于
      Use a single common table of struct earlycon_id for both command line
      and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a
      unique earlycon declaration (the declaration is only guaranteed to be
      unique within a compilation unit; separate compilation units must still
      use unique earlycon names).
      
      The semantics of OF_EARLYCON_DECLARE() is different; it declares an
      earlycon which can matched either on the command line or by devicetree.
      EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon
      which is matched by command line only. Remove redundant instances of
      EARLYCON_DECLARE().
      
      This enables all earlycons to properly initialize struct console
      with the appropriate name and index, which improves diagnostics and
      enables direct earlycon-to-console handoff.
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2eaa7909
  9. 05 10月, 2015 4 次提交
  10. 05 8月, 2015 2 次提交
  11. 24 7月, 2015 1 次提交
  12. 11 5月, 2015 2 次提交
  13. 28 4月, 2015 1 次提交
    • R
      serial: samsung: fix serial console break · 31c6ba97
      Robert Baldyga 提交于
      This patch fixes problems with serial console break. When function
      s3c64xx_serial_startup() was started while serial console has been working,
      it caused lose of characters written to TX FIFO. This effect was particularly
      observable with systemd, which closes serial port every time when it's
      not currently needed, hence function s3c64xx_serial_startup() is called
      quite often there. To fix this problem we avoid resetting TX FIFO if port is
      used as serial console.
      
      Example of broken console log:
      
      [ 1086.7         Expecting device dev-ttySAC1.device...
      [ 1086.[  OK  ] Reached target Paths.
      [ 1086.756416] s[  OK  ] Reached target Swap.
      [ 1086.776413] systemd[1]: Reached target Swap.
      [ 1086.776642] systemd[1]: Starting Root Slice.
      [    5.53403[  OK  ] Created slice Root Slice.
      [    5.548433] systemd[1]: Create[  OK  ] Created slice User and Session Slice.
      [    5.568414] sys[  OK  ] Listening on /dev/initctl Compatibility Named Pipe.
      [    5.588388] s[  OK  ] Listening on Delayed Shutdown Socket.
      [    5.608376] sy[  OK  ] Listening on Journal Socket (/dev/log).
      [    5.628361] [  OK  ] Listening on udev Kernel Socket.
      [    5.648357] s[  OK  ] Listening on udev Control Socket.
      [    5.668353] s[  OK  ] Listening on Journal Socket.
      [    5.688366] systemd[1]: Listeni[  OK  ] Created slice System Slice.
      [    5.708393]          Mounting Temporary Directory...
      [ 7139.067436]          Starting prepare device daemon...
      [ 7139.091726] sy         Starting Generate environment from /etc/profile.d...
      [    5.792867] system         Starting Create Static Device Nodes in /dev...
      [ 7848.718         Mounting Debug File System...
      [ 7848.7384         Mounting Configuration File System...
      [    5.852         Starting Apply Kernel Variables...
      [    5.8720         Starting Setup Virtual Console...
      [ 7848.798         Starting udev Coldplug all Devices...
      [ 7848.817         Starting Journal Service...
      [  OK  ] Started Journal Service.
      [ 7848.854222] s[  OK  ] Reached target Slices.
               Starting Remount Root and Kernel File Systems...
      [  OK  ] Mounted Configuration File System.
      Reported-by: NChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com>
      Reviewed-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      31c6ba97
  14. 27 3月, 2015 1 次提交
    • J
      serial: samsung: Clear operation mode on UART shutdown · e91d863d
      Javier Martinez Canillas 提交于
      Exynos serial ports operate either in a DMA-based or interrupt-based
      modes. In DMA-based mode, the UART generates a transfer data request
      and a Transmission (Tx) interrupt in interrupt-based mode.
      
      The Tx IRQ is only unmasked in interrupt-based mode and it was done
      in s3c24xx_serial_start_tx(). Commit ba019a3e ("serial: samsung:
      remove redundant interrupt enabling") removed the IRQ enable on that
      function since it is enabled when the mode is set in enable_tx_pio().
      
      The problem is that enable_tx_pio() is only called if the port mode
      has not been set before but the mode was not cleared on .shutdown().
      
      So if the UART was shutdown and then started up again, the mode set
      will remain and the Tx IRQ won't be unmasked.
      
      This caused a hang on at least Exynos5250, Exynos5420 and Exynos5800
      when the system is rebooted or powered off.
      
      Fixes: ba019a3e ("serial: samsung: remove redundant interrupt enabling")
      Signed-off-by: NJavier Martinez Canillas <javier.martinez@collabora.co.uk>
      Reviewed-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e91d863d
  15. 03 2月, 2015 3 次提交
    • M
      serial: samsung: earlycon support depends on CONFIG_SERIAL_SAMSUNG_CONSOLE · c3bda295
      Marek Szyprowski 提交于
      EarlyCon support depends on serial console infrastructure, so the code
      implementing it should depend on CONFIG_SERIAL_SAMSUNG_CONSOLE.
      
      This patch fixes the following build break:
      CC [M]  drivers/tty/serial/samsung.o
      drivers/tty/serial/samsung.c:2468:1: error: expected declaration specifiers or ‘...’ before string constant
      drivers/tty/serial/samsung.c:2468:1: error: expected declaration specifiers or ‘...’ before ‘s3c2410_setup_earlycon’
      drivers/tty/serial/samsung.c:2487:1: error: expected declaration specifiers or ‘...’ before string constant
      drivers/tty/serial/samsung.c:2487:1: error: expected declaration specifiers or ‘...’ before ‘s3c2412_setup_earlycon’
      drivers/tty/serial/samsung.c:2488:1: error: expected declaration specifiers or ‘...’ before string constant
      drivers/tty/serial/samsung.c:2488:1: error: expected declaration specifiers or ‘...’ before ‘s3c2440_setup_earlycon’
      drivers/tty/serial/samsung.c:2489:1: error: expected declaration specifiers or ‘...’ before string constant
      drivers/tty/serial/samsung.c:2489:1: error: expected declaration specifiers or ‘...’ before ‘s3c6400_setup_earlycon’
      drivers/tty/serial/samsung.c:2506:1: error: expected declaration specifiers or ‘...’ before string constant
      drivers/tty/serial/samsung.c:2506:1: error: expected declaration specifiers or ‘...’ before ‘s5pv210_setup_earlycon’
      drivers/tty/serial/samsung.c:2507:1: error: expected declaration specifiers or ‘...’ before string constant
      drivers/tty/serial/samsung.c:2507:1: error: expected declaration specifiers or ‘...’ before ‘exynos4210_setup_earlycon’
      drivers/tty/serial/samsung.c:2468:1: warning: ‘s3c2410_setup_earlycon’ defined but not used [-Wunused-function]
      drivers/tty/serial/samsung.c:2487:1: warning: ‘s3c2412_setup_earlycon’ defined but not used [-Wunused-function]
      drivers/tty/serial/samsung.c:2488:1: warning: ‘s3c2440_setup_earlycon’ defined but not used [-Wunused-function]
      drivers/tty/serial/samsung.c:2489:1: warning: ‘s3c6400_setup_earlycon’ defined but not used [-Wunused-function]
      drivers/tty/serial/samsung.c:2506:1: warning: ‘s5pv210_setup_earlycon’ defined but not used [-Wunused-function]
      drivers/tty/serial/samsung.c:2507:1: warning: ‘exynos4210_setup_earlycon’ defined but not used [-Wunused-function]
      make[3]: *** [drivers/tty/serial/samsung.o] Error 1
      Reported-by: Nkbuild test robot <fengguang.wu@intel.com>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c3bda295
    • R
      serial: samsung: remove redundant interrupt enabling · ba019a3e
      Robert Baldyga 提交于
      Function s3c24xx_serial_start_tx_pio() enables interrupts if needed,
      so we don't have to (or even we shouldn't) enable them before.
      Signed-off-by: NRobert Baldyga <r.baldyga@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ba019a3e
    • T
      serial: samsung: Add support for early console · b94ba032
      Tomasz Figa 提交于
      This patch adds support for early console initialized from device tree
      and kernel command line to all variants of Samsung serial driver.
      Signed-off-by: NTomasz Figa <t.figa@samsung.com>
      [mszyprow: added support for command line based initialization,
                 fixed comments, added documentation]
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NAlim Akhtar <alim.akhtar@samsung.com>
      Tested-by: NAlim Akhtar <alim.akhtar@samsung.com>
      Tested-by: NChanwoo Choi <cw00.choi@samsung.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b94ba032
  16. 10 1月, 2015 5 次提交
  17. 26 11月, 2014 4 次提交
  18. 06 11月, 2014 1 次提交
  19. 20 10月, 2014 1 次提交
  20. 19 7月, 2014 1 次提交
  21. 18 7月, 2014 3 次提交
  22. 11 7月, 2014 1 次提交