08 Mar, 2016

31 commits

  • CONFIG_SERIAL_8250_RSA has waited for a long
    time to have meaningful help text so let's
    finally describe what this option actually does.

    Signed-off-by: Maciej S. Szmigiero
    Signed-off-by: Greg Kroah-Hartman

    Maciej S. Szmigiero
     
  • This patch optimizes UART rx fifo access routine by reading UART SFR
    when necessary. At first, the "fifocnt" variable will be initialized
    as Rx FIFO count. So we don't need to access UFSTAT(FIFO status) register
    every time to check FIFO count because we know that count with "fifocnt".
    After all data were read out from Rx FIFO, the "fifocnt" will be set as 0.
    Lastly, UFSTAT will be accessed again to check whether the data remains
    by any chance.

    Signed-off-by: Youngmin Nam
    Reviewed-by: Jung-Ick Guack
    Signed-off-by: Greg Kroah-Hartman

    Youngmin Nam
     
  • PL011 UART has hardware mark/space parity ability, this trivial patch adds support for it.
    Tested on Raspberry Pi v1, v2 (BCM2835 and BCM2836)

    Signed-off-by: Ed Spiridonov
    Signed-off-by: Greg Kroah-Hartman

    Ed Spiridonov
     
  • Add support for :

    - CP-102E: 2 ports RS232 PCIE card
    - CP-102EL: 2 ports RS232 PCIE card
    - CP-132EL: 2 ports RS422/485 PCIE card
    - CP-114EL: 4 ports RS232/422/485 PCIE card
    - CP-104EL-A: 4 ports RS232 PCIE card
    - CP-168EL-A: 8 ports RS232 PCIE card
    - CP-118EL-A: 8 ports RS232/422/485 PCIE card
    - CP-118E-A: 8 ports RS422/485 PCIE card
    - CP-138E-A: 8 ports RS422/485 PCIE card
    - CP-134EL-A: 4 ports RS422/485 PCIE card
    - CP-116E-A (A): 8 ports RS232/422/485 PCIE card
    - CP-116E-A (B): 8 ports RS232/422/485 PCIE card

    This patch is based on information extracted from
    vendor mxupcie driver available on MOXA website.

    I was able to test it on a CP-168EL-A on PC.

    Signed-off-by: Mathieu OTHACEHE
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Mathieu OTHACEHE
     
  • up_to_u8250p() casts struct uart_port * to struct uart_8250_port *. Update code
    to use it instead of open coded variant.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • The Mediatek 8250 driver has a 'bool' Kconfig symbol, but that
    breaks when SERIAL_8250 is a loadable module:

    drivers/tty/built-in.o: In function `mtk8250_set_termios':
    :(.text+0x1bee8): undefined reference to `serial8250_do_set_termios'
    :(.text+0x1bf10): undefined reference to `uart_get_baud_rate'
    :(.text+0x1c09c): undefined reference to `uart_get_divisor'
    drivers/tty/built-in.o: In function `mtk8250_do_pm':
    :(.text+0x1c0d0): undefined reference to `serial8250_do_pm'
    drivers/tty/built-in.o: In function `mtk8250_probe':
    :(.text+0x1c2e4): undefined reference to `serial8250_register_8250_port'
    serial/8250/8250_mtk.c:287:242: error: data definition has no type or storage class [-Werror]
    serial/8250/8250_mtk.c:287:122: error: 'mtk8250_platform_driver_init' defined but not used [-Werror=unused-function]

    This changes the symbol to a 'tristate', so the dependency on
    SERIAL_8250 also works when that is set to 'm'.
    To actually build the driver, we also need to include .

    Signed-off-by: Arnd Bergmann
    Acked-by: Matthias Brugger
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • The Ingenic 8250 driver has a 'bool' Kconfig symbol, but that
    breaks when SERIAL_8250 is a loadable module:

    drivers/tty/built-in.o: In function `ingenic_uart_probe':
    8250_ingenic.c:(.text+0x1c1a0): undefined reference to `serial8250_register_8250_port'

    This changes the symbol to a 'tristate', plus a dependency on
    SERIAL_8250, which makes it work again. Unlike the other
    soc-specific backends, this one has no dependency on an
    architecture or a platform. I'm adding a dependency on
    MIPS || COMPILE_TEST as well here, to avoid showing the driver
    on architectures that are not interested in it.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • The newly added uniphier serial port driver fails to build as
    a loadable module when the base 8250 driver is built-in and
    its console support enabled:

    ERROR: "early_serial8250_setup" [drivers/tty/serial/8250/8250_uniphier.ko] undefined!

    This changes the driver to only provide the early console support
    if it is built-in itself as well.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • This reverts commit cafe1ac64023 ("drivers/tty: make serial
    8250_ingenic.c explicitly non-modular"), which attempted to remove dead
    code but did not have the desired effect when the main 8250 driver was
    a loadable module itself.

    This would normally result in a link error, but as the entire
    drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250
    is set, we never notice that the driver does not get built in this
    configuration.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • This reverts commit d72d391c126e ("drivers/tty/serial: make
    8250/8250_mtk.c explicitly non-modular"), which intended to remove dead
    code but did not have the desired effect when the main 8250 driver was
    a module itself.

    This would normally result in a link error, but as the entire
    drivers/tty/serial/8250/ directory is only entered when CONFIG_SERIAL_8250
    is set, we never notice that the driver does not get built in this
    configuration.

    Signed-off-by: Arnd Bergmann
    Acked-by: Matthias Brugger
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • Armada-3700's uart is a simple serial port, which doesn't
    support. Configuring the modem control lines. The uart port has a 32
    bytes Tx FIFO and a 64 bytes Rx FIFO

    The uart driver implements the uart core operations. It also support the
    system (early) console based on Armada-3700's serial port.

    Known Issue:

    The uart driver currently doesn't support clock programming, which means
    the baud-rate stays with the default value configured by the bootloader
    at boot time

    [gregory.clement@free-electrons.com: Rewrite many part which are too long
    to enumerate]

    Signed-off-by: Wilson Ding
    Signed-off-by: Nadav Haklai
    Signed-off-by: Gregory CLEMENT
    Acked-by: Rob Herring
    Signed-off-by: Greg Kroah-Hartman

    Wilson Ding
     
  • As the mctrl_gpio driver can be built as a module, it needs to have its
    license specified with MODULE_LICENSE. Otherwise, it cannot access
    required symbols exported through EXPORT_SYMBOL_GPL.

    Signed-off-by: Romain Izard
    Acked-by: Uwe Kleine-König
    Signed-off-by: Greg Kroah-Hartman

    Romain Izard
     
  • gcc warns about a potential use of an uninitialized variable in this driver:

    drivers/tty/serial/ifx6x60.c: In function 'ifx_spi_complete':
    drivers/tty/serial/ifx6x60.c:713:6: warning: 'more' may be used uninitialized in this function [-Wmaybe-uninitialized]
    if (more || ifx_dev->spi_more || queue_length > 0 ||

    Unlike a lot of other such warnings, this one is correct and describes
    an actual problem in the handling of the "IFX_SPI_HEADER_F" result code.

    This appears to be a result from a restructuring of the driver that
    dates back to before it was merged in the kernel, so it's impossible
    to know where it went wrong. I also don't know what that result code
    means, so I have no idea if setting 'more' to zero is the correct
    solution, but at least it makes the behavior reproducible rather than
    depending on whatever happens to be on the kernel stack.

    This patch initializes the 'more' variable to zero in each of the
    three code paths that could result in undefined behavior before,
    which is more explicit than initializing it at the start of the
    function.

    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • With SAMA5D2, the UART has hw timeout but the offset of the register to
    define this value is not the same as the one for USART.
    When using the new UART, the value of this register was 0 so we never
    get timeout irqs. It involves that when using DMA, we were stuck until
    the execution of the dma callback which happens when a buffer is full
    (so after receiving 2048 bytes).

    Signed-off-by: Ludovic Desroches
    Acked-by: Nicolas Ferre
    Signed-off-by: Greg Kroah-Hartman

    Ludovic Desroches
     
  • In commit c39dfebc7798956fd2140ae6321786ff35da30c3, the modular support
    code for atmel_serial was removed, as the driver cannot be built as a
    module. Because no use case was proposed, the dynamic driver binding
    support was removed as well.

    The atmel_serial driver can manage up to 7 serial controllers, which are
    multiplexed with other functions. For example, in the Atmel SAMA5D2, the
    Flexcom controllers can work as USART, SPI or I2C controllers, and on
    all Atmel devices serial lines can be reconfigured as GPIOs.

    My use case uses GPIOs to transfer a firmware update using a custom
    protocol on the lines used as a serial port during the normal life of
    the device. If it is not possible to unbind the atmel_serial driver, the
    GPIO lines remain reserved and prevent this case from working.

    This patch reinstates the atmel_serial_remove function, and fixes it as
    it failed to clear the "clk" field on removal, triggering an oops when
    a device was bound again after being unbound.

    Acked-by: Nicolas Ferre
    Signed-off-by: Romain Izard
    Signed-off-by: Greg Kroah-Hartman

    Romain Izard
     
  • Kconfig option SERIAL_8250_RT288X seems to be only relevant on MIPS
    platforms, so do not present it on other architectures, unless
    build-testing.

    Signed-off-by: Jean Delvare
    Cc: Mans Rullgard
    Cc: Jiri Slaby
    Acked-by: John Crispin
    Signed-off-by: Greg Kroah-Hartman

    Jean Delvare
     
  • This device generates a short rising pulse on the interrupt request line.

    Signed-off-by: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman

    Maarten Brock
     
  • Better to hold the spinlock as short as possible.

    Signed-off-by: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman

    Maarten Brock
     
  • Made uartlite_be and uartlite_le constants.

    Signed-off-by: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman

    Maarten Brock
     
  • This device is ideal to use when you need a lot of uarts in your FPGA.
    Try not to force all those users to patch their kernel.

    Signed-off-by: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman

    Maarten Brock
     
  • There is no need to have channel offset defined since all BayTrail and Braswell
    ports are 1 channel. Remove unneeded definition.

    While here, remove comment which has no value.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • The managed API provides a better approach to help with acquiring and releasing
    resources. Besides that error handling becomes simpler.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • The clocks are managed through clk-fractional-divider.c module, and thus CLK
    framework takes care about it. Remove letfovers from this driver.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • When the main branch contains return statement the 'else' keyword is not
    needed. Remove it here.

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • Support early console setup via DT for all listed compatible strings.
    Remove EARLYCON_DECLARE which was done by:
    "Use common framework for earlycon declarations"
    (sha1: 2eaa790989e03900298ad24f77f1086dbbc1aebd)
    when OF_EARLYCON_DECLARE is defined.

    Signed-off-by: Michal Simek
    Reviewed-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Michal Simek
     
  • Make use of ARCH_RENESAS in place of ARCH_SHMOBILE.

    This is part of an ongoing process to migrate from ARCH_SHMOBILE to
    ARCH_RENESAS the motivation for which being that RENESAS seems to be a more
    appropriate name than SHMOBILE for the majority of Renesas ARM based SoCs.

    Signed-off-by: Simon Horman
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Greg Kroah-Hartman

    Simon Horman
     
  • As of commit 2eaa790989e03900 ("earlycon: Use common framework for
    earlycon declarations") it is no longer needer to specify both
    EARLYCON_DECLARE() and OF_EARLYCON_DECLARE().

    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Peter Hurley
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • When only a TX DMA channel is specified in DT, pl011_dma_probe() falls
    back to looking for the optional RX channel in platform data. What it
    doesn't do is check whether that platform data actually exists...

    Add the missing check to avoid crashing the kernel.

    Signed-off-by: Robin Murphy
    Signed-off-by: Greg Kroah-Hartman

    Robin Murphy
     
  • serial8250_em485_init() is supposed to be protected with
    p->port.lock spinlock.
    This may lead to issues when kmalloc sleeps, so it is better to use
    GFP_ATOMIC in this spinlocked context.

    Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
    Reported-by: Ильяс Гасанов
    Signed-off-by: Matwey V. Kornilov
    Signed-off-by: Greg Kroah-Hartman

    Matwey V. Kornilov
     
  • Formally, currently there is no memory leak, but if
    serial8250_ports[line] is reused with other 8250 driver, then em485
    will be already activated and it will cause issues.

    Fixes: e490c9144cfa ("tty: Add software emulated RS485 support for 8250")
    Signed-off-by: Matwey V. Kornilov
    Signed-off-by: Greg Kroah-Hartman

    Matwey V. Kornilov
     
  • This reverts commit a3f0b77f36ca5c5871fb8daf7e66fa409abe1ed5.

    Maarten writes:
    It appears to be wrong and I don't have a good idea how to fix
    it yet.

    Cc: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman gregkh@linuxfoundation.org

    Greg Kroah-Hartman
     

15 Feb, 2016

9 commits

  • Add support for manual getting the modem control lines.

    Signed-off-by: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman

    Maarten Brock
     
  • Add support for manual setting the modem control lines.

    Signed-off-by: Maarten Brock
    Signed-off-by: Greg Kroah-Hartman

    Maarten Brock
     
  • IS_ERR_VALUE() assumes that its parameter is an unsigned long.
    It can not be used to check if an unsigned int reflects an error.
    Doing so can result in the following build warning.

    drivers/tty/serial/digicolor-usart.c: In function ‘digicolor_uart_probe’:
    include/linux/err.h:21:38: warning:
    comparison is always false due to limited range of data type
    drivers/tty/serial/digicolor-usart.c:485:6: note:
    in expansion of macro ‘IS_ERR_VALUE’

    If that warning is seen, an error return from platform_get_irq() is missed.

    Signed-off-by: Guenter Roeck
    Acked-by: Baruch Siach
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • IS_ERR_VALUE() assumes that its parameter is an unsigned long.
    It can not be used to check if an unsigned int reflects an error.
    Doing so can result in the following build warning.

    drivers/tty/serial/clps711x.c: In function ‘uart_clps711x_probe’:
    include/linux/err.h:21:38: warning:
    comparison is always false due to limited range of data type
    drivers/tty/serial/clps711x.c:471:6: note: in expansion of macro ‘IS_ERR_VALUE’

    If that warning is seen, an error return from platform_get_irq() is missed.

    Use a temporary variable to check for errors from platform_get_irq().
    Also don't use IS_ERR_VALUE() to check if an integer variable is < 0.
    The variable can be checked directly in that case.

    Signed-off-by: Guenter Roeck
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • Fixes error condition check when requesting the irq,
    that would not trigger because of uart_port.irq being
    defined as unsigned int.

    Reported by: Dan Carpenter
    Signed-off-by: Martin Sperl
    Signed-off-by: Greg Kroah-Hartman

    Martin Sperl
     
  • Declare an OF early console for Tegra so that the early console device
    can be specified via the "stdout-path" property in device-tree.

    Signed-off-by: Jon Hunter
    Signed-off-by: Greg Kroah-Hartman

    Jon Hunter
     
  • The mtk8250_runtime_suspend function is not used when runtime PM is
    disabled, so we get a warning about an unused function:

    drivers/tty/serial/8250/8250_mtk.c:119:12: error: 'mtk8250_runtime_suspend' defined but not used [-Werror=unused-function]
    static int mtk8250_runtime_suspend(struct device *dev)

    This marks all the PM functions as __maybe_unused to avoid the warning,
    and removes the #ifdef around the PM_SLEEP functions for consistency.

    Signed-off-by: Arnd Bergmann
    Acked-by: Matthias Brugger
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • Fix the baudrate calculation for 24 MHz XTAL clock found on gxbb platforms.

    Signed-off-by: Andreas Färber
    Acked-by: Carlo Caione
    Signed-off-by: Greg Kroah-Hartman

    Andreas Färber
     
  • We want the fixes in here, and this resolves a merge error in tty_io.c

    Signed-off-by: Greg Kroah-Hartman

    Greg Kroah-Hartman