1. 23 4月, 2013 2 次提交
  2. 18 4月, 2013 1 次提交
  3. 16 4月, 2013 3 次提交
    • F
      serial_core.c: add put_device() after device_find_child() · 5a65dcc0
      Federico Vaga 提交于
      The serial core uses device_find_child() but does not drop the reference to
      the retrieved child after using it. This patch add the missing put_device().
      
      What I have done to test this issue.
      
      I used a machine with an AMBA PL011 serial driver. I tested the patch on
      next-20120408 because the last branch [next-20120415] does not boot on this
      board.
      
      For test purpose, I added some pr_info() messages to print the refcount
      after device_find_child() (lines: 1937,2009), and after put_device()
      (lines: 1947, 2021).
      
      Boot the machine *without* put_device(). Then:
      
      echo reboot > /sys/power/disk
      echo disk > /sys/power/state
      [   87.058575] uart_suspend_port:1937 refcount 4
      [   87.058582] uart_suspend_port:1947 refcount 4
      [   87.098083] uart_resume_port:2009refcount 5
      [   87.098088] uart_resume_port:2021 refcount 5
      
      echo disk > /sys/power/state
      [  103.055574] uart_suspend_port:1937 refcount 6
      [  103.055580] uart_suspend_port:1947 refcount 6
      [  103.095322] uart_resume_port:2009 refcount 7
      [  103.095327] uart_resume_port:2021 refcount 7
      
      echo disk > /sys/power/state
      [  252.459580] uart_suspend_port:1937 refcount 8
      [  252.459586] uart_suspend_port:1947 refcount 8
      [  252.499611] uart_resume_port:2009 refcount 9
      [  252.499616] uart_resume_port:2021 refcount 9
      
      The refcount continuously increased.
      
      Boot the machine *with* this patch. Then:
      
      echo reboot > /sys/power/disk
      echo disk > /sys/power/state
      [  159.333559] uart_suspend_port:1937 refcount 4
      [  159.333566] uart_suspend_port:1947 refcount 3
      [  159.372751] uart_resume_port:2009 refcount 4
      [  159.372755] uart_resume_port:2021 refcount 3
      
      echo disk > /sys/power/state
      [  185.713614] uart_suspend_port:1937 refcount 4
      [  185.713621] uart_suspend_port:1947 refcount 3
      [  185.752935] uart_resume_port:2009 refcount 4
      [  185.752940] uart_resume_port:2021 refcount 3
      
      echo disk > /sys/power/state
      [  207.458584] uart_suspend_port:1937 refcount 4
      [  207.458591] uart_suspend_port:1947 refcount 3
      [  207.498598] uart_resume_port:2009 refcount 4
      [  207.498605] uart_resume_port:2021 refcount 3
      
      The refcount correctly handled.
      Signed-off-by: NFederico Vaga <federico.vaga@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5a65dcc0
    • A
      serial: sccnxp: Replace pdata.init/exit with regulator API · 31815c08
      Alexander Shiyan 提交于
      Typical usage of pdata.init/exit is enable/disable power and/or toggle
      reset for the target chip.
      This patch replaces these callbacks with regulator API.
      Signed-off-by: NAlexander Shiyan <shc_work@mail.ru>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      31815c08
    • A
  4. 13 4月, 2013 1 次提交
  5. 12 4月, 2013 12 次提交
  6. 09 4月, 2013 1 次提交
  7. 06 4月, 2013 1 次提交
  8. 04 4月, 2013 2 次提交
  9. 30 3月, 2013 1 次提交
    • C
      ARM: PL011: Add support for Rx DMA buffer polling. · cb06ff10
      Chanho Min 提交于
      In DMA support, The received data is not pushed to tty until the DMA buffer
      is filled. But some megabyte rate chips such as BT expect fast response and
      data should be pushed immediately. In order to fix this issue, We suggest
      the use of the timer for polling DMA buffer.
      In our test, no data loss occurred at high-baudrate as compared with interrupt-
      driven (We tested with 3Mbps).
      We changes:
      
      - We add timer for polling. If we set poll_timer to 10, every 10ms,
       timer handler checks the residue in the dma buffer and transfer data
       to the tty. Also, last_residue is updated for the next polling.
      
      - poll_timeout is used to prevent the timer's system cost.
        If poll_timeout is set to 3000 and no data is received in 3 seconds,
        we inactivate poll timer and driver falls back to interrupt-driven.
        When data is received again in FIFO and UART irq is occurred, we switch
        back to DMA mode and start polling.
      
      - We use consistent DMA mappings to avoid from the frequent cache operation
        of the timer function for default.
      
      - pl011_dma_rx_chars is modified. the pending size is recalculated because
        data can be taken by polling.
      
      - the polling time is adjusted if dma rx poll is enabled but no rate is
        specified. Ideal polling interval to push 1 character at every interval
        is the reciprocal of 'baud rate / 10 line bits per character / 1000 ms
        per sec'. But It is very aggressive to system. Experimentally,
       '10000000 / baud' is suitable to receive dozens of characters. the poll rate
       can be specified statically by dma_rx_poll_rate of the platform data as well.
      
      Changes compared to v1:
       - Use of consistent DMA mappings.
       - Added dma_rx_poll_rate in platform data to specify the polling interval.
       - Added dma_rx_poll_timeout in platform data to specify the polling timeout.
      
      Changes compared to v2:
       - Use of consistent DMA mappings for default.
       - Added dma_rx_poll_enable in platform data to adjust the polling time
         according to the baud rate.
       - remove unnecessary lock from the polling function.
      Signed-off-by: NChanho Min <chanho.min@lge.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cb06ff10
  10. 29 3月, 2013 5 次提交
  11. 26 3月, 2013 9 次提交
  12. 19 3月, 2013 2 次提交
    • Z
      driver: tty: serial: remove cast for kzalloc return value · b9a129f4
      Zhang Yanfei 提交于
      remove cast for kzalloc return value.
      Signed-off-by: NZhang Yanfei <zhangyanfei@cn.fujitsu.com>
      Cc: Jiri Slaby <jslaby@suse.cz>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b9a129f4
    • J
      TTY: serial, stop accessing potential NULLs · 7bbe08d6
      Jiri Slaby 提交于
      The following commits:
      * 6732c8bb (TTY: switch
        tty_schedule_flip)
      * 2e124b4a (TTY: switch
        tty_flip_buffer_push)
      * 05c7cd39 (TTY: switch
        tty_insert_flip_string)
      * 92a19f9c (TTY: switch
        tty_insert_flip_char)
      * 227434f8 (TTY: switch
        tty_buffer_request_room to tty_port)
      
      introduced a potential NULL dereference to some drivers. In
      particular, when the device is used as a console, incoming bytes can
      kill the box. This is caused by removed checks for TTY against NULL.
      
      It happened because it was unclear to me why the checks were there. I
      assumed them superfluous because the interrupts were unbound or
      otherwise stopped. But this is not the case for consoles for these
      drivers, as was pointed out by David Miller.
      
      Now, this patch re-introduces the checks (at this point we check
      port->state, not the tty proper, as we do not care about tty pointers
      anymore). For both of the drivers, we place the check below the
      handling of break signal so that sysrq can actually work. (One needs
      to issue a break and then sysrq key within the following 5 seconds.)
      
      We do not change sc26xx, sunhv, and sunsu here because they behave the
      same as before.  People having that hardware should fix the driver
      eventually, however. They always could unconditionally dereference tty
      in receive_chars, port->state in uart_handle_dcd_change, and
      up->port.state->port.tty.
      
      There is perhaps more to fix in all those drivers, but they are at
      least in a state they were before.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: sparclinux@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7bbe08d6