1. 27 4月, 2020 1 次提交
  2. 31 7月, 2019 1 次提交
    • R
      serial: 8250: Fix TX interrupt handling condition · 1a2425b5
      Rautkoski Kimmo EXT 提交于
      [ Upstream commit db1b5bc047b3cadaedab3826bba82c3d9e023c4b ]
      
      Interrupt handler checked THRE bit (transmitter holding register
      empty) in LSR to detect if TX fifo is empty.
      In case when there is only receive interrupts the TX handling
      got called because THRE bit in LSR is set when there is no
      transmission (FIFO empty). TX handling caused TX stop, which in
      RS-485 half-duplex mode actually resets receiver FIFO. This is not
      desired during reception because of possible data loss.
      
      The fix is to check if THRI is set in IER in addition of the TX
      fifo status. THRI in IER is set when TX is started and cleared
      when TX is stopped.
      This ensures that TX handling is only called when there is really
      transmission on going and an interrupt for THRE and not when there
      are only RX interrupts.
      Signed-off-by: NKimmo Rautkoski <ext-kimmo.rautkoski@vaisala.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1a2425b5
  3. 14 7月, 2019 1 次提交
  4. 13 8月, 2018 1 次提交
    • M
      tty: serial: 8250: Revert NXP SC16C2552 workaround · 47ac7666
      Mark 提交于
      Revert commit ecb988a3: tty: serial:
      8250: 8250_core: NXP SC16C2552 workaround
      
      The above commit causes userland application to no longer write
      correctly its first write to a dumb terminal connected to /dev/ttyS0.
      This commit seems to be the culprit. It's as though the TX FIFO is being
      reset during that write. What should be displayed is:
      
      PSW 80000000 INST 00000000                           HALT
      //
      
      What is displayed is some variation of:
      
      T 00000000           HAL//
      
      Reverting this commit via this patch fixes my problem.
      Signed-off-by: NMark Hounschell <dmarkh@cfl.rr.com>
      Fixes: ecb988a3 ("tty: serial: 8250: 8250_core: NXP SC16C2552 workaround")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      47ac7666
  5. 25 7月, 2018 1 次提交
  6. 12 7月, 2018 2 次提交
  7. 06 7月, 2018 1 次提交
  8. 14 5月, 2018 1 次提交
  9. 23 4月, 2018 1 次提交
  10. 10 3月, 2018 1 次提交
  11. 28 2月, 2018 1 次提交
    • V
      serial: 8250: Don't service RX FIFO if interrupts are disabled · 2e9fe539
      Vignesh R 提交于
      Currently, data in RX FIFO is read based on UART_LSR register state even
      if RDI and RLSI interrupts are disabled in UART_IER register.
      This is because when IRQ handler is called due to TX FIFO empty event,
      RX FIFO is serviced based on UART_LSR register status instead of
      UART_IIR status. This defeats the purpose of disabling UART RX
      FIFO interrupts during throttling(see, omap_8250_throttle()) as IRQ
      handler continues to drain UART RX FIFO resulting in overflow of buffer
      at tty layer.
      Fix this by making sure that driver drains UART RX FIFO only when
      UART_IIR_RDI is set along with UART_LSR_BI or UART_LSR_DR bits.
      Signed-off-by: NVignesh R <vigneshr@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e9fe539
  12. 25 1月, 2018 1 次提交
    • A
      tty: serial: exar: Relocate sleep wake-up handling · c7e1b405
      Aaron Sierra 提交于
      Exar sleep wake-up handling has been done on a per-channel basis by
      virtue of INT0 being accessible from each channel's address space. I
      believe this was initially done out of necessity, but now that Exar
      devices have their own driver, we can do things more efficiently by
      registering a dedicated INT0 handler at the PCI device level.
      
      I see this change providing the following benefits:
      
          1. If more than one port is active, eliminates the redundant bus
             cycles for reading INT0 on every interrupt.
          2. This note associated with hooking in the per-channel handler in
             8250_port.c is resolved:
              /* Fixme: probably not the best place for this */
      
      Cc: Matt Schulte <matts@commtech-fastcom.com>
      Signed-off-by: NAaron Sierra <asierra@xes-inc.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c7e1b405
  13. 08 11月, 2017 2 次提交
    • G
      tty: serial: Remove redundant license text · 4793f2eb
      Greg Kroah-Hartman 提交于
      Now that the SPDX tag is in all tty files, that identifies the license
      in a specific and legally-defined manner.  So the extra GPL text wording
      can be removed as it is no longer needed at all.
      
      This is done on a quest to remove the 700+ different ways that files in
      the kernel describe the GPL license text.  And there's unneeded stuff
      like the address (sometimes incorrect) for the FSF which is never
      needed.
      
      No copyright headers or other non-license-description text was removed.
      
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Stefan Wahren <stefan.wahren@i2se.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ray Jui <rjui@broadcom.com>
      Cc: Scott Branden <sbranden@broadcom.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Joachim Eastwood <manabian@gmail.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Richard Genoud <richard.genoud@gmail.com>
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: Pat Gefre <pfg@sgi.com>
      Cc: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Vladimir Zapolskiy <vz@mleia.com>
      Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Andy Gross <andy.gross@linaro.org>
      Cc: David Brown <david.brown@linaro.org>
      Cc: "Andreas Färber" <afaerber@suse.de>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Barry Song <baohua@kernel.org>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: Peter Korsgaard <jacmet@sunsite.dk>
      Cc: Timur Tabi <timur@tabi.org>
      Cc: Tony Prisk <linux@prisktech.co.nz>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4793f2eb
    • G
      tty: add SPDX identifiers to all remaining files in drivers/tty/ · e3b3d0f5
      Greg Kroah-Hartman 提交于
      It's good to have SPDX identifiers in all files to make it easier to
      audit the kernel tree for correct licenses.
      
      Update the drivers/tty files files with the correct SPDX license
      identifier based on the license text in the file itself.  The SPDX
      identifier is a legally binding shorthand, which can be used instead of
      the full boiler plate text.
      
      This work is based on a script and data from Thomas Gleixner, Philippe
      Ombredanne, and Kate Stewart.
      
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Chris Metcalf <cmetcalf@mellanox.com>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: David Sterba <dsterba@suse.com>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Eric Anholt <eric@anholt.net>
      Cc: Stefan Wahren <stefan.wahren@i2se.com>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Ray Jui <rjui@broadcom.com>
      Cc: Scott Branden <sbranden@broadcom.com>
      Cc: bcm-kernel-feedback-list@broadcom.com
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Joachim Eastwood <manabian@gmail.com>
      Cc: Matthias Brugger <matthias.bgg@gmail.com>
      Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Richard Genoud <richard.genoud@gmail.com>
      Cc: Alexander Shiyan <shc_work@mail.ru>
      Cc: Baruch Siach <baruch@tkos.co.il>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      Cc: "Uwe Kleine-König" <kernel@pengutronix.de>
      Cc: Pat Gefre <pfg@sgi.com>
      Cc: "Guilherme G. Piccoli" <gpiccoli@linux.vnet.ibm.com>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Vladimir Zapolskiy <vz@mleia.com>
      Cc: Sylvain Lemieux <slemieux.tyco@gmail.com>
      Cc: Carlo Caione <carlo@caione.org>
      Cc: Kevin Hilman <khilman@baylibre.com>
      Cc: Liviu Dudau <liviu.dudau@arm.com>
      Cc: Sudeep Holla <sudeep.holla@arm.com>
      Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Cc: Andy Gross <andy.gross@linaro.org>
      Cc: David Brown <david.brown@linaro.org>
      Cc: "Andreas Färber" <afaerber@suse.de>
      Cc: Kevin Cernekee <cernekee@gmail.com>
      Cc: Laxman Dewangan <ldewangan@nvidia.com>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Barry Song <baohua@kernel.org>
      Cc: Patrice Chotard <patrice.chotard@st.com>
      Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
      Cc: Alexandre Torgue <alexandre.torgue@st.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Peter Korsgaard <jacmet@sunsite.dk>
      Cc: Timur Tabi <timur@tabi.org>
      Cc: Tony Prisk <linux@prisktech.co.nz>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: "Sören Brinkmann" <soren.brinkmann@xilinx.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Kate Stewart <kstewart@linuxfoundation.org>
      Cc: Philippe Ombredanne <pombredanne@nexb.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e3b3d0f5
  14. 04 11月, 2017 1 次提交
    • T
      serial: 8250: fix potential deadlock in rs485-mode · b86f86e8
      Tomas Melin 提交于
      Canceling hrtimer when holding uart spinlock can deadlock.
      
      CPU0: syscall write
                -> get uart port spinlock
                    -> write uart
                        -> start_tx_rs485
                            -> hrtimer_cancel
                                -> wait for hrtimer callback to finish
      
      CPU1: hrtimer IRQ
                -> run hrtimer
                    -> em485_handle_stop_tx
                        -> get uart port spinlock
      
      CPU0 is waiting for the hrtimer callback to finish, but the hrtimer
      callback running on CPU1 is waiting to get the uart port spinlock.
      
      This deadlock can be avoided by not canceling the hrtimers in these paths.
      Setting active_timer=NULL can be done without accessing hrtimer,
      and that will effectively cancel operations that would otherwise have been
      performed by the hrtimer callback.
      Signed-off-by: NTomas Melin <tomas.melin@vaisala.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b86f86e8
  15. 20 10月, 2017 1 次提交
  16. 04 10月, 2017 1 次提交
  17. 01 9月, 2017 1 次提交
  18. 29 8月, 2017 2 次提交
  19. 30 7月, 2017 1 次提交
  20. 29 6月, 2017 1 次提交
    • P
      serial: 8250: Fix THRE flag usage for CAP_MINI · cfde770d
      Phil Elwell 提交于
      The BCM2835 MINI UART has non-standard THRE semantics. Conventionally
      the bit means that the FIFO is empty (although there may still be a
      byte in the transmit register), but on 2835 it indicates that the FIFO
      is not full. This causes interrupts after every byte is transmitted,
      with the FIFO providing some interrupt latency tolerance.
      
      A consequence of this difference is that the usual strategy of writing
      multiple bytes into the TX FIFO after checking THRE once is unsafe.
      In the worst case of 7 bytes in the FIFO, writing 8 bytes loses all
      but the first since by then the FIFO is full.
      
      There is an HFIFO ("Hidden FIFO") capability that causes the transmit
      loop to terminate when both THRE and TEMT are set, i.e. when the TX
      block is completely idle. This is unnecessarily cautious, potentially
      causing gaps in transmission.
      
      Add a new conditional to the transmit loop, predicated on CAP_MINI,
      that exits when THRE is no longer set (the FIFO is full). This allows
      the FIFO to fill quickly but subsequent writes are paced by the
      transmission rate.
      Signed-off-by: NPhil Elwell <phil@raspberrypi.org>
      Acked-by: NEric Anholt <eric@anholt.net>
      Acked-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cfde770d
  21. 24 5月, 2017 1 次提交
  22. 18 5月, 2017 3 次提交
  23. 18 4月, 2017 1 次提交
  24. 10 2月, 2017 1 次提交
  25. 12 1月, 2017 2 次提交
    • D
      serial: 8250: Add new port type for TI DA8xx/66AK2x · a2d6a987
      David Lechner 提交于
      This adds a new UART port type for TI DA8xx/OMAPL13x/AM17xx/AM18xx/66AK2x.
      These SoCs have standard 8250 registers plus some extra non-standard
      registers.
      
      The UART will not function unless the non-standard Power and Emulation
      Management Register (PWREMU_MGMT) is configured correctly. This is
      currently handled in arch/arm/mach-davinci/serial.c for non-device-tree
      boards. Making this part of the UART driver will allow UART to work on
      device-tree boards as well and the mach code can eventually be removed.
      Signed-off-by: NDavid Lechner <david@lechnology.com>
      Acked-by: NSekhar Nori <nsekhar@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a2d6a987
    • A
      serial: 8250_port: Remove dangerous pr_debug() · 699a11ba
      Alexey Brodkin 提交于
      With CONFIG_DYNAMIC_DEBUG if dyndbg enables debug output in
      8250_port.c deadlock happens inevitably on UART IRQ handling.
      
      That's the problematic execution path:
      ---------------------------->8------------------------
      UART IRQ:
        serial8250_interrupt() ->
          serial8250_handle_irq(): lock "port->lock" ->
            pr_debug() ->
              serial8250_console_write(): bump in locked "port->lock".
      
            OR (if above pr_debug() gets removed):
            serial8250_tx_chars() ->
              pr_debug() ->
                serial8250_console_write(): bump in locked "port->lock".
      ---------------------------->8------------------------
      
      So let's get rid of those not that much useful debug entries.
      
      Discussed problem could be easily reproduced with QEMU for x86_64.
      As well as this fix could be mimicked with muting of dynamic debug for
      the problematic lines as simple as:
      ---------------------------->8------------------------
      dyndbg="+p; file 8250_port.c line 1756 -p; file 8250_port.c line 1822 -p"
      ---------------------------->8------------------------
      Signed-off-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Phillip Raffeck <phillip.raffeck@fau.de>
      Cc: Anton Wuerfel <anton.wuerfel@fau.de>
      Cc: "Matwey V. Kornilov" <matwey@sai.msu.ru>
      Cc: Yegor Yefremov <yegorslists@googlemail.com>
      Cc: Thor Thayer <tthayer@opensource.altera.com>
      Reviewed-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      699a11ba
  26. 11 1月, 2017 1 次提交
    • D
      Clearing FIFOs in RS485 emulation mode causes subsequent transmits to break · 2bed8a8e
      Daniel Jedrychowski 提交于
      When in RS485 emulation mode, __do_stop_tx_rs485() calls
      serial8250_clear_fifos().  This not only clears the FIFOs, but also sets
      all bits in their control register (UART_FCR) to 0.
      
      One of the effects of this is the disabling of the FIFOs, which turns
      them into single-byte holding registers.  The rest of the driver doesn't
      know this, which results in the lions share of characters passed into a
      write call to be dropped.
      
      (I can supply logic analyzer screenshots if necessary)
      
      This fix replaces the serial8250_clear_fifos() call to
      serial8250_clear_and_reinit_fifos() - this prevents the "dropped
      characters" issue from manifesting again while retaining the requirement
      of clearing the RX FIFO after transmission if the SER_RS485_RX_DURING_TX
      flag is disabled.
      Signed-off-by: NDaniel Jedrychowski <avistel@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2bed8a8e
  27. 16 11月, 2016 2 次提交
  28. 27 10月, 2016 1 次提交
  29. 27 9月, 2016 1 次提交
  30. 22 9月, 2016 1 次提交
    • J
      tty/serial/8250: Touch NMI watchdog in wait_for_xmitr · 54f19b4a
      Jiri Olsa 提交于
      First loop in wait_for_xmitr could also trigger NMI
      watchdog in case reading from the port is slow:
      
        PID: 0      TASK: ffffffff819c1460  CPU: 0   COMMAND: "swapper/0"
         #0 [ffff88019f405e58] crash_nmi_callback at ffffffff8104d382
         #1 [ffff88019f405e68] nmi_handle at ffffffff8168ead9
         #2 [ffff88019f405eb0] do_nmi at ffffffff8168ec53
         #3 [ffff88019f405ef0] end_repeat_nmi at ffffffff8168df13
            [exception RIP: delay_tsc+50]
            RIP: ffffffff81325642  RSP: ffff88019f403bb0  RFLAGS: 00000083
            RAX: 00000000000005c8  RBX: ffffffff81f83000  RCX: 0000024e4fb88a8b
            RDX: 0000024e4fb89053  RSI: 0000000000000000  RDI: 00000000000007d1
            RBP: ffff88019f403bb0   R8: 000000000000000a   R9: 0000000000000000
            R10: 0000000000000000  R11: ffff88019f403ad6  R12: 000000000000250f
            R13: 0000000000000020  R14: ffffffff81d360c7  R15: 0000000000000047
            ORIG_RAX: ffffffffffffffff  CS: 0010  SS: 0018
        --- <NMI exception stack> ---
         #4 [ffff88019f403bb0] delay_tsc at ffffffff81325642
         #5 [ffff88019f403bb8] __const_udelay at ffffffff813255a8
         #6 [ffff88019f403bc8] wait_for_xmitr at ffffffff81404390
         #7 [ffff88019f403bf0] serial8250_console_putchar at ffffffff8140455c
         #8 [ffff88019f403c10] uart_console_write at ffffffff813ff00a
         #9 [ffff88019f403c40] serial8250_console_write at ffffffff814044ae
        #10 [ffff88019f403c88] call_console_drivers.constprop.15 at ffffffff81086b01
        #11 [ffff88019f403cb0] console_unlock at ffffffff8108842f
        #12 [ffff88019f403ce8] vprintk_emit at ffffffff81088834
        #13 [ffff88019f403d58] vprintk_default at ffffffff81088ba9
        #14 [ffff88019f403d68] printk at ffffffff8167f034
      
      Adding touch_nmi_watchdog call to the first loop as well.
      Reported-by: NChunyu Hu <chuhu@redhat.com>
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      54f19b4a
  31. 02 9月, 2016 2 次提交
  32. 31 8月, 2016 1 次提交