1. 17 3月, 2017 2 次提交
  2. 14 3月, 2017 2 次提交
    • J
      serial: 8250_dw: Fix breakage when HAVE_CLK=n · b15bfbe6
      James Hogan 提交于
      Commit 6a171b29 ("serial: 8250_dw: Allow hardware flow control to be
      used") recently broke the 8250_dw driver on platforms which don't select
      HAVE_CLK, as dw8250_set_termios() gets confused by the behaviour of the
      fallback HAVE_CLK=n clock API in linux/clk.h which pretends everything
      is fine but returns (valid) NULL clocks and 0 HZ clock rates.
      
      That 0 rate is written into the uartclk resulting in a crash at boot,
      e.g. on Cavium Octeon III based UTM-8 we get something like this:
      
      1180000000800.serial: ttyS0 at MMIO 0x1180000000800 (irq = 41, base_baud = 25000000) is a OCTEON
      ------------[ cut here ]------------
      WARNING: CPU: 2 PID: 1 at drivers/tty/serial/serial_core.c:441 uart_get_baud_rate+0xfc/0x1f0
      ...
      Call Trace:
      ...
      [<ffffffff8149c2e4>] uart_get_baud_rate+0xfc/0x1f0
      [<ffffffff814a5098>] serial8250_do_set_termios+0xb0/0x440
      [<ffffffff8149c710>] uart_set_options+0xe8/0x190
      [<ffffffff814a6cdc>] serial8250_console_setup+0x84/0x158
      [<ffffffff814a11ec>] univ8250_console_setup+0x54/0x70
      [<ffffffff811901a0>] register_console+0x1c8/0x418
      [<ffffffff8149f004>] uart_add_one_port+0x434/0x4b0
      [<ffffffff814a1af8>] serial8250_register_8250_port+0x2d8/0x440
      [<ffffffff814aa620>] dw8250_probe+0x388/0x5e8
      ...
      
      The clock API is defined such that NULL is a valid clock handle so it
      wouldn't be right to check explicitly for NULL. Instead treat a
      clk_round_rate() return value of 0 as an error which prevents uartclk
      being overwritten.
      
      Fixes: 6a171b29 ("serial: 8250_dw: Allow hardware flow control to be used")
      Signed-off-by: NJames Hogan <james.hogan@imgtec.com>
      Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
      Cc: David Daney <david.daney@cavium.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: linux-serial@vger.kernel.org
      Cc: linux-clk@vger.kernel.org
      Cc: linux-mips@linux-mips.org
      Cc: bcm-kernel-feedback-list@broadcom.com
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Reviewed-by: NJason Uy <jason.uy@broadcom.com>
      Reviewed-by: NHeiko Stuebner <heiko@sntech.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b15bfbe6
    • H
      serial: 8250_dw: Honor clk_round_rate errors in dw8250_set_termios · 09498087
      Heiko Stuebner 提交于
      clk_round_rate returns a signed long and may possibly return errors
      in it, for example if there is no possible rate.
      
      Till now dw8250_set_termios ignored any error, the signednes and would
      just use the value as input to clk_set_rate. This of course falls apart
      if there is an actual error, so check for errors and only try to set
      a rate if the value is actually valid.
      
      This turned up on some Rockchip platforms after commit
      6a171b29 ("serial: 8250_dw: Allow hardware flow control to be used")
      enabled set_termios callback in all cases, not only ACPI.
      
      Fixes: 6a171b29 ("serial: 8250_dw: Allow hardware flow control to be used")
      Signed-off-by: NHeiko Stuebner <heiko@sntech.de>
      Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      09498087
  3. 08 3月, 2017 2 次提交
    • 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
    • A
      tty: n_hdlc: get rid of racy n_hdlc.tbuf · 82f2341c
      Alexander Popov 提交于
      Currently N_HDLC line discipline uses a self-made singly linked list for
      data buffers and has n_hdlc.tbuf pointer for buffer retransmitting after
      an error.
      
      The commit be10eb75
      ("tty: n_hdlc add buffer flushing") introduced racy access to n_hdlc.tbuf.
      After tx error concurrent flush_tx_queue() and n_hdlc_send_frames() can put
      one data buffer to tx_free_buf_list twice. That causes double free in
      n_hdlc_release().
      
      Let's use standard kernel linked list and get rid of n_hdlc.tbuf:
      in case of tx error put current data buffer after the head of tx_buf_list.
      Signed-off-by: NAlexander Popov <alex.popov@linux.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      82f2341c
  4. 02 3月, 2017 6 次提交
  5. 28 2月, 2017 2 次提交
  6. 24 2月, 2017 2 次提交
  7. 23 2月, 2017 1 次提交
  8. 16 2月, 2017 1 次提交
  9. 15 2月, 2017 1 次提交
    • R
      atmel_serial: Use the fractional divider when possible · 2867af2d
      Romain Izard 提交于
      The fractional baud rate generator is available when using the
      asynchronous mode of Atmel USART controllers. It makes it possible to
      use higher baudrates, in exchange for a less precise clock with a
      variable duty cycle.
      
      The existing code restricts its use to the normal mode of the USART
      controller, following the recommendation from the datasheet for the
      first chip embedding this type of controller. This recommendation has
      been removed from the documentation for the newer chips. After
      verification, all revisions of this controller should be able to use the
      fractional baud rate generator with the different asynchronous modes.
      
      Removing the condition on ATMEL_US_USMODE makes it possible to get
      correct baudrates at high speed in more cases.
      
      This was tested with a board using an Atmel SAMA5D2 chip and a TI
      WL1831 WiFi/Bluetooth combo chip at 3 Mbauds, with hardware flow control
      enabled.
      Signed-off-by: NRomain Izard <romain.izard.pro@gmail.com>
      Acked-by: NLudovic Desroches <ludovic.desroches@microchip.com>
      Signed-off-by: NRichard Genoud <richard.genoud@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2867af2d
  10. 10 2月, 2017 10 次提交
  11. 09 2月, 2017 2 次提交
  12. 06 2月, 2017 9 次提交