1. 18 10月, 2015 19 次提交
    • H
      serial: 8250_pci: Intel MID UART support to its own driver · d9eda9ba
      Heikki Krogerus 提交于
      Intel MID UART quirks require already quite a bit of code
      in 8250_pci.c. On new Intel platforms where it is used, the
      integrated DMA engine no longer has its own PCI device, but
      is instead configured from the UART's MMIO. That means we
      will have to add even more code for handling just MID UARTs.
      
      Instead of adding that to 8250_pci.c, splitting the support
      of Intel MID UART into its own driver. Handling of the
      integrated DMA engine becomes much simpler this way. Own
      driver will also remove the need for things like specific
      set_termios hooks for every board using this UART, and
      simplify the handling of it in general.
      Signed-off-by: NHeikki Krogerus <heikki.krogerus@linux.intel.com>
      Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d9eda9ba
    • S
      serial: fsl_lpuart: add earlycon support · 1d59b382
      Stefan Agner 提交于
      Add support for DT and command line based earlycon support for
      lpuart and lpuart32 used on Freescale Vybrid and and QorIQ LS1021A
      processors.
      Signed-off-by: NStefan Agner <stefan@agner.ch>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1d59b382
    • P
      tty: disable unbind for old 74xx based serial/mpsc console port · 6200cbaf
      Paul Gortmaker 提交于
      We recently got rid of some modular code in this driver and also
      got rid of the unused ".remove" function at the same time.  Thierry
      noted that it was however possible to force the remove through the
      bind/unbind interface.
      
      Since this is a console device used on 2005 vintage 74xx based
      powerpc embedded targets, and is essentially always used in
      conjunction with SERIAL_MPSC_CONSOLE=y -- there is no sane reason
      anyone would ever want to unbind the builtin driver and lose the
      console.  So we just explicitly block bind/unbind operations and
      prevent root from shooting themselves in the foot.
      
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: linux-serial@vger.kernel.org
      Cc: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6200cbaf
    • P
      n_tty: Remove reader wakeups for TTY_BREAK/TTY_PARITY chars · b3868e20
      Peter Hurley 提交于
      Waking the reader immediately upon receipt of TTY_BREAK or TTY_PARITY
      chars has no effect on the outcome of read():
      1. Only non-canonical/EXTPROC mode applies since canonical mode
         will not return data until a line termination is received anyway
      2. EXTPROC mode - the reader will always be woken by the input worker
      3. Non-canonical modes
         a. MIN == 0, TIME == 0
         b. MIN == 0, TIME > 0
         c. MIN > 0, TIME > 0
            minimum_to_wake is always 1 in these modes so the reader will always
            be woken by the input worker
         d. MIN > 0, TIME == 0
            although the reader will not be woken by the input worker unless the
            minimum data is received, the reader would not otherwise have
            returned the received data
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b3868e20
    • J
      tty: synclink, fix indentation · 4bd01622
      Jiri Slaby 提交于
      The statement after if should be indenteted. So fix this.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4bd01622
    • J
      serial: at91, fix rs485 properties · 77bdec6f
      Jiri Slaby 提交于
      There is a misplaced bracket in atmel_init_rs485 which sets
      rs485-rx-during-tx and rs485-enabled-at-boot-time only if
      rs485-rts-delay is set in of.
      
      This is clearly a bug, so fix it by moving the bracket to the proper
      place.
      Signed-off-by: NJiri Slaby <jslaby@suse.cz>
      Cc: Elen Song <elen.song@atmel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77bdec6f
    • P
      tty: r3964: Replace/remove bogus tty lock use · aba24888
      Peter Hurley 提交于
      The tty lock is strictly for serializing tty lifetime events
      (open/close/hangup), and not for line discipline serialization.
      
      The tty core already provides serialization of concurrent writes
      to the same tty, and line discipline lifetime management (by ldisc
      references), so pinning the tty via tty_lock() is unnecessary and
      counter-productive; remove tty lock use.
      
      However, the line discipline is responsible for serializing reads
      (if required by the line discipline); add read_lock mutex to
      serialize calls of r3964_read().
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aba24888
    • P
      tty: r3964: Use tty->read_wait waitqueue · 9b9ab1b3
      Peter Hurley 提交于
      The tty core provides read_wait waitqueue specifically for line
      disciplines to wait readers; otherwise, the line discipline may
      miss wakeups generated by the tty core.
      
      NB: The tty core already provides serialization for the line discipline's
      close() method, and guarantees no readers or writers will be using the
      closing instance of the line discipline. Completely remove that wakeup.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9b9ab1b3
    • P
      tty: Remove tty_port::close_wait · cc2aaabf
      Peter Hurley 提交于
      With the removal of tty_wait_until_sent_from_close(), tty drivers
      no longer wait during open for parallel closes to complete (instead,
      the tty core waits before calling the driver open() method). Thus,
      the close_wait waitqueue is no longer used for waiting.
      
      Remove struct tty_port::close_wait.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cc2aaabf
    • P
      tty: Remove ASYNC_CLOSING checks in open()/hangup() methods · fef062cb
      Peter Hurley 提交于
      Since at least before 2.6.30, tty drivers that do not drop the tty lock
      while closing cannot observe ASYNC_CLOSING set while holding the
      tty lock; this includes the tty driver's open() and hangup() methods,
      since the tty core calls these methods holding the tty lock.
      
      For these drivers, waiting for ASYNC_CLOSING to clear while opening
      is not required, since this condition cannot occur. Similarly, even
      when the open() method drops and reacquires the tty lock after
      blocking, ASYNC_CLOSING cannot be set (again, for drivers that
      do not drop the tty lock while closing).
      
      Now that tty port drivers no longer drop the tty lock while closing
      (since 'tty: Remove tty_wait_until_sent_from_close()'), the same
      conditions apply: waiting for ASYNC_CLOSING to clear while opening
      is not required, nor is re-checking ASYNC_CLOSING after dropping and
      reacquiring the tty lock while blocking (eg., in *_block_til_ready()).
      
      Note: The ASYNC_CLOSING flag state is still maintained since several
      bitrotting drivers use it for (dubious) other purposes.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fef062cb
    • P
      tty: Remove tty_wait_until_sent_from_close() · 79c1faa4
      Peter Hurley 提交于
      tty_wait_until_sent_from_close() drops the tty lock while waiting
      for the tty driver to finish sending previously accepted data (ie.,
      data remaining in its write buffer and transmit fifo).
      
      tty_wait_until_sent_from_close() was added by commit a57a7bf3
      ("TTY: define tty_wait_until_sent_from_close") to prevent the entire
      tty subsystem from being unable to open new ttys while waiting for
      one tty to close while output drained.
      
      However, since commit 0911261d ("tty: Don't take tty_mutex for tty
      count changes"), holding a tty lock while closing does not prevent other
      ttys from being opened/closed/hung up, but only prevents lifetime event
      changes for the tty under lock.
      
      Holding the tty lock while waiting for output to drain does prevent
      parallel non-blocking opens (O_NONBLOCK) from advancing or returning
      while the tty lock is held. However, all parallel opens _already_
      block even if the tty lock is dropped while closing and the parallel
      open advances. Blocking in open has been in mainline since at least 2.6.29
      (see tty_port_block_til_ready(); note the test for O_NONBLOCK is _after_
      the wait while ASYNC_CLOSING).
      
      IOW, before this patch a non-blocking open will sleep anyway for the
      _entire_ duration of a parallel hardware shutdown, and when it wakes, the
      error return will cause a release of its tty, and it will restart with
      a fresh attempt to open. Similarly with a blocking open that is already
      waiting; when it's woken, the hardware shutdown has already completed
      to ASYNC_INITIALIZED is not set, which forces a release and restart as
      well.
      
      So, holding the tty lock across the _entire_ close (which is what this
      patch does), even while waiting for output to drain, is equivalent to
      the current outcome wrt parallel opens.
      
      Cc: Alan Cox <alan@linux.intel.com>
      Cc: David Laight <David.Laight@aculab.com>
      CC: Arnd Bergmann <arnd@arndb.de>
      CC: Karsten Keil <isdn@linux-pingi.de>
      CC: linuxppc-dev@lists.ozlabs.org
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      79c1faa4
    • J
      serial: tegra: Add helper function for handling RX buffer · 32ede4a5
      Jon Hunter 提交于
      In the tegra UART driver there are three places where the RX DMA buffer
      is handled and pushed up to the tty layer. In all three instances the
      same functions are called and so instead of duplicating the code in three
      places, move this code to a new helper function and use this new function.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      32ede4a5
    • J
      serial: tegra: Remove redundant code and check in tegra_uart_stop_rx() · b0e066cc
      Jon Hunter 提交于
      The serial-tegra driver always uses DMA and hence the driver always
      allocates DMA channels. Therefore, the test to see if the RX DMA channel
      is initialised in tegra_uart_stop_rx() is unnecessary and so remove
      the test and the code that corresponds to the case where the RX DMA
      channel is not initialised. Please note that the call to
      tegra_uart_stop_rx() should always be before the call to
      tegra_uart_shutdown() which will uninitialise the RX DMA channel.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b0e066cc
    • J
      serial: tegra: Remove unnecessary return statements · 2230a947
      Jon Hunter 提交于
      Some functions in the serial-tegra driver have unnecessary return
      statements at the end of a void function and so remove them.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2230a947
    • J
      serial: tegra: Handle another RX race condition · 2a24bb28
      Jon Hunter 提交于
      Commit 853a6997 ("serial: tegra: handle race condition on uart rx
      side") attempted to fix a race condition between the RX end of
      transmission interrupt and RX DMA completion callback. Despite this
      fix there is still another case where these two paths can race and
      result in duplicated data. The race condition is as follows:
      
      1. DMA completion interrupt occurs and schedules tasklet to call DMA
         callback.
      2. DMA callback for the UART driver starts to execute. This will copy
         the data from the DMA buffer and restart the DMA. This is done under
         uart port spinlock.
      3. During the callback, UART interrupt is raised for end of receive. The
         UART ISR runs and waits to acquire port spinlock held by the DMA
         callback.
      4. DMA callback gives up spinlock after copying the data, but before
         restarting DMA.
      5. UART ISR acquires the spin lock and reads the same DMA buffer because
         DMA has not been restarted yet.
      
      The release of the spinlock during the DMA callback was introduced by
      commit 9b88748b ("tty: serial: tegra: drop uart_port->lock before
      calling tty_flip_buffer_push()") to fix a spinlock lock-up issue when
      calling tty_flip_buffer_push(). However, since then commit a9c3f68f
      ("tty: Fix low_latency BUG") migrated tty_flip_buffer_push() to always
      use a workqueue, allowing tty_flip_buffer_push() to be called from
      within atomic sections. Therefore, we can remove the unlocking of the
      spinlock from the DMA callback and UART ISR and this will ensure that
      the race condition no longer occurs.
      Reported-by: NChristopher Freeman <cfreeman@nvidia.com>
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2a24bb28
    • P
      serial: 8250_omap: Remove RTS clear · 0abcc6df
      Peter Hurley 提交于
      Clearing UART_MCR_RTS or UART_MCR_XONANY is unnecessary; these bits
      are never set in the shadow mcr. The RTS clear is especially confusing.
      Signed-off-by: NPeter Hurley <peter@hurleysoftware.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0abcc6df
    • S
      serial: Enable Freescale 16550 workaround on arm · d43b54d2
      Scott Wood 提交于
      The same serial hardware is present on LS2080A which is arm64, and
      LS1021A which is arm32, so don't limit the workaround to PPC.
      
      Unlike PPC which uses arch/powerpc/kernel/legacy_serial.c, the ARM
      targets use drivers/tty/serial/of_serial.c, so add the handle_irq
      override check there as well.
      Signed-off-by: NScott Wood <scottwood@freescale.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d43b54d2
    • A
      tty: serial: men_z135_uart.c: use mcb memory region size instead of hardcoded one · 37f06799
      Andreas Werner 提交于
      There is no need to hardcode the MEN_Z135_MEM_SIZE. The MCB subsystem
      already knowns the size which is located in the chameleon table.
      MCB parse the chameleon table to get the resources of each IP and provide
      the mcb_request_mem function to get those resources.
      
      Use mcb_request_mem to get the resources. This function also takes care of
      the memory region naming allocated by the driver for each of the instances.
      Signed-off-by: NAndreas Werner <andy@wernerandy.de>
      Acked-by: NJohannes Thumshirn <jthumshirn@suse.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      37f06799
    • A
      serial: atmel: fix compiler warning on address cast · 270c2ade
      Andre Przywara 提交于
      Turning on KVM and LPAE support on top of a multi_v7_defconfig will
      produce a compiler warning in the Atmel serial driver:
      drivers/tty/serial/atmel_serial.c: In function 'atmel_verify_port':
      drivers/tty/serial/atmel_serial.c:2299:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
        if ((void *)port->mapbase != ser->iomem_base)
            ^
      
      Fix that by using the cast on the right hand side instead, as similar
      code already does in other drivers.
      Signed-off-by: NAndre Przywara <andre.przywara@arm.com>
      Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      270c2ade
  2. 05 10月, 2015 21 次提交